Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 39 additions & 36 deletions src/pages/settings/Security/TwoFactorAuth/IsEnabledPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import * as Expensicons from '../../../../components/Icon/Expensicons';
import themeColors from '../../../../styles/themes/default';
import styles from '../../../../styles/styles';
import ConfirmModal from '../../../../components/ConfirmModal';
import FullPageOfflineBlockingView from '../../../../components/BlockingViews/FullPageOfflineBlockingView';

const defaultProps = {};

Expand All @@ -23,43 +24,45 @@ function IsEnabledPage(props) {
title={props.translate('twoFactorAuth.headerTitle')}
onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_SECURITY)}
/>
<ScrollView>
<Section
title={props.translate('twoFactorAuth.twoFactorAuthEnabled')}
icon={Illustrations.ShieldYellow}
menuItems={[
{
title: props.translate('twoFactorAuth.disableTwoFactorAuth'),
onPress: () => {
setIsConfirmModalVisible(true);
<FullPageOfflineBlockingView>
<ScrollView>
<Section
title={props.translate('twoFactorAuth.twoFactorAuthEnabled')}
icon={Illustrations.ShieldYellow}
menuItems={[
{
title: props.translate('twoFactorAuth.disableTwoFactorAuth'),
onPress: () => {
setIsConfirmModalVisible(true);
},
icon: Expensicons.Close,
iconFill: themeColors.danger,
wrapperStyle: [styles.cardMenuItem],
},
icon: Expensicons.Close,
iconFill: themeColors.danger,
wrapperStyle: [styles.cardMenuItem],
},
]}
containerStyles={[styles.twoFactorAuthSection]}
>
<View style={styles.mv3}>
<Text style={styles.textLabel}>{props.translate('twoFactorAuth.whatIsTwoFactorAuth')}</Text>
</View>
</Section>
<ConfirmModal
title={props.translate('twoFactorAuth.disableTwoFactorAuth')}
onConfirm={() => {
setIsConfirmModalVisible(false);
Navigation.navigate(ROUTES.SETTINGS_2FA_DISABLE);
}}
onCancel={() => setIsConfirmModalVisible(false)}
onModalHide={() => setIsConfirmModalVisible(false)}
isVisible={isConfirmModalVisible}
prompt={props.translate('twoFactorAuth.disableTwoFactorAuthConfirmation')}
confirmText={props.translate('twoFactorAuth.disable')}
cancelText={props.translate('common.cancel')}
shouldShowCancelButton
danger
/>
</ScrollView>
]}
containerStyles={[styles.twoFactorAuthSection]}
>
<View style={styles.mv3}>
<Text style={styles.textLabel}>{props.translate('twoFactorAuth.whatIsTwoFactorAuth')}</Text>
</View>
</Section>
<ConfirmModal
title={props.translate('twoFactorAuth.disableTwoFactorAuth')}
onConfirm={() => {
setIsConfirmModalVisible(false);
Navigation.navigate(ROUTES.SETTINGS_2FA_DISABLE);
}}
onCancel={() => setIsConfirmModalVisible(false)}
onModalHide={() => setIsConfirmModalVisible(false)}
isVisible={isConfirmModalVisible}
prompt={props.translate('twoFactorAuth.disableTwoFactorAuthConfirmation')}
confirmText={props.translate('twoFactorAuth.disable')}
cancelText={props.translate('common.cancel')}
shouldShowCancelButton
danger
/>
</ScrollView>
</FullPageOfflineBlockingView>
</ScreenWrapper>
);
}
Expand Down