Deactivate dialog
(cherry picked from commit 33940e2dfe0d710c0665a7f68b198b46f54db4a2)
This commit is contained in:
@@ -63,6 +63,7 @@ import {ScrollView} from 'view/com/util/Views'
|
||||
import {useTheme} from '#/alf'
|
||||
import {useDialogControl} from '#/components/Dialog'
|
||||
import {BirthDateSettingsDialog} from '#/components/dialogs/BirthDateSettings'
|
||||
import * as Prompt from '#/components/Prompt'
|
||||
import {navigate, resetToTab} from '#/Navigation'
|
||||
import {Email2FAToggle} from './Email2FAToggle'
|
||||
import {ExportCarDialog} from './ExportCarDialog'
|
||||
@@ -306,6 +307,11 @@ export function SettingsScreen({}: Props) {
|
||||
Toast.show(_(msg`Legacy storage cleared, you need to restart the app now.`))
|
||||
}, [_])
|
||||
|
||||
const deactivateAccountControl = Prompt.usePromptControl()
|
||||
const onPressDeactivateAccount = React.useCallback(() => {
|
||||
deactivateAccountControl.open()
|
||||
}, [deactivateAccountControl])
|
||||
|
||||
const {mutate: onPressDeleteChatDeclaration} = useDeleteActorDeclaration()
|
||||
|
||||
return (
|
||||
@@ -790,6 +796,38 @@ export function SettingsScreen({}: Props) {
|
||||
<Trans>Export My Data</Trans>
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
|
||||
<TouchableOpacity
|
||||
style={[pal.view, styles.linkCard]}
|
||||
onPress={onPressDeactivateAccount}
|
||||
accessible={true}
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel={_(msg`Deactivate account`)}
|
||||
accessibilityHint={_(
|
||||
msg`Opens modal for account deactivation confirmation`,
|
||||
)}>
|
||||
<View style={[styles.iconContainer, dangerBg]}>
|
||||
<FontAwesomeIcon
|
||||
icon={'x'}
|
||||
style={dangerText as FontAwesomeIconStyle}
|
||||
size={18}
|
||||
/>
|
||||
</View>
|
||||
<Text type="lg" style={dangerText}>
|
||||
<Trans>Deactivate my account</Trans>
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
<Prompt.Basic
|
||||
control={deactivateAccountControl}
|
||||
title={_(msg`Deactivate account`)}
|
||||
description={_(
|
||||
msg`Are you sure you want to deactivate your account? You won't be able to interact on the network using this account, and users won't be able to see your profile or posts.`,
|
||||
)}
|
||||
confirmButtonCta={_(msg`Yes, deactivate my account`)}
|
||||
confirmButtonColor="negative"
|
||||
onConfirm={() => {}}
|
||||
/>
|
||||
|
||||
<TouchableOpacity
|
||||
style={[pal.view, styles.linkCard]}
|
||||
onPress={onPressDeleteAccount}
|
||||
|
||||
Reference in New Issue
Block a user