Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion src/ROUTES.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export default {
SETTINGS: 'settings',
SETTINGS_PROFILE: 'settings/profile',
SETTINGS_PREFERENCES: 'settings/preferences',
SETTINGS_PASSWORD: 'settings/password',
SETTINGS_SECURITY: 'settings/security',
SETTINGS_PASSWORD: 'settings/security/password',
SETTINGS_ABOUT: 'settings/about',
SETTINGS_APP_DOWNLOAD_LINKS: 'settings/about/app-download-links',
SETTINGS_PAYMENTS: 'settings/payments',
Expand Down
2 changes: 1 addition & 1 deletion src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,9 @@ export default {
label: 'Desktop',
},
},
security: 'Security',
signOut: 'Sign out',
versionLetter: 'v',
changePassword: 'Change password',
readTheTermsAndPrivacyPolicy: {
phrase1: 'Read the',
phrase2: 'terms of service',
Expand Down
2 changes: 1 addition & 1 deletion src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,9 @@ export default {
label: 'Desktop',
},
},
security: 'Seguridad',
signOut: 'Desconectar',
versionLetter: 'v',
changePassword: 'Cambiar contraseña',
readTheTermsAndPrivacyPolicy: {
phrase1: 'Leer los',
phrase2: 'términos de servicio',
Expand Down
5 changes: 5 additions & 0 deletions src/libs/Navigation/AppNavigator/ModalStackNavigators.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import SettingsPreferencesPage from '../../../pages/settings/PreferencesPage';
import SettingsAboutPage from '../../../pages/settings/AboutPage';
import SettingsAppDownloadLinks from '../../../pages/settings/AppDownloadLinks';
import SettingsPasswordPage from '../../../pages/settings/PasswordPage';
import SettingsSecurityPage from '../../../pages/settings/Security/SecuritySettingsPage';
import SettingsPaymentsPage from '../../../pages/settings/Payments/PaymentsPage';
import SettingsAddPayPalMePage from '../../../pages/settings/Payments/AddPayPalMePage';
import SettingsAddDebitCardPage from '../../../pages/settings/Payments/AddDebitCardPage';
Expand Down Expand Up @@ -162,6 +163,10 @@ const SettingsModalStackNavigator = createModalStackNavigator([
Component: SettingsPasswordPage,
name: 'Settings_Password',
},
{
Component: SettingsSecurityPage,
name: 'Settings_Security',
},
{
Component: SettingsAboutPage,
name: 'Settings_About',
Expand Down
4 changes: 4 additions & 0 deletions src/libs/Navigation/linkingConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ export default {
path: ROUTES.SETTINGS_PASSWORD,
exact: true,
},
Settings_Security: {
path: ROUTES.SETTINGS_SECURITY,
exact: true,
},
Settings_Payments: {
path: ROUTES.SETTINGS_PAYMENTS,
exact: true,
Expand Down
4 changes: 2 additions & 2 deletions src/pages/settings/InitialSettingsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ const defaultMenuItems = [
action: () => { Navigation.navigate(ROUTES.SETTINGS_PREFERENCES); },
},
{
translationKey: 'initialSettingsPage.changePassword',
translationKey: 'initialSettingsPage.security',
icon: Expensicons.Lock,
action: () => { Navigation.navigate(ROUTES.SETTINGS_PASSWORD); },
action: () => { Navigation.navigate(ROUTES.SETTINGS_SECURITY); },
},
{
translationKey: 'common.payments',
Expand Down
2 changes: 1 addition & 1 deletion src/pages/settings/PasswordPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class PasswordPage extends Component {
<HeaderWithCloseButton
title={this.props.translate('passwordPage.changePassword')}
shouldShowBackButton
onBackButtonPress={() => Navigation.navigate(ROUTES.SETTINGS)}
onBackButtonPress={() => Navigation.navigate(ROUTES.SETTINGS_SECURITY)}
onCloseButtonPress={() => Navigation.dismissModal(true)}
/>
<ScrollView style={styles.flex1} contentContainerStyle={styles.p5}>
Expand Down
63 changes: 63 additions & 0 deletions src/pages/settings/Security/SecuritySettingsPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import _ from 'underscore';
import React from 'react';
import {View, ScrollView} from 'react-native';
import HeaderWithCloseButton from '../../../components/HeaderWithCloseButton';
import Navigation from '../../../libs/Navigation/Navigation';
import ROUTES from '../../../ROUTES';
import styles from '../../../styles/styles';
import * as Expensicons from '../../../components/Icon/Expensicons';
import ScreenWrapper from '../../../components/ScreenWrapper';
import withLocalize, {withLocalizePropTypes} from '../../../components/withLocalize';
import MenuItem from '../../../components/MenuItem';

const propTypes = {
...withLocalizePropTypes,
};

const SecuritySettingsPage = (props) => {
const menuItems = [

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will imminently be adding to this array. Close account will be added with this issue, and 2FA will be added with N7.

{
translationKey: 'passwordPage.changePassword',
icon: Expensicons.Lock,
action: () => {
Navigation.navigate(ROUTES.SETTINGS_PASSWORD);
},
},
];

return (
<ScreenWrapper>
<HeaderWithCloseButton
title={props.translate('initialSettingsPage.security')}
shouldShowBackButton
onBackButtonPress={() => Navigation.navigate(ROUTES.SETTINGS)}
onCloseButtonPress={() => Navigation.dismissModal(true)}
/>
<ScrollView
contentContainerStyle={[
styles.flexGrow1,
styles.flexColumn,
styles.justifyContentBetween,
]}
>
<View style={[styles.flex1]}>
{_.map(menuItems, item => (
<MenuItem
key={item.translationKey}
title={props.translate(item.translationKey)}
icon={item.icon}
iconRight={item.iconRight}
onPress={() => item.action()}
shouldShowRightIcon
/>
))}
</View>
</ScrollView>
</ScreenWrapper>
);
};

SecuritySettingsPage.propTypes = propTypes;
SecuritySettingsPage.displayName = 'SettingSecurityPage';

export default withLocalize(SecuritySettingsPage);