about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2024-11-01 00:30:42 +0000
committerGitHub <noreply@github.com>2024-11-01 00:30:42 +0000
commit1b69ecb57aaf17a79689d39607e06265856f0c28 (patch)
treef5d7ed56220d958022b0dd53055e8f7444747539 /src
parent3b68dfeb3bbc8a973b1b368989be965d41241f55 (diff)
downloadvoidsky-1b69ecb57aaf17a79689d39607e06265856f0c28.tar.zst
Tweak 2FA enabled state (#6043)
* tweak 2fa presentation

* tweak dialog text style
Diffstat (limited to 'src')
-rw-r--r--src/screens/Settings/PrivacyAndSecuritySettings.tsx21
-rw-r--r--src/screens/Settings/components/Email2FAToggle.tsx2
-rw-r--r--src/view/screens/Settings/DisableEmail2FADialog.tsx4
3 files changed, 20 insertions, 7 deletions
diff --git a/src/screens/Settings/PrivacyAndSecuritySettings.tsx b/src/screens/Settings/PrivacyAndSecuritySettings.tsx
index da462c90d..12e28e0d2 100644
--- a/src/screens/Settings/PrivacyAndSecuritySettings.tsx
+++ b/src/screens/Settings/PrivacyAndSecuritySettings.tsx
@@ -6,8 +6,9 @@ import {NativeStackScreenProps} from '@react-navigation/native-stack'
 
 import {CommonNavigatorParams} from '#/lib/routes/types'
 import {useAppPasswordsQuery} from '#/state/queries/app-passwords'
+import {useSession} from '#/state/session'
 import * as SettingsList from '#/screens/Settings/components/SettingsList'
-import {atoms as a} from '#/alf'
+import {atoms as a, useTheme} from '#/alf'
 import * as Admonition from '#/components/Admonition'
 import {EyeSlash_Stroke2_Corner0_Rounded as EyeSlashIcon} from '#/components/icons/EyeSlash'
 import {Key_Stroke2_Corner2_Rounded as KeyIcon} from '#/components/icons/Key'
@@ -23,16 +24,30 @@ type Props = NativeStackScreenProps<
 >
 export function PrivacyAndSecuritySettingsScreen({}: Props) {
   const {_} = useLingui()
+  const t = useTheme()
   const {data: appPasswords} = useAppPasswordsQuery()
+  const {currentAccount} = useSession()
+
   return (
     <Layout.Screen>
       <Layout.Header title={_(msg`Privacy and Security`)} />
       <Layout.Content>
         <SettingsList.Container>
           <SettingsList.Item>
-            <SettingsList.ItemIcon icon={VerifiedIcon} />
+            <SettingsList.ItemIcon
+              icon={VerifiedIcon}
+              color={
+                currentAccount?.emailAuthFactor
+                  ? t.palette.primary_500
+                  : undefined
+              }
+            />
             <SettingsList.ItemText>
-              <Trans>Two-factor authentication (2FA)</Trans>
+              {currentAccount?.emailAuthFactor ? (
+                <Trans>Email 2FA enabled</Trans>
+              ) : (
+                <Trans>Two-factor authentication (2FA)</Trans>
+              )}
             </SettingsList.ItemText>
             <Email2FAToggle />
           </SettingsList.Item>
diff --git a/src/screens/Settings/components/Email2FAToggle.tsx b/src/screens/Settings/components/Email2FAToggle.tsx
index d89e5f18e..85ae89dea 100644
--- a/src/screens/Settings/components/Email2FAToggle.tsx
+++ b/src/screens/Settings/components/Email2FAToggle.tsx
@@ -57,7 +57,7 @@ export function Email2FAToggle() {
       />
       <SettingsList.BadgeButton
         label={
-          currentAccount?.emailAuthFactor ? _(msg`Disable`) : _(msg`Enable`)
+          currentAccount?.emailAuthFactor ? _(msg`Change`) : _(msg`Enable`)
         }
         onPress={onToggle}
       />
diff --git a/src/view/screens/Settings/DisableEmail2FADialog.tsx b/src/view/screens/Settings/DisableEmail2FADialog.tsx
index e3d088517..1378759b0 100644
--- a/src/view/screens/Settings/DisableEmail2FADialog.tsx
+++ b/src/view/screens/Settings/DisableEmail2FADialog.tsx
@@ -88,9 +88,7 @@ export function DisableEmail2FADialog({
             style={[a.text_2xl, a.font_bold, t.atoms.text]}>
             <Trans>Disable Email 2FA</Trans>
           </Text>
-          <P
-            nativeID="dialog-description"
-            style={[a.text_sm, t.atoms.text, a.leading_snug]}>
+          <P nativeID="dialog-description">
             {stage === Stages.ConfirmCode ? (
               <Trans>
                 An email has been sent to{' '}