mirror of
https://github.com/tooot-app/app
synced 2025-03-10 08:30:19 +01:00
Moved push notification place
This commit is contained in:
parent
47e6ca5e59
commit
d9228da7d7
@ -185,6 +185,12 @@
|
|||||||
"empty": "None"
|
"empty": "None"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"push": {
|
||||||
|
"content": {
|
||||||
|
"enabled": "Enabled",
|
||||||
|
"disabled": "Disabled"
|
||||||
|
}
|
||||||
|
},
|
||||||
"update": {
|
"update": {
|
||||||
"title": "Update to latest version"
|
"title": "Update to latest version"
|
||||||
},
|
},
|
||||||
|
@ -185,6 +185,12 @@
|
|||||||
"empty": "无公告"
|
"empty": "无公告"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"push": {
|
||||||
|
"content": {
|
||||||
|
"enabled": "已启用",
|
||||||
|
"disabled": "未启用"
|
||||||
|
}
|
||||||
|
},
|
||||||
"update": {
|
"update": {
|
||||||
"title": "更新至最新版本"
|
"title": "更新至最新版本"
|
||||||
},
|
},
|
||||||
|
@ -20,9 +20,9 @@ import FastImage from 'react-native-fast-image'
|
|||||||
import { FlatList, ScrollView } from 'react-native-gesture-handler'
|
import { FlatList, ScrollView } from 'react-native-gesture-handler'
|
||||||
import { SafeAreaView } from 'react-native-safe-area-context'
|
import { SafeAreaView } from 'react-native-safe-area-context'
|
||||||
|
|
||||||
const ScreenAnnouncements: React.FC<RootStackScreenProps<
|
const ScreenAnnouncements: React.FC<
|
||||||
'Screen-Announcements'
|
RootStackScreenProps<'Screen-Announcements'>
|
||||||
>> = ({
|
> = ({
|
||||||
route: {
|
route: {
|
||||||
params: { showAll = false }
|
params: { showAll = false }
|
||||||
},
|
},
|
||||||
@ -250,6 +250,7 @@ const styles = StyleSheet.create({
|
|||||||
announcementContainer: {
|
announcementContainer: {
|
||||||
width: Dimensions.get('screen').width,
|
width: Dimensions.get('screen').width,
|
||||||
padding: StyleConstants.Spacing.Global.PagePadding,
|
padding: StyleConstants.Spacing.Global.PagePadding,
|
||||||
|
marginVertical: StyleConstants.Spacing.Global.PagePadding,
|
||||||
justifyContent: 'center'
|
justifyContent: 'center'
|
||||||
},
|
},
|
||||||
published: {
|
published: {
|
||||||
|
@ -3,6 +3,7 @@ import { useNavigation } from '@react-navigation/native'
|
|||||||
import { useAnnouncementQuery } from '@utils/queryHooks/announcement'
|
import { useAnnouncementQuery } from '@utils/queryHooks/announcement'
|
||||||
import { useListsQuery } from '@utils/queryHooks/lists'
|
import { useListsQuery } from '@utils/queryHooks/lists'
|
||||||
import { getMePage, updateContextMePage } from '@utils/slices/contextsSlice'
|
import { getMePage, updateContextMePage } from '@utils/slices/contextsSlice'
|
||||||
|
import { getInstancePush } from '@utils/slices/instancesSlice'
|
||||||
import React, { useEffect } from 'react'
|
import React, { useEffect } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { useDispatch, useSelector } from 'react-redux'
|
import { useDispatch, useSelector } from 'react-redux'
|
||||||
@ -53,6 +54,11 @@ const Collections: React.FC = () => {
|
|||||||
}
|
}
|
||||||
}, [announcementsQuery.isSuccess, announcementsQuery.data?.length])
|
}, [announcementsQuery.isSuccess, announcementsQuery.data?.length])
|
||||||
|
|
||||||
|
const instancePush = useSelector(
|
||||||
|
getInstancePush,
|
||||||
|
(prev, next) => prev?.global.value === next?.global.value
|
||||||
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<MenuContainer>
|
<MenuContainer>
|
||||||
<MenuRow
|
<MenuRow
|
||||||
@ -98,6 +104,17 @@ const Collections: React.FC = () => {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
|
<MenuRow
|
||||||
|
iconFront={instancePush ? 'Bell' : 'BellOff'}
|
||||||
|
iconBack='ChevronRight'
|
||||||
|
title={t('me.stacks.push.name')}
|
||||||
|
content={
|
||||||
|
instancePush
|
||||||
|
? t('me.root.push.content.enabled')
|
||||||
|
: t('me.root.push.content.disabled')
|
||||||
|
}
|
||||||
|
onPress={() => navigation.navigate('Tab-Me-Push')}
|
||||||
|
/>
|
||||||
</MenuContainer>
|
</MenuContainer>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -3,10 +3,7 @@ import Button from '@components/Button'
|
|||||||
import { RelationshipOutgoing } from '@components/Relationship'
|
import { RelationshipOutgoing } from '@components/Relationship'
|
||||||
import { useNavigation } from '@react-navigation/native'
|
import { useNavigation } from '@react-navigation/native'
|
||||||
import { useRelationshipQuery } from '@utils/queryHooks/relationship'
|
import { useRelationshipQuery } from '@utils/queryHooks/relationship'
|
||||||
import {
|
import { getInstanceAccount } from '@utils/slices/instancesSlice'
|
||||||
getInstanceAccount,
|
|
||||||
getInstancePush
|
|
||||||
} from '@utils/slices/instancesSlice'
|
|
||||||
import { StyleConstants } from '@utils/styles/constants'
|
import { StyleConstants } from '@utils/styles/constants'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
@ -56,7 +53,6 @@ const AccountInformationActions: React.FC<Props> = ({ account, myInfo }) => {
|
|||||||
content={t('shared.account.moved')}
|
content={t('shared.account.moved')}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
analytics('account_gotomoved_press')
|
analytics('account_gotomoved_press')
|
||||||
// @ts-ignore
|
|
||||||
navigation.push('Tab-Shared-Account', { account: accountMoved })
|
navigation.push('Tab-Shared-Account', { account: accountMoved })
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@ -64,21 +60,9 @@ const AccountInformationActions: React.FC<Props> = ({ account, myInfo }) => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const instancePush = useSelector(
|
|
||||||
getInstancePush,
|
|
||||||
(prev, next) => prev?.global.value === next?.global.value
|
|
||||||
)
|
|
||||||
|
|
||||||
if (myInfo) {
|
if (myInfo) {
|
||||||
return (
|
return (
|
||||||
<View style={styles.base}>
|
<View style={styles.base}>
|
||||||
<Button
|
|
||||||
round
|
|
||||||
type='icon'
|
|
||||||
content={instancePush?.global.value ? 'Bell' : 'BellOff'}
|
|
||||||
style={styles.actionLeft}
|
|
||||||
onPress={() => navigation.navigate('Tab-Me-Push')}
|
|
||||||
/>
|
|
||||||
<Button
|
<Button
|
||||||
type='text'
|
type='text'
|
||||||
disabled={account === undefined}
|
disabled={account === undefined}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user