forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Expensify#44635 from etCoderDysto/validateAccount
fix: No recovery codes in 2FA page
- Loading branch information
Showing
6 changed files
with
143 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import React from 'react'; | ||
import {View} from 'react-native'; | ||
import {useOnyx} from 'react-native-onyx'; | ||
import useLocalize from '@hooks/useLocalize'; | ||
import useTheme from '@hooks/useTheme'; | ||
import useThemeStyles from '@hooks/useThemeStyles'; | ||
import Navigation from '@libs/Navigation/Navigation'; | ||
import variables from '@styles/variables'; | ||
import * as Session from '@userActions/Session'; | ||
import ONYXKEYS from '@src/ONYXKEYS'; | ||
import ROUTES from '@src/ROUTES'; | ||
import Icon from './Icon'; | ||
import * as Expensicons from './Icon/Expensicons'; | ||
import Text from './Text'; | ||
import TextLink from './TextLink'; | ||
|
||
type ValidateAccountMessageProps = {backTo?: string | undefined}; | ||
function ValidateAccountMessage({backTo}: ValidateAccountMessageProps) { | ||
const theme = useTheme(); | ||
const styles = useThemeStyles(); | ||
const {translate} = useLocalize(); | ||
const [loginList] = useOnyx(ONYXKEYS.LOGIN_LIST); | ||
const loginNames = Object.keys(loginList ?? {}); | ||
|
||
return ( | ||
<View style={[styles.flexRow, styles.alignItemsCenter, styles.m4]}> | ||
<Icon | ||
src={Expensicons.Exclamation} | ||
fill={theme.danger} | ||
/> | ||
|
||
<Text style={[styles.mutedTextLabel, styles.ml4, styles.flex1]}> | ||
{translate('bankAccount.validateAccountError.phrase1')} | ||
<TextLink | ||
fontSize={variables.fontSizeLabel} | ||
onPress={() => Session.signOutAndRedirectToSignIn()} | ||
> | ||
{translate('bankAccount.validateAccountError.phrase2')} | ||
</TextLink> | ||
{translate('bankAccount.validateAccountError.phrase3')} | ||
<TextLink | ||
fontSize={variables.fontSizeLabel} | ||
onPress={() => { | ||
const login = loginList?.[loginNames?.[0]] ?? {}; | ||
Navigation.navigate(ROUTES.SETTINGS_CONTACT_METHOD_DETAILS.getRoute(login?.partnerUserID ?? loginNames?.[0], backTo)); | ||
}} | ||
> | ||
{translate('bankAccount.validateAccountError.phrase4')} | ||
</TextLink> | ||
. | ||
</Text> | ||
</View> | ||
); | ||
} | ||
|
||
export default ValidateAccountMessage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.