mobile: fix 2fa method selection ui

This commit is contained in:
Ammar Ahmed
2026-06-22 11:17:59 +05:00
parent 8daea6ac27
commit f29d9b9948
4 changed files with 51 additions and 43 deletions

View File

@@ -316,48 +316,56 @@ const TwoFactorVerification = ({
/>
</View>
{currentMethod.method === "sms" ||
currentMethod.method === "email" ? (
<Button
onPress={onSendCode}
type={"plain"}
disabled={parseInt(`${seconds}`) !== 0}
title={
sending
? ""
: `${
seconds
? strings.resend2faCode(`${seconds}`)
: strings.resendCode()
}`
}
loading={sending}
fontSize={AppFontSize.sm}
fontFamily="REGULAR"
<View
style={{
gap: Spacing.LEVEL_1,
marginTop: -Spacing.LEVEL_0
}}
>
{currentMethod.method === "sms" ||
currentMethod.method === "email" ? (
<Button
onPress={onSendCode}
type={"plain"}
disabled={parseInt(`${seconds}`) !== 0}
title={
sending
? ""
: `${
seconds
? strings.resend2faCode(`${seconds}`)
: strings.resendCode()
}`
}
loading={sending}
fontSize={AppFontSize.sm}
fontFamily="REGULAR"
style={{
paddingVertical: 0,
alignSelf: "flex-start",
paddingHorizontal: 0
}}
/>
) : null}
<TouchableOpacity
onPress={onRequestSecondaryMethod}
activeOpacity={0.8}
style={{
paddingVertical: 0,
alignSelf: "flex-start",
paddingHorizontal: 0
alignSelf: "flex-start"
}}
/>
) : null}
>
<Paragraph
fontFamily="SEMI_BOLD"
fontSize="SM"
color={colors.primary.accent}
>
{strings["2faCodeSecondaryMethodText"][
currentMethod.method as keyof (typeof strings)["2faCodeSecondaryMethodText"]
]()}
</Paragraph>
</TouchableOpacity>
</View>
</View>
<TouchableOpacity
onPress={onRequestSecondaryMethod}
activeOpacity={0.8}
style={{
alignSelf: "center",
paddingVertical: 0,
marginTop: Spacing.LEVEL_3
}}
>
<Paragraph fontSize="SM" color={colors.secondary.paragraph}>
{strings["2faCodeSecondaryMethodText"][
currentMethod.method as keyof (typeof strings)["2faCodeSecondaryMethodText"]
]()}
</Paragraph>
</TouchableOpacity>
</>
) : (
<View

View File

@@ -5989,8 +5989,8 @@ msgid "Report issue"
msgstr "Report issue"
#: src/strings.ts:128
msgid "Resend code in ({seconds})"
msgstr "Resend code in ({seconds})"
msgid "Resend code in {seconds}s"
msgstr "Resend code in {seconds}s"
#. placeholder {0}: seconds ? ` in ${seconds}` : ""
#: src/strings.ts:679

View File

@@ -5963,7 +5963,7 @@ msgid "Report issue"
msgstr ""
#: src/strings.ts:128
msgid "Resend code in ({seconds})"
msgid "Resend code in {seconds}s"
msgstr ""
#. placeholder {0}: seconds ? ` in ${seconds}` : ""

View File

@@ -125,7 +125,7 @@ export const strings = {
app: () => t`I don't have access to authenticator app`,
recoveryCode: () => t`I don't have recovery codes`
},
resend2faCode: (seconds: string) => t`Resend code in (${seconds})`,
resend2faCode: (seconds: string) => t`Resend code in ${seconds}s`,
sendCode: () => t`Send code`,
sendCodeSms: () => t`Send code via SMS`,
sendCodeEmail: () => t`Send code via email`,