This commit is contained in:
Zhiyuan Zheng 2021-05-15 23:08:13 +02:00
parent d4c93750c7
commit 4499bb8bae
No known key found for this signature in database
GPG Key ID: 078A93AB607D85E0
6 changed files with 57 additions and 83 deletions

View File

@ -15,7 +15,7 @@ GEM
artifactory (3.0.15)
atomos (0.1.3)
aws-eventstream (1.1.1)
aws-partitions (1.445.0)
aws-partitions (1.455.0)
aws-sdk-core (3.114.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0)
@ -24,7 +24,7 @@ GEM
aws-sdk-kms (1.43.0)
aws-sdk-core (~> 3, >= 3.112.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.93.1)
aws-sdk-s3 (1.94.1)
aws-sdk-core (~> 3, >= 3.112.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.1)
@ -71,10 +71,9 @@ GEM
cocoapods-try (1.2.0)
colored (1.2)
colored2 (3.1.2)
commander-fastlane (4.4.6)
highline (~> 1.7.2)
commander (4.6.0)
highline (~> 2.0.0)
concurrent-ruby (1.1.8)
connection_pool (2.2.5)
declarative (0.0.20)
digest-crc (0.6.3)
rake (>= 12.0.0, < 14.0.0)
@ -85,25 +84,23 @@ GEM
escape (0.0.4)
ethon (0.12.0)
ffi (>= 1.3.0)
excon (0.80.1)
faraday (1.4.0)
faraday-excon (~> 1.0)
excon (0.81.0)
faraday (1.4.1)
faraday-excon (~> 1.1)
faraday-net_http (~> 1.0)
faraday-net_http_persistent (~> 1.0)
faraday-net_http_persistent (~> 1.1)
multipart-post (>= 1.2, < 3)
ruby2_keywords (>= 0.0.4)
faraday-cookie_jar (0.0.7)
faraday (>= 0.8.0)
http-cookie (~> 1.0.0)
faraday-excon (1.0.0)
excon (>= 0.27.4)
faraday-excon (1.1.0)
faraday-net_http (1.0.1)
faraday-net_http_persistent (1.0.3)
net-http-persistent (>= 3.1)
faraday-net_http_persistent (1.1.0)
faraday_middleware (1.0.0)
faraday (~> 1.0)
fastimage (2.2.3)
fastlane (2.180.1)
fastlane (2.182.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.3, < 3.0.0)
artifactory (~> 3.0)
@ -111,7 +108,7 @@ GEM
babosa (>= 1.0.3, < 2.0.0)
bundler (>= 1.12.0, < 3.0.0)
colored
commander-fastlane (>= 4.4.6, < 5.0.0)
commander (~> 4.6)
dotenv (>= 2.1.1, < 3.0.0)
emoji_regex (>= 0.1, < 4.0)
excon (>= 0.71.0, < 1.0.0)
@ -122,7 +119,7 @@ GEM
gh_inspector (>= 1.1.2, < 2.0.0)
google-api-client (>= 0.37.0, < 0.39.0)
google-cloud-storage (>= 1.15.0, < 2.0.0)
highline (>= 1.7.2, < 2.0.0)
highline (~> 2.0)
json (< 3.0.0)
jwt (>= 2.1.0, < 3)
mini_magick (>= 4.9.4, < 5.0.0)
@ -132,7 +129,6 @@ GEM
rubyzip (>= 2.0.0, < 3.0.0)
security (= 0.1.3)
simctl (~> 1.6.3)
slack-notifier (>= 2.0.0, < 3.0.0)
terminal-notifier (>= 2.0.0, < 3.0.0)
terminal-table (>= 1.4.5, < 2.0.0)
tty-screen (>= 0.6.3, < 1.0.0)
@ -185,14 +181,14 @@ GEM
google-cloud-core (~> 1.2)
googleauth (~> 0.9)
mini_mime (~> 1.0)
googleauth (0.16.1)
googleauth (0.16.2)
faraday (>= 0.17.3, < 2.0)
jwt (>= 1.4, < 3.0)
memoist (~> 0.16)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (~> 0.14)
highline (1.7.10)
highline (2.0.3)
http-cookie (1.0.3)
domain_name (~> 0.5)
httpclient (2.8.3)
@ -200,7 +196,7 @@ GEM
concurrent-ruby (~> 1.0)
jmespath (1.4.0)
json (2.5.1)
jwt (2.2.2)
jwt (2.2.3)
memoist (0.16.2)
mini_magick (4.11.0)
mini_mime (1.1.0)
@ -211,8 +207,6 @@ GEM
nanaimo (0.3.0)
nap (1.1.0)
naturally (2.2.1)
net-http-persistent (4.0.1)
connection_pool (~> 2.2)
netrc (0.11.0)
os (1.1.1)
plist (3.6.0)
@ -237,7 +231,6 @@ GEM
simctl (1.6.8)
CFPropertyList
naturally
slack-notifier (2.3.2)
terminal-notifier (2.0.0)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)

View File

@ -109,8 +109,8 @@ private_lane :build_ios do
upload_to_app_store( ipa: IPA_FILE, app_version: VERSION )
else
if !is_ci
match( type: "development", readonly: true )
build_ios_app( export_method: "development", output_directory: BUILD_DIRECTORY, silent: true )
match( type: "adhoc", readonly: true )
build_ios_app( export_method: "ad-hoc", output_directory: BUILD_DIRECTORY, silent: true )
install_on_device( skip_wifi: true )
end
end

View File

@ -2,65 +2,25 @@ import { MenuContainer, MenuRow } from '@components/Menu'
import { useNavigation } from '@react-navigation/native'
import { useAnnouncementQuery } from '@utils/queryHooks/announcement'
import { useListsQuery } from '@utils/queryHooks/lists'
import React, { useMemo } from 'react'
import React from 'react'
import { useTranslation } from 'react-i18next'
const Collections: React.FC = () => {
const { t, i18n } = useTranslation('screenTabs')
const { t } = useTranslation('screenTabs')
const navigation = useNavigation()
const listsQuery = useListsQuery({
options: {
notifyOnChangeProps: []
notifyOnChangeProps: ['data']
}
})
const rowLists = useMemo(() => {
if (listsQuery.isSuccess && listsQuery.data?.length) {
return (
<MenuRow
iconFront='List'
iconBack='ChevronRight'
title={t('me.stacks.lists.name')}
onPress={() => navigation.navigate('Tab-Me-Lists')}
/>
)
} else {
return null
}
}, [listsQuery.isSuccess, listsQuery.data, i18n.language])
const announcementsQuery = useAnnouncementQuery({
showAll: true,
options: {
notifyOnChangeProps: []
notifyOnChangeProps: ['data']
}
})
const rowAnnouncements = useMemo(() => {
if (announcementsQuery.isSuccess && announcementsQuery.data?.length) {
const amount = announcementsQuery.data.filter(
announcement => !announcement.read
).length
return (
<MenuRow
iconFront='Clipboard'
iconBack='ChevronRight'
title={t('screenAnnouncements:heading')}
content={
amount
? t('me.root.announcements.content.unread', {
amount
})
: t('me.root.announcements.content.read')
}
onPress={() =>
navigation.navigate('Screen-Announcements', { showAll: true })
}
/>
)
} else {
return null
}
}, [announcementsQuery.isSuccess, announcementsQuery.data, i18n.language])
return (
<MenuContainer>
@ -82,8 +42,34 @@ const Collections: React.FC = () => {
title={t('me.stacks.favourites.name')}
onPress={() => navigation.navigate('Tab-Me-Favourites')}
/>
{rowLists}
{rowAnnouncements}
{listsQuery.data?.length ? (
<MenuRow
iconFront='List'
iconBack='ChevronRight'
title={t('me.stacks.lists.name')}
onPress={() => navigation.navigate('Tab-Me-Lists')}
/>
) : null}
{announcementsQuery.data?.length ? (
<MenuRow
iconFront='Clipboard'
iconBack='ChevronRight'
title={t('screenAnnouncements:heading')}
content={
announcementsQuery.data.filter(announcement => !announcement.read)
.length
? t('me.root.announcements.content.unread', {
amount: announcementsQuery.data.filter(
announcement => !announcement.read
).length
})
: t('me.root.announcements.content.read')
}
onPress={() =>
navigation.navigate('Screen-Announcements', { showAll: true })
}
/>
) : null}
</MenuContainer>
)
}

View File

@ -5,10 +5,10 @@ import {
} from '@utils/slices/settingsSlice'
import { StyleConstants } from '@utils/styles/constants'
import { useTheme } from '@utils/styles/ThemeManager'
import * as Updates from 'expo-updates'
import React from 'react'
import { useTranslation } from 'react-i18next'
import { StyleSheet, Text } from 'react-native'
import { Constants } from 'react-native-unimodules'
import { useDispatch, useSelector } from 'react-redux'
const SettingsAnalytics: React.FC = () => {
@ -29,10 +29,7 @@ const SettingsAnalytics: React.FC = () => {
}
/>
<Text style={[styles.version, { color: theme.secondary }]}>
{t('me.settings.version', {
// @ts-ignore
version: Updates.manifest?.version
})}
{t('me.settings.version', { version: Constants.manifest.version })}
</Text>
</MenuContainer>
)

View File

@ -1,12 +1,12 @@
import * as Updates from 'expo-updates'
import { Constants } from 'react-native-unimodules'
import * as Sentry from 'sentry-expo'
import log from './log'
const sentry = () => {
log('log', 'Sentry', 'initializing')
Sentry.init({
// @ts-ignore
dsn: Updates.manifest?.extra?.sentryDSN,
dsn: Constants.manifest?.extra?.sentryDSN,
enableInExpoDevelopment: false,
debug:
__DEV__ ||

View File

@ -1,7 +1,7 @@
import apiGeneral from '@api/general'
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit'
import { RootState } from '@root/store'
import * as Updates from 'expo-updates'
import { Constants } from 'react-native-unimodules'
export const retriveVersionLatest = createAsyncThunk(
'version/latest',
@ -29,10 +29,8 @@ const versionSlice = createSlice({
reducers: {},
extraReducers: builder => {
builder.addCase(retriveVersionLatest.fulfilled, (state, action) => {
// @ts-ignore
if (action.payload && Updates.manifest?.version) {
// @ts-ignore
if (parseInt(action.payload) > parseInt(Updates.manifest.version)) {
if (action.payload && Constants.manifest.version) {
if (parseInt(action.payload) > parseInt(Constants.manifest.version)) {
state.update = true
}
}