mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
Partially fixed #113
This commit is contained in:
@ -2,7 +2,12 @@ import { MenuContainer, MenuRow } from '@components/Menu'
|
||||
import { updateInstancePush } from '@utils/slices/instances/updatePush'
|
||||
import { updateInstancePushAlert } from '@utils/slices/instances/updatePushAlert'
|
||||
import { updateInstancePushDecode } from '@utils/slices/instances/updatePushDecode'
|
||||
import { clearPushLoading, getInstancePush } from '@utils/slices/instancesSlice'
|
||||
import {
|
||||
clearPushLoading,
|
||||
getInstanceAccount,
|
||||
getInstancePush,
|
||||
getInstanceUri
|
||||
} from '@utils/slices/instancesSlice'
|
||||
import * as WebBrowser from 'expo-web-browser'
|
||||
import * as Notifications from 'expo-notifications'
|
||||
import React, { useEffect, useMemo, useState } from 'react'
|
||||
@ -13,9 +18,18 @@ import layoutAnimation from '@utils/styles/layoutAnimation'
|
||||
import Button from '@components/Button'
|
||||
import { StyleConstants } from '@utils/styles/constants'
|
||||
import { AppState, Linking } from 'react-native'
|
||||
import { StackScreenProps } from '@react-navigation/stack'
|
||||
|
||||
const ScreenMeSettingsPush: React.FC = () => {
|
||||
const TabMePush: React.FC<StackScreenProps<
|
||||
Nav.TabMeStackParamList,
|
||||
'Tab-Me-Push'
|
||||
>> = () => {
|
||||
const { t } = useTranslation('screenTabs')
|
||||
const instanceAccount = useSelector(
|
||||
getInstanceAccount,
|
||||
(prev, next) => prev?.acct === next?.acct
|
||||
)
|
||||
const instanceUri = useSelector(getInstanceUri)
|
||||
|
||||
const dispatch = useDispatch()
|
||||
const instancePush = useSelector(getInstancePush)
|
||||
@ -106,7 +120,9 @@ const ScreenMeSettingsPush: React.FC = () => {
|
||||
) : null}
|
||||
<MenuContainer>
|
||||
<MenuRow
|
||||
title={t('me.push.global.heading')}
|
||||
title={t('me.push.global.heading', {
|
||||
acct: `@${instanceAccount?.acct}@${instanceUri}`
|
||||
})}
|
||||
description={t('me.push.global.description')}
|
||||
loading={instancePush?.global.loading}
|
||||
switchDisabled={!pushEnabled || isLoading}
|
||||
@ -144,4 +160,4 @@ const ScreenMeSettingsPush: React.FC = () => {
|
||||
)
|
||||
}
|
||||
|
||||
export default ScreenMeSettingsPush
|
||||
export default TabMePush
|
||||
|
Reference in New Issue
Block a user