From 118a6d4be0de3e349b8a1b5c16c7a4a332128926 Mon Sep 17 00:00:00 2001 From: Amarparab2024 <156438377+Amarparab2024@users.noreply.github.com> Date: Sun, 25 Feb 2024 00:41:27 +0530 Subject: [PATCH 01/31] Update ROUTES.ts --- src/ROUTES.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ROUTES.ts b/src/ROUTES.ts index a8786bda3ffb..e25927cf44f1 100644 --- a/src/ROUTES.ts +++ b/src/ROUTES.ts @@ -81,6 +81,7 @@ const ROUTES = { SETTINGS_SECURITY: 'settings/security', SETTINGS_CLOSE: 'settings/security/closeAccount', SETTINGS_ABOUT: 'settings/about', + SETTINGS_SAVE_THE_WORLD: 'settings/teachersunite', SETTINGS_APP_DOWNLOAD_LINKS: 'settings/about/app-download-links', SETTINGS_WALLET: 'settings/wallet', SETTINGS_WALLET_DOMAINCARD: { From 804fe4abf3d333b53cababb780f6e7c01c6d7d44 Mon Sep 17 00:00:00 2001 From: Amarparab2024 <156438377+Amarparab2024@users.noreply.github.com> Date: Sun, 25 Feb 2024 00:41:50 +0530 Subject: [PATCH 02/31] Update SCREENS.ts --- src/SCREENS.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/SCREENS.ts b/src/SCREENS.ts index 520895c89c98..a61710e3af9e 100644 --- a/src/SCREENS.ts +++ b/src/SCREENS.ts @@ -37,6 +37,7 @@ const SCREENS = { TROUBLESHOOT: 'Settings_Troubleshoot', CONSOLE: 'Settings_Console', SHARE_LOG: 'Share_Log', + SAVE_THE_WORLD: 'Settings_SaveTheWorld', PROFILE: { ROOT: 'Settings_Profile', From 9d3bec7c7c45a0dbbcecb763d3f63ba94cec084e Mon Sep 17 00:00:00 2001 From: Amarparab2024 <156438377+Amarparab2024@users.noreply.github.com> Date: Sun, 25 Feb 2024 00:42:57 +0530 Subject: [PATCH 03/31] Update ModalStackNavigators.tsx --- src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx b/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx index 2be262aa5f0f..f136d3c32230 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx @@ -193,6 +193,7 @@ const AccountSettingsModalStackNavigator = createModalStackNavigator( [SCREENS.SETTINGS.PROFILE.ROOT]: () => require('../../../pages/settings/Profile/ProfilePage').default as React.ComponentType, [SCREENS.SETTINGS.WALLET.ROOT]: () => require('../../../pages/settings/Wallet/WalletPage').default as React.ComponentType, [SCREENS.SETTINGS.ABOUT]: () => require('../../../pages/settings/AboutPage/AboutPage').default as React.ComponentType, + [SCREENS.SETTINGS.SAVE_THE_WORLD]: () => require('../../../pages/TeachersUnite/SaveTheWorldPage').default as React.ComponentType, }, (styles) => ({cardStyle: styles.navigationScreenCardStyle, headerShown: false}), ); From e4d9f7b6a000bb6feaa93f529834e1d36d046220 Mon Sep 17 00:00:00 2001 From: Amarparab2024 <156438377+Amarparab2024@users.noreply.github.com> Date: Sun, 25 Feb 2024 00:43:42 +0530 Subject: [PATCH 04/31] Update config.ts --- src/libs/Navigation/linkingConfig/config.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libs/Navigation/linkingConfig/config.ts b/src/libs/Navigation/linkingConfig/config.ts index 48d649cc4dd9..9f5d6c0c6ec2 100644 --- a/src/libs/Navigation/linkingConfig/config.ts +++ b/src/libs/Navigation/linkingConfig/config.ts @@ -538,6 +538,10 @@ const config: LinkingOptions['config'] = { path: ROUTES.SETTINGS_ABOUT, exact: true, }, + [SCREENS.SETTINGS.SAVE_THE_WORLD]: { + path: ROUTES.SETTINGS_SAVE_THE_WORLD, + exact: true, + }, }, }, }, From cac93d714d67ee6e40a22f3ca89350dd347986f0 Mon Sep 17 00:00:00 2001 From: Amarparab2024 <156438377+Amarparab2024@users.noreply.github.com> Date: Sun, 25 Feb 2024 00:44:35 +0530 Subject: [PATCH 05/31] Update ImTeacherUpdateEmailPage.tsx --- src/pages/TeachersUnite/ImTeacherUpdateEmailPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/TeachersUnite/ImTeacherUpdateEmailPage.tsx b/src/pages/TeachersUnite/ImTeacherUpdateEmailPage.tsx index 9433aba2f299..818910b6d118 100644 --- a/src/pages/TeachersUnite/ImTeacherUpdateEmailPage.tsx +++ b/src/pages/TeachersUnite/ImTeacherUpdateEmailPage.tsx @@ -20,7 +20,7 @@ function ImTeacherUpdateEmailPage() { Navigation.goBack(ROUTES.TEACHERS_UNITE)} + onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_SAVE_THE_WORLD)} /> Date: Sun, 25 Feb 2024 00:45:03 +0530 Subject: [PATCH 06/31] Update IntroSchoolPrincipalPage.tsx --- src/pages/TeachersUnite/IntroSchoolPrincipalPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/TeachersUnite/IntroSchoolPrincipalPage.tsx b/src/pages/TeachersUnite/IntroSchoolPrincipalPage.tsx index c432b672f574..3cb91a57008e 100644 --- a/src/pages/TeachersUnite/IntroSchoolPrincipalPage.tsx +++ b/src/pages/TeachersUnite/IntroSchoolPrincipalPage.tsx @@ -81,7 +81,7 @@ function IntroSchoolPrincipalPage(props: IntroSchoolPrincipalPageProps) { > Navigation.goBack(ROUTES.TEACHERS_UNITE)} + onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_SAVE_THE_WORLD)} /> Date: Sun, 25 Feb 2024 00:45:21 +0530 Subject: [PATCH 07/31] Update KnowATeacherPage.tsx --- src/pages/TeachersUnite/KnowATeacherPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/TeachersUnite/KnowATeacherPage.tsx b/src/pages/TeachersUnite/KnowATeacherPage.tsx index 75b974ba1e83..205df762a475 100644 --- a/src/pages/TeachersUnite/KnowATeacherPage.tsx +++ b/src/pages/TeachersUnite/KnowATeacherPage.tsx @@ -87,7 +87,7 @@ function KnowATeacherPage(props: KnowATeacherPageProps) { > Navigation.goBack(ROUTES.TEACHERS_UNITE)} + onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_SAVE_THE_WORLD)} /> Date: Sun, 25 Feb 2024 00:45:40 +0530 Subject: [PATCH 08/31] Update SaveTheWorldPage.tsx --- src/pages/TeachersUnite/SaveTheWorldPage.tsx | 95 ++++++++++++++------ 1 file changed, 66 insertions(+), 29 deletions(-) diff --git a/src/pages/TeachersUnite/SaveTheWorldPage.tsx b/src/pages/TeachersUnite/SaveTheWorldPage.tsx index 5a6ce4e8f3e9..05157443ce9f 100644 --- a/src/pages/TeachersUnite/SaveTheWorldPage.tsx +++ b/src/pages/TeachersUnite/SaveTheWorldPage.tsx @@ -1,49 +1,86 @@ -import React from 'react'; -import {View} from 'react-native'; -import IllustratedHeaderPageLayout from '@components/IllustratedHeaderPageLayout'; +import React, {useMemo} from 'react'; +import {ScrollView, View} from 'react-native'; +import HeaderWithBackButton from '@components/HeaderWithBackButton'; +import * as Illustrations from '@components/Icon/Illustrations'; import LottieAnimations from '@components/LottieAnimations'; -import MenuItem from '@components/MenuItem'; -import Text from '@components/Text'; +import MenuItemList from '@components/MenuItemList'; +import ScreenWrapper from '@components/ScreenWrapper'; +import Section from '@components/Section'; import useLocalize from '@hooks/useLocalize'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; +import useWaitForNavigation from '@hooks/useWaitForNavigation'; +import useWindowDimensions from '@hooks/useWindowDimensions'; import Navigation from '@libs/Navigation/Navigation'; +import type {TranslationPaths} from '@src/languages/types'; import ROUTES from '@src/ROUTES'; import SCREENS from '@src/SCREENS'; function SaveTheWorldPage() { - const theme = useTheme(); const styles = useThemeStyles(); const {translate} = useLocalize(); + const waitForNavigate = useWaitForNavigation(); + const {isSmallScreenWidth} = useWindowDimensions(); + const theme = useTheme(); + + const menuItems = useMemo(() => { + const baseMenuItems = [ + { + translationKey: 'teachersUnitePage.iKnowATeacher', + action: waitForNavigate(() => Navigation.navigate(ROUTES.I_KNOW_A_TEACHER)), + }, + { + translationKey: 'teachersUnitePage.iAmATeacher', + action: waitForNavigate(() => Navigation.navigate(ROUTES.I_AM_A_TEACHER)), + }, + ]; + + return baseMenuItems.map((item) => ({ + key: item.translationKey, + title: translate(item.translationKey as TranslationPaths), + onPress: item.action, + shouldShowRightIcon: true, + link: '', + wrapperStyle: [styles.sectionMenuItemTopDescription], + })); + }, [translate, waitForNavigate, styles]); return ( - - - {translate('teachersUnitePage.teachersUnite')} - {translate('teachersUnitePage.joinExpensifyOrg')} - - - Navigation.navigate(ROUTES.I_KNOW_A_TEACHER)} - /> - - Navigation.navigate(ROUTES.I_AM_A_TEACHER)} + Navigation.goBack()} + icon={Illustrations.LockClosed} /> - + + +
+ +
+
+
+
); } -SaveTheWorldPage.displayName = 'SaveTheWorldPage'; +SaveTheWorldPage.displayName = 'SettingSecurityPage'; + export default SaveTheWorldPage; From a2cd758f65d1dadb427ee33c21d52d1d603cdb17 Mon Sep 17 00:00:00 2001 From: Amarparab2024 <156438377+Amarparab2024@users.noreply.github.com> Date: Sun, 25 Feb 2024 00:46:57 +0530 Subject: [PATCH 09/31] Update InitialSettingsPage.js --- src/pages/settings/InitialSettingsPage.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/pages/settings/InitialSettingsPage.js b/src/pages/settings/InitialSettingsPage.js index f19df710b41a..1cc6b7314df2 100755 --- a/src/pages/settings/InitialSettingsPage.js +++ b/src/pages/settings/InitialSettingsPage.js @@ -28,6 +28,7 @@ import useThemeStyles from '@hooks/useThemeStyles'; import useWaitForNavigation from '@hooks/useWaitForNavigation'; import compose from '@libs/compose'; import * as CurrencyUtils from '@libs/CurrencyUtils'; +import interceptAnonymousUser from '@libs/interceptAnonymousUser'; import {translatableTextPropTypes} from '@libs/Localize'; import getTopmostSettingsCentralPaneName from '@libs/Navigation/getTopmostSettingsCentralPaneName'; import Navigation from '@libs/Navigation/Navigation'; @@ -228,9 +229,21 @@ function InitialSettingsPage(props) { icon: Expensicons.Info, routeName: ROUTES.SETTINGS_ABOUT, }, + { + translationKey: 'sidebarScreen.saveTheWorld', + icon: Expensicons.Heart, + routeName: ROUTES.SETTINGS_SAVE_THE_WORLD, + action: () => { + interceptAnonymousUser( + waitForNavigate(() => { + Navigation.navigate(ROUTES.SETTINGS_SAVE_THE_WORLD); + }), + ); + }, + }, ], }), - [styles.pt4], + [styles.pt4, waitForNavigate], ); /** From 89371d4358f2a46e8e43cfcb0f55e6d98dc8c44e Mon Sep 17 00:00:00 2001 From: Amarparab2024 <156438377+Amarparab2024@users.noreply.github.com> Date: Sun, 25 Feb 2024 00:47:46 +0530 Subject: [PATCH 10/31] Update FloatingActionButtonAndPopover.js --- .../sidebar/SidebarScreen/FloatingActionButtonAndPopover.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js index 573cbe370aa7..54f58130f03b 100644 --- a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js +++ b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js @@ -186,11 +186,6 @@ function FloatingActionButtonAndPopover(props) { onSelected: () => interceptAnonymousUser(() => Task.clearOutTaskInfoAndNavigate()), }, ], - { - icon: Expensicons.Heart, - text: translate('sidebarScreen.saveTheWorld'), - onSelected: () => interceptAnonymousUser(() => Navigation.navigate(ROUTES.TEACHERS_UNITE)), - }, ...(!props.isLoading && !Policy.hasActiveFreePolicy(props.allPolicies) ? [ { From b4ab920f6bf51eb248fa18abc2a899cab3707587 Mon Sep 17 00:00:00 2001 From: Amarparab2024 <156438377+Amarparab2024@users.noreply.github.com> Date: Wed, 28 Feb 2024 01:29:11 +0530 Subject: [PATCH 11/31] Update Illustrations.ts --- src/components/Icon/Illustrations.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/Icon/Illustrations.ts b/src/components/Icon/Illustrations.ts index e03b393dc81f..ac9e56904100 100644 --- a/src/components/Icon/Illustrations.ts +++ b/src/components/Icon/Illustrations.ts @@ -70,6 +70,7 @@ import TrashCan from '@assets/images/simple-illustrations/simple-illustration__t import TreasureChest from '@assets/images/simple-illustrations/simple-illustration__treasurechest.svg'; import WalletAlt from '@assets/images/simple-illustrations/simple-illustration__wallet-alt.svg'; import Workflows from '@assets/images/simple-illustrations/simple-illustration__workflows.svg'; +import TeachersUnite from '@assets/images/simple-illustrations/simple-illustration__teachers-unite.svg'; export { Abracadabra, @@ -144,4 +145,5 @@ export { WalletAlt, Workflows, House, + TeachersUnite, }; From 8dac1885fdbee7ed0dca48f40ea15b7d505bc3dc Mon Sep 17 00:00:00 2001 From: Amarparab2024 <156438377+Amarparab2024@users.noreply.github.com> Date: Wed, 28 Feb 2024 01:29:38 +0530 Subject: [PATCH 12/31] Update SaveTheWorldPage.tsx --- src/pages/TeachersUnite/SaveTheWorldPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/TeachersUnite/SaveTheWorldPage.tsx b/src/pages/TeachersUnite/SaveTheWorldPage.tsx index 05157443ce9f..4b7225f95f88 100644 --- a/src/pages/TeachersUnite/SaveTheWorldPage.tsx +++ b/src/pages/TeachersUnite/SaveTheWorldPage.tsx @@ -56,7 +56,7 @@ function SaveTheWorldPage() { title={translate('sidebarScreen.saveTheWorld')} shouldShowBackButton={isSmallScreenWidth} onBackButtonPress={() => Navigation.goBack()} - icon={Illustrations.LockClosed} + icon={Illustrations.TeachersUnite} /> From 8d80ca02c0b702fbbed4445dd7efbcdd95ae36e8 Mon Sep 17 00:00:00 2001 From: Amarparab2024 <156438377+Amarparab2024@users.noreply.github.com> Date: Wed, 28 Feb 2024 01:30:36 +0530 Subject: [PATCH 13/31] Create simple-illustration__teachers-unite.svg --- .../simple-illustration__teachers-unite.svg | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 assets/images/simple-illustrations/simple-illustration__teachers-unite.svg diff --git a/assets/images/simple-illustrations/simple-illustration__teachers-unite.svg b/assets/images/simple-illustrations/simple-illustration__teachers-unite.svg new file mode 100644 index 000000000000..b4edd9513722 --- /dev/null +++ b/assets/images/simple-illustrations/simple-illustration__teachers-unite.svg @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From c28bb4d3dd71ea8560ce77e086f85c1855a9b115 Mon Sep 17 00:00:00 2001 From: Amarparab2024 <156438377+Amarparab2024@users.noreply.github.com> Date: Wed, 28 Feb 2024 01:39:35 +0530 Subject: [PATCH 14/31] merge changes --- ...ettingsPage.js => InitialSettingsPage.tsx} | 227 +++++++++--------- 1 file changed, 109 insertions(+), 118 deletions(-) rename src/pages/settings/{InitialSettingsPage.js => InitialSettingsPage.tsx} (69%) diff --git a/src/pages/settings/InitialSettingsPage.js b/src/pages/settings/InitialSettingsPage.tsx similarity index 69% rename from src/pages/settings/InitialSettingsPage.js rename to src/pages/settings/InitialSettingsPage.tsx index 1cc6b7314df2..78543bf72a99 100755 --- a/src/pages/settings/InitialSettingsPage.js +++ b/src/pages/settings/InitialSettingsPage.tsx @@ -1,13 +1,11 @@ import {useNavigationState} from '@react-navigation/native'; -import lodashGet from 'lodash/get'; -import PropTypes from 'prop-types'; import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react'; +import type {GestureResponderEvent, StyleProp, ViewStyle} from 'react-native'; import {NativeModules, View} from 'react-native'; +import type {OnyxEntry} from 'react-native-onyx'; import {withOnyx} from 'react-native-onyx'; -import _ from 'underscore'; +import type {ValueOf} from 'type-fest'; import AvatarWithImagePicker from '@components/AvatarWithImagePicker'; -import bankAccountPropTypes from '@components/bankAccountPropTypes'; -import cardPropTypes from '@components/cardPropTypes'; import ConfirmModal from '@components/ConfirmModal'; import CurrentUserPersonalDetailsSkeletonView from '@components/CurrentUserPersonalDetailsSkeletonView'; import HeaderPageLayout from '@components/HeaderPageLayout'; @@ -15,25 +13,22 @@ import Icon from '@components/Icon'; import * as Expensicons from '@components/Icon/Expensicons'; import MenuItem from '@components/MenuItem'; import OfflineWithFeedback from '@components/OfflineWithFeedback'; -import {withNetwork} from '@components/OnyxProvider'; import {PressableWithFeedback} from '@components/Pressable'; import Text from '@components/Text'; import Tooltip from '@components/Tooltip'; -import withCurrentUserPersonalDetails, {withCurrentUserPersonalDetailsDefaultProps, withCurrentUserPersonalDetailsPropTypes} from '@components/withCurrentUserPersonalDetails'; -import withLocalize, {withLocalizePropTypes} from '@components/withLocalize'; +import type {WithCurrentUserPersonalDetailsProps} from '@components/withCurrentUserPersonalDetails'; +import withCurrentUserPersonalDetails from '@components/withCurrentUserPersonalDetails'; import useLocalize from '@hooks/useLocalize'; +import useNetwork from '@hooks/useNetwork'; import useSingleExecution from '@hooks/useSingleExecution'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import useWaitForNavigation from '@hooks/useWaitForNavigation'; -import compose from '@libs/compose'; import * as CurrencyUtils from '@libs/CurrencyUtils'; import interceptAnonymousUser from '@libs/interceptAnonymousUser'; -import {translatableTextPropTypes} from '@libs/Localize'; import getTopmostSettingsCentralPaneName from '@libs/Navigation/getTopmostSettingsCentralPaneName'; import Navigation from '@libs/Navigation/Navigation'; import * as UserUtils from '@libs/UserUtils'; -import walletTermsPropTypes from '@pages/EnablePayments/walletTermsPropTypes'; import * as ReportActionContextMenu from '@pages/home/report/ContextMenu/ReportActionContextMenu'; import variables from '@styles/variables'; import * as Link from '@userActions/Link'; @@ -42,70 +37,68 @@ import * as PersonalDetails from '@userActions/PersonalDetails'; import * as Session from '@userActions/Session'; import * as Wallet from '@userActions/Wallet'; import CONST from '@src/CONST'; +import type {TranslationPaths} from '@src/languages/types'; import ONYXKEYS from '@src/ONYXKEYS'; +import type {Route} from '@src/ROUTES'; import ROUTES from '@src/ROUTES'; import SCREENS from '@src/SCREENS'; +import type * as OnyxTypes from '@src/types/onyx'; +import type {Icon as TIcon} from '@src/types/onyx/OnyxCommon'; +import {isEmptyObject} from '@src/types/utils/EmptyObject'; +import type IconAsset from '@src/types/utils/IconAsset'; -const propTypes = { - /* Onyx Props */ - - /** The session of the logged in person */ - session: PropTypes.shape({ - /** Email of the logged in person */ - email: PropTypes.string, - }), +type InitialSettingsPageOnyxProps = { + /** The user's session */ + session: OnyxEntry; /** The user's wallet account */ - userWallet: PropTypes.shape({ - /** The user's current wallet balance */ - currentBalance: PropTypes.number, - }), + userWallet: OnyxEntry; /** List of bank accounts */ - bankAccountList: PropTypes.objectOf(bankAccountPropTypes), + bankAccountList: OnyxEntry; /** List of user's cards */ - fundList: PropTypes.objectOf(cardPropTypes), + fundList: OnyxEntry; /** Information about the user accepting the terms for payments */ - walletTerms: walletTermsPropTypes, + walletTerms: OnyxEntry; /** Login list for the user that is signed in */ - loginList: PropTypes.objectOf( - PropTypes.shape({ - /** Date login was validated, used to show brickroad info status */ - validatedDate: PropTypes.string, - - /** Field-specific server side errors keyed by microtime */ - errorFields: PropTypes.objectOf(PropTypes.objectOf(translatableTextPropTypes)), - }), - ), - - ...withLocalizePropTypes, - ...withCurrentUserPersonalDetailsPropTypes, + loginList: OnyxEntry; }; -const defaultProps = { - session: {}, - userWallet: { - currentBalance: 0, - }, - walletTerms: {}, - bankAccountList: {}, - fundList: null, - loginList: {}, - ...withCurrentUserPersonalDetailsDefaultProps, +type InitialSettingsPageProps = InitialSettingsPageOnyxProps & WithCurrentUserPersonalDetailsProps; + +type MenuData = { + translationKey: TranslationPaths; + icon: IconAsset; + routeName?: Route; + brickRoadIndicator?: ValueOf; + action?: () => void; + link?: string | (() => Promise); + iconType?: typeof CONST.ICON_TYPE_ICON | typeof CONST.ICON_TYPE_AVATAR | typeof CONST.ICON_TYPE_WORKSPACE; + iconStyles?: StyleProp; + fallbackIcon?: IconAsset; + shouldStackHorizontally?: boolean; + avatarSize?: (typeof CONST.AVATAR_SIZE)[keyof typeof CONST.AVATAR_SIZE]; + floatRightAvatars?: TIcon[]; + title?: string; + shouldShowRightIcon?: boolean; + iconRight?: IconAsset; }; -function InitialSettingsPage(props) { +type Menu = {sectionStyle: StyleProp; sectionTranslationKey: TranslationPaths; items: MenuData[]}; + +function InitialSettingsPage({session, userWallet, bankAccountList, fundList, walletTerms, loginList, currentUserPersonalDetails}: InitialSettingsPageProps) { + const network = useNetwork(); const theme = useTheme(); const styles = useThemeStyles(); const {isExecuting, singleExecution} = useSingleExecution(); const waitForNavigate = useWaitForNavigation(); const popoverAnchor = useRef(null); - const {translate} = useLocalize(); + const {translate, formatPhoneNumber} = useLocalize(); const activeRoute = useNavigationState(getTopmostSettingsCentralPaneName); - const emojiCode = lodashGet(props, 'currentUserPersonalDetails.status.emojiCode', ''); + const emojiCode = currentUserPersonalDetails?.status?.emojiCode ?? ''; const [shouldShowSignoutConfirmModal, setShouldShowSignoutConfirmModal] = useState(false); @@ -113,13 +106,13 @@ function InitialSettingsPage(props) { Wallet.openInitialSettingsPage(); }, []); - const toggleSignoutConfirmModal = (value) => { + const toggleSignoutConfirmModal = (value: boolean) => { setShouldShowSignoutConfirmModal(value); }; const signOut = useCallback( (shouldForceSignout = false) => { - if (!props.network.isOffline || shouldForceSignout) { + if (!network.isOffline || shouldForceSignout) { Session.signOutAndRedirectToSignIn(); return; } @@ -127,18 +120,18 @@ function InitialSettingsPage(props) { // When offline, warn the user that any actions they took while offline will be lost if they sign out toggleSignoutConfirmModal(true); }, - [props.network.isOffline], + [network.isOffline], ); /** * Retuns a list of menu items data for account section - * @returns {Object} object with translationKey, style and items for the account section + * @returns object with translationKey, style and items for the account section */ - const accountMenuItemsData = useMemo(() => { - const profileBrickRoadIndicator = UserUtils.getLoginListBrickRoadIndicator(props.loginList); - const paymentCardList = props.fundList || {}; + const accountMenuItemsData: Menu = useMemo(() => { + const profileBrickRoadIndicator = UserUtils.getLoginListBrickRoadIndicator(loginList); + const paymentCardList = fundList; - const defaultMenu = { + const defaultMenu: Menu = { sectionStyle: styles.accountSettingsSectionContainer, sectionTranslationKey: 'initialSettingsPage.account', items: [ @@ -158,9 +151,9 @@ function InitialSettingsPage(props) { icon: Expensicons.Wallet, routeName: ROUTES.SETTINGS_WALLET, brickRoadIndicator: - PaymentMethods.hasPaymentMethodError(props.bankAccountList, paymentCardList) || !_.isEmpty(props.userWallet.errors) || !_.isEmpty(props.walletTerms.errors) + PaymentMethods.hasPaymentMethodError(bankAccountList, paymentCardList) || !isEmptyObject(userWallet?.errors) || !isEmptyObject(walletTerms?.errors) ? 'error' - : null, + : undefined, }, { translationKey: 'common.preferences', @@ -183,39 +176,38 @@ function InitialSettingsPage(props) { }; if (NativeModules.HybridAppModule) { - const hybridAppMenuItems = _.filter( - [ - { - translationKey: 'initialSettingsPage.returnToClassic', - icon: Expensicons.RotateLeft, - shouldShowRightIcon: true, - iconRight: Expensicons.NewWindow, - action: () => NativeModules.HybridAppModule.closeReactNativeApp(), + const hybridAppMenuItems: MenuData[] = [ + { + translationKey: 'initialSettingsPage.returnToClassic' as const, + icon: Expensicons.RotateLeft, + shouldShowRightIcon: true, + iconRight: Expensicons.NewWindow, + action: () => { + NativeModules.HybridAppModule.closeReactNativeApp(); }, - ...defaultMenu.items, - ], - (item) => item.translationKey !== 'initialSettingsPage.signOut' && item.translationKey !== 'initialSettingsPage.goToExpensifyClassic', - ); + }, + ...defaultMenu.items, + ].filter((item) => item.translationKey !== 'initialSettingsPage.signOut' && item.translationKey !== 'exitSurvey.goToExpensifyClassic'); return {sectionStyle: styles.accountSettingsSectionContainer, sectionTranslationKey: 'initialSettingsPage.account', items: hybridAppMenuItems}; } return defaultMenu; - }, [props.bankAccountList, props.fundList, props.loginList, props.userWallet.errors, props.walletTerms.errors, signOut, styles.accountSettingsSectionContainer]); + }, [loginList, fundList, styles.accountSettingsSectionContainer, bankAccountList, userWallet?.errors, walletTerms?.errors, signOut]); /** * Retuns a list of menu items data for general section - * @returns {Object} object with translationKey, style and items for the general section + * @returns object with translationKey, style and items for the general section */ - const generalMenuItemsData = useMemo( + const generalMenuItemsData: Menu = useMemo( () => ({ sectionStyle: { ...styles.pt4, }, - sectionTranslationKey: 'initialSettingsPage.general', + sectionTranslationKey: 'initialSettingsPage.general' as const, items: [ { - translationKey: 'initialSettingsPage.help', + translationKey: 'initialSettingsPage.help' as const, icon: Expensicons.QuestionMark, action: () => { Link.openExternalLink(CONST.NEWHELP_URL); @@ -225,7 +217,7 @@ function InitialSettingsPage(props) { link: CONST.NEWHELP_URL, }, { - translationKey: 'initialSettingsPage.about', + translationKey: 'initialSettingsPage.about' as const, icon: Expensicons.Info, routeName: ROUTES.SETTINGS_ABOUT, }, @@ -248,20 +240,20 @@ function InitialSettingsPage(props) { /** * Retuns JSX.Element with menu items - * @param {Object} menuItemsData list with menu items data - * @returns {JSX.Element} the menu items for passed data + * @param menuItemsData list with menu items data + * @returns the menu items for passed data */ const getMenuItemsSection = useCallback( - (menuItemsData) => { + (menuItemsData: Menu) => { /** - * @param {Boolean} isPaymentItem whether the item being rendered is the payments menu item - * @returns {String|undefined} the user's wallet balance + * @param isPaymentItem whether the item being rendered is the payments menu item + * @returns the user's wallet balance */ - const getWalletBalance = (isPaymentItem) => (isPaymentItem ? CurrencyUtils.convertToDisplayString(props.userWallet.currentBalance) : undefined); + const getWalletBalance = (isPaymentItem: boolean): string | undefined => (isPaymentItem ? CurrencyUtils.convertToDisplayString(userWallet?.currentBalance) : undefined); - const openPopover = (link, event) => { + const openPopover = (link: string | (() => Promise) | undefined, event: GestureResponderEvent | MouseEvent) => { if (typeof link === 'function') { - link().then((url) => ReportActionContextMenu.showContextMenu(CONST.CONTEXT_MENU_TYPES.LINK, event, url, popoverAnchor.current)); + link?.()?.then((url) => ReportActionContextMenu.showContextMenu(CONST.CONTEXT_MENU_TYPES.LINK, event, url, popoverAnchor.current)); } else if (link) { ReportActionContextMenu.showContextMenu(CONST.CONTEXT_MENU_TYPES.LINK, event, link, popoverAnchor.current); } @@ -270,13 +262,13 @@ function InitialSettingsPage(props) { return ( {translate(menuItemsData.sectionTranslationKey)} - {_.map(menuItemsData.items, (item, index) => { + {menuItemsData.items.map((item) => { const keyTitle = item.translationKey ? translate(item.translationKey) : item.title; const isPaymentItem = item.translationKey === 'common.wallet'; return ( openPopover(item.link, event) : undefined} - focused={activeRoute && item.routeName && activeRoute.toLowerCase().replaceAll('_', '') === item.routeName.toLowerCase().replaceAll('/', '')} + focused={!!activeRoute && !!item.routeName && !!(activeRoute.toLowerCase().replaceAll('_', '') === item.routeName.toLowerCase().replaceAll('/', ''))} isPaneMenu iconRight={item.iconRight} shouldShowRightIcon={item.shouldShowRightIcon} @@ -319,7 +311,7 @@ function InitialSettingsPage(props) { styles.sectionMenuItem, styles.hoveredComponentBG, translate, - props.userWallet.currentBalance, + userWallet?.currentBalance, isExecuting, singleExecution, activeRoute, @@ -330,20 +322,22 @@ function InitialSettingsPage(props) { const accountMenuItems = useMemo(() => getMenuItemsSection(accountMenuItemsData), [accountMenuItemsData, getMenuItemsSection]); const generalMenuItems = useMemo(() => getMenuItemsSection(generalMenuItemsData), [generalMenuItemsData, getMenuItemsSection]); - const currentUserDetails = props.currentUserPersonalDetails || {}; - const avatarURL = lodashGet(currentUserDetails, 'avatar', ''); - const accountID = lodashGet(currentUserDetails, 'accountID', ''); + const currentUserDetails = currentUserPersonalDetails; + const avatarURL = currentUserDetails?.avatar ?? ''; + const accountID = currentUserDetails?.accountID ?? ''; const headerContent = ( - {_.isEmpty(props.currentUserPersonalDetails) || _.isUndefined(props.currentUserPersonalDetails.displayName) ? ( + {isEmptyObject(currentUserPersonalDetails) || currentUserPersonalDetails.displayName === undefined ? ( ) : ( <> Navigation.navigate(ROUTES.SETTINGS_SHARE_CODE)} > @@ -358,7 +352,9 @@ function InitialSettingsPage(props) { Navigation.navigate(ROUTES.SETTINGS_STATUS)} > @@ -377,39 +373,39 @@ function InitialSettingsPage(props) { Navigation.navigate(ROUTES.PROFILE_AVATAR.getRoute(accountID))} + onViewPhotoPress={() => Navigation.navigate(ROUTES.PROFILE_AVATAR.getRoute(String(accountID)))} previewSource={UserUtils.getFullSizeAvatar(avatarURL, accountID)} originalFileName={currentUserDetails.originalFileName} - headerTitle={props.translate('profilePage.profileAvatar')} - fallbackIcon={lodashGet(currentUserDetails, 'fallbackIcon')} + headerTitle={translate('profilePage.profileAvatar')} + fallbackIcon={currentUserDetails?.fallbackIcon} /> - {props.currentUserPersonalDetails.displayName ? props.currentUserPersonalDetails.displayName : props.formatPhoneNumber(props.session.email)} + {currentUserPersonalDetails.displayName ? currentUserPersonalDetails.displayName : formatPhoneNumber(session?.email ?? '')} - {Boolean(props.currentUserPersonalDetails.displayName) && ( + {Boolean(currentUserPersonalDetails.displayName) && ( - {props.formatPhoneNumber(props.session.email)} + {formatPhoneNumber(session?.email ?? '')} )} @@ -445,17 +441,10 @@ function InitialSettingsPage(props) { ); } -InitialSettingsPage.propTypes = propTypes; -InitialSettingsPage.defaultProps = defaultProps; InitialSettingsPage.displayName = 'InitialSettingsPage'; -export default compose( - withLocalize, - withCurrentUserPersonalDetails, - withOnyx({ - session: { - key: ONYXKEYS.SESSION, - }, +export default withCurrentUserPersonalDetails( + withOnyx({ userWallet: { key: ONYXKEYS.USER_WALLET, }, @@ -471,6 +460,8 @@ export default compose( loginList: { key: ONYXKEYS.LOGIN_LIST, }, - }), - withNetwork(), -)(InitialSettingsPage); + session: { + key: ONYXKEYS.SESSION, + }, + })(InitialSettingsPage), +); From 54f6ee83fd5cc6aa9e482ef4ec844d5713c3561b Mon Sep 17 00:00:00 2001 From: Amarparab2024 <156438377+Amarparab2024@users.noreply.github.com> Date: Wed, 28 Feb 2024 02:23:45 +0530 Subject: [PATCH 15/31] Update InitialSettingsPage.tsx --- src/pages/settings/InitialSettingsPage.tsx | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/pages/settings/InitialSettingsPage.tsx b/src/pages/settings/InitialSettingsPage.tsx index 78543bf72a99..93f938a2193f 100755 --- a/src/pages/settings/InitialSettingsPage.tsx +++ b/src/pages/settings/InitialSettingsPage.tsx @@ -25,7 +25,6 @@ import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import useWaitForNavigation from '@hooks/useWaitForNavigation'; import * as CurrencyUtils from '@libs/CurrencyUtils'; -import interceptAnonymousUser from '@libs/interceptAnonymousUser'; import getTopmostSettingsCentralPaneName from '@libs/Navigation/getTopmostSettingsCentralPaneName'; import Navigation from '@libs/Navigation/Navigation'; import * as UserUtils from '@libs/UserUtils'; @@ -225,13 +224,6 @@ function InitialSettingsPage({session, userWallet, bankAccountList, fundList, wa translationKey: 'sidebarScreen.saveTheWorld', icon: Expensicons.Heart, routeName: ROUTES.SETTINGS_SAVE_THE_WORLD, - action: () => { - interceptAnonymousUser( - waitForNavigate(() => { - Navigation.navigate(ROUTES.SETTINGS_SAVE_THE_WORLD); - }), - ); - }, }, ], }), From b6b630e3fa8052657a257984cd7237ea6cd13cac Mon Sep 17 00:00:00 2001 From: Amarparab2024 <156438377+Amarparab2024@users.noreply.github.com> Date: Wed, 28 Feb 2024 02:28:41 +0530 Subject: [PATCH 16/31] Update InitialSettingsPage.tsx --- src/pages/settings/InitialSettingsPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/settings/InitialSettingsPage.tsx b/src/pages/settings/InitialSettingsPage.tsx index 93f938a2193f..1976725d0095 100755 --- a/src/pages/settings/InitialSettingsPage.tsx +++ b/src/pages/settings/InitialSettingsPage.tsx @@ -227,7 +227,7 @@ function InitialSettingsPage({session, userWallet, bankAccountList, fundList, wa }, ], }), - [styles.pt4, waitForNavigate], + [styles.pt4], ); /** From 94c9f2b666b6e61498cccea4601ec4a24218d8b3 Mon Sep 17 00:00:00 2001 From: Amarparab2024 <156438377+Amarparab2024@users.noreply.github.com> Date: Fri, 1 Mar 2024 02:21:46 +0530 Subject: [PATCH 17/31] Update SCREENS.ts --- src/SCREENS.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SCREENS.ts b/src/SCREENS.ts index 409b58f9832e..71d983bebf23 100644 --- a/src/SCREENS.ts +++ b/src/SCREENS.ts @@ -37,7 +37,7 @@ const SCREENS = { TROUBLESHOOT: 'Settings_Troubleshoot', CONSOLE: 'Settings_Console', SHARE_LOG: 'Share_Log', - SAVE_THE_WORLD: 'Settings_SaveTheWorld', + SAVE_THE_WORLD: 'Settings_TeachersUnite', PROFILE: { ROOT: 'Settings_Profile', From 3270b83428e6128bf2b922799b83819a69a28882 Mon Sep 17 00:00:00 2001 From: Amarparab2024 <156438377+Amarparab2024@users.noreply.github.com> Date: Thu, 7 Mar 2024 03:57:16 +0530 Subject: [PATCH 18/31] Update ImTeacherUpdateEmailPage.tsx --- src/pages/TeachersUnite/ImTeacherUpdateEmailPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/TeachersUnite/ImTeacherUpdateEmailPage.tsx b/src/pages/TeachersUnite/ImTeacherUpdateEmailPage.tsx index 818910b6d118..ba03b0ac910f 100644 --- a/src/pages/TeachersUnite/ImTeacherUpdateEmailPage.tsx +++ b/src/pages/TeachersUnite/ImTeacherUpdateEmailPage.tsx @@ -20,7 +20,7 @@ function ImTeacherUpdateEmailPage() { Navigation.goBack(ROUTES.SETTINGS_SAVE_THE_WORLD)} + onBackButtonPress={() => Navigation.goBack()} /> Date: Thu, 7 Mar 2024 03:57:38 +0530 Subject: [PATCH 19/31] Update IntroSchoolPrincipalPage.tsx --- src/pages/TeachersUnite/IntroSchoolPrincipalPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/TeachersUnite/IntroSchoolPrincipalPage.tsx b/src/pages/TeachersUnite/IntroSchoolPrincipalPage.tsx index 3cb91a57008e..a01bd021e6fb 100644 --- a/src/pages/TeachersUnite/IntroSchoolPrincipalPage.tsx +++ b/src/pages/TeachersUnite/IntroSchoolPrincipalPage.tsx @@ -81,7 +81,7 @@ function IntroSchoolPrincipalPage(props: IntroSchoolPrincipalPageProps) { > Navigation.goBack(ROUTES.SETTINGS_SAVE_THE_WORLD)} + onBackButtonPress={() => Navigation.goBack()} /> Date: Thu, 7 Mar 2024 03:58:00 +0530 Subject: [PATCH 20/31] Update KnowATeacherPage.tsx --- src/pages/TeachersUnite/KnowATeacherPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/TeachersUnite/KnowATeacherPage.tsx b/src/pages/TeachersUnite/KnowATeacherPage.tsx index 205df762a475..4972ba94aea4 100644 --- a/src/pages/TeachersUnite/KnowATeacherPage.tsx +++ b/src/pages/TeachersUnite/KnowATeacherPage.tsx @@ -87,7 +87,7 @@ function KnowATeacherPage(props: KnowATeacherPageProps) { > Navigation.goBack(ROUTES.SETTINGS_SAVE_THE_WORLD)} + onBackButtonPress={() => Navigation.goBack()} /> Date: Thu, 7 Mar 2024 04:05:58 +0530 Subject: [PATCH 21/31] Update KnowATeacherPage.tsx --- src/pages/TeachersUnite/KnowATeacherPage.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/TeachersUnite/KnowATeacherPage.tsx b/src/pages/TeachersUnite/KnowATeacherPage.tsx index 4972ba94aea4..cb58009c40f0 100644 --- a/src/pages/TeachersUnite/KnowATeacherPage.tsx +++ b/src/pages/TeachersUnite/KnowATeacherPage.tsx @@ -20,7 +20,6 @@ import * as ValidationUtils from '@libs/ValidationUtils'; import TeachersUnite from '@userActions/TeachersUnite'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import ROUTES from '@src/ROUTES'; import INPUT_IDS from '@src/types/form/IKnowTeacherForm'; import type {LoginList} from '@src/types/onyx'; From 3c292f87cf0ec07dc492adad9665692da3a7d760 Mon Sep 17 00:00:00 2001 From: Amarparab2024 <156438377+Amarparab2024@users.noreply.github.com> Date: Thu, 7 Mar 2024 04:06:19 +0530 Subject: [PATCH 22/31] Update IntroSchoolPrincipalPage.tsx --- src/pages/TeachersUnite/IntroSchoolPrincipalPage.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/TeachersUnite/IntroSchoolPrincipalPage.tsx b/src/pages/TeachersUnite/IntroSchoolPrincipalPage.tsx index a01bd021e6fb..6e8c3b340f4e 100644 --- a/src/pages/TeachersUnite/IntroSchoolPrincipalPage.tsx +++ b/src/pages/TeachersUnite/IntroSchoolPrincipalPage.tsx @@ -20,7 +20,6 @@ import * as ValidationUtils from '@libs/ValidationUtils'; import TeachersUnite from '@userActions/TeachersUnite'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import ROUTES from '@src/ROUTES'; import INPUT_IDS from '@src/types/form/IntroSchoolPrincipalForm'; import type {LoginList} from '@src/types/onyx'; From 06405f22583eb61b6f59b193b34bc5b056ab63ef Mon Sep 17 00:00:00 2001 From: Amarparab2024 <156438377+Amarparab2024@users.noreply.github.com> Date: Thu, 7 Mar 2024 04:20:05 +0530 Subject: [PATCH 23/31] fix lint --- src/components/Icon/Illustrations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Icon/Illustrations.ts b/src/components/Icon/Illustrations.ts index e3cfab76efe1..d13d2518fd6b 100644 --- a/src/components/Icon/Illustrations.ts +++ b/src/components/Icon/Illustrations.ts @@ -66,13 +66,13 @@ import SanFrancisco from '@assets/images/simple-illustrations/simple-illustratio import ShieldYellow from '@assets/images/simple-illustrations/simple-illustration__shield.svg'; import SmallRocket from '@assets/images/simple-illustrations/simple-illustration__smallrocket.svg'; import Tag from '@assets/images/simple-illustrations/simple-illustration__tag.svg'; +import TeachersUnite from '@assets/images/simple-illustrations/simple-illustration__teachers-unite.svg'; import ThumbsUpStars from '@assets/images/simple-illustrations/simple-illustration__thumbsupstars.svg'; import TrackShoe from '@assets/images/simple-illustrations/simple-illustration__track-shoe.svg'; import TrashCan from '@assets/images/simple-illustrations/simple-illustration__trashcan.svg'; import TreasureChest from '@assets/images/simple-illustrations/simple-illustration__treasurechest.svg'; import WalletAlt from '@assets/images/simple-illustrations/simple-illustration__wallet-alt.svg'; import Workflows from '@assets/images/simple-illustrations/simple-illustration__workflows.svg'; -import TeachersUnite from '@assets/images/simple-illustrations/simple-illustration__teachers-unite.svg'; export { Abracadabra, From daa6d4d016b3c8e0b724922f7f70b398c099dfb6 Mon Sep 17 00:00:00 2001 From: Amar Parab Date: Mon, 18 Mar 2024 03:15:01 +0530 Subject: [PATCH 24/31] Reconfigure to default for IDEAL NAV 2 --- src/ROUTES.ts | 3 +-- src/SCREENS.ts | 3 +-- .../AppNavigator/ModalStackNavigators.tsx | 8 +------ src/libs/Navigation/linkingConfig/config.ts | 6 +----- src/pages/settings/InitialSettingsPage.tsx | 21 ++++++++++++------- 5 files changed, 17 insertions(+), 24 deletions(-) diff --git a/src/ROUTES.ts b/src/ROUTES.ts index c2dd0b5def7e..23f2678b08b0 100644 --- a/src/ROUTES.ts +++ b/src/ROUTES.ts @@ -81,7 +81,6 @@ const ROUTES = { SETTINGS_SECURITY: 'settings/security', SETTINGS_CLOSE: 'settings/security/closeAccount', SETTINGS_ABOUT: 'settings/about', - SETTINGS_SAVE_THE_WORLD: 'settings/teachersunite', SETTINGS_APP_DOWNLOAD_LINKS: 'settings/about/app-download-links', SETTINGS_WALLET: 'settings/wallet', SETTINGS_WALLET_DOMAINCARD: { @@ -657,4 +656,4 @@ type Route = RouteIsPlainString extends true ? never : AllRoutes; type HybridAppRoute = (typeof HYBRID_APP_ROUTES)[keyof typeof HYBRID_APP_ROUTES]; -export type {Route, HybridAppRoute, AllRoutes}; +export type {Route, HybridAppRoute, AllRoutes}; \ No newline at end of file diff --git a/src/SCREENS.ts b/src/SCREENS.ts index f38f2132848e..5104872b2d0b 100644 --- a/src/SCREENS.ts +++ b/src/SCREENS.ts @@ -38,7 +38,6 @@ const SCREENS = { TROUBLESHOOT: 'Settings_Troubleshoot', CONSOLE: 'Settings_Console', SHARE_LOG: 'Share_Log', - SAVE_THE_WORLD: 'Settings_TeachersUnite', PROFILE: { ROOT: 'Settings_Profile', @@ -295,4 +294,4 @@ type Screen = DeepValueOf; export default SCREENS; export {PROTECTED_SCREENS}; -export type {Screen}; +export type {Screen}; \ No newline at end of file diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx b/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx index 026e2b7aa01b..91396a872261 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx @@ -188,12 +188,6 @@ const NewTeachersUniteNavigator = createModalStackNavigator require('../../../pages/settings/Preferences/PreferencesPage').default as React.ComponentType, - [SCREENS.SETTINGS.SECURITY]: () => require('../../../pages/settings/Security/SecuritySettingsPage').default as React.ComponentType, - [SCREENS.SETTINGS.PROFILE.ROOT]: () => require('../../../pages/settings/Profile/ProfilePage').default as React.ComponentType, - [SCREENS.SETTINGS.WALLET.ROOT]: () => require('../../../pages/settings/Wallet/WalletPage').default as React.ComponentType, - [SCREENS.SETTINGS.ABOUT]: () => require('../../../pages/settings/AboutPage/AboutPage').default as React.ComponentType, - [SCREENS.SETTINGS.SAVE_THE_WORLD]: () => require('../../../pages/TeachersUnite/SaveTheWorldPage').default as React.ComponentType, [SCREENS.WORKSPACE.PROFILE]: () => require('../../../pages/workspace/WorkspaceProfilePage').default as React.ComponentType, [SCREENS.WORKSPACE.CARD]: () => require('../../../pages/workspace/card/WorkspaceCardPage').default as React.ComponentType, [SCREENS.WORKSPACE.WORKFLOWS]: () => require('../../../pages/workspace/workflows/WorkspaceWorkflowsPage').default as React.ComponentType, @@ -360,4 +354,4 @@ export { WalletStatementStackNavigator, ProcessMoneyRequestHoldStackNavigator, WorkspaceSettingsModalStackNavigator, -}; +}; \ No newline at end of file diff --git a/src/libs/Navigation/linkingConfig/config.ts b/src/libs/Navigation/linkingConfig/config.ts index 18b7f6e5a06c..b2f0528ee846 100644 --- a/src/libs/Navigation/linkingConfig/config.ts +++ b/src/libs/Navigation/linkingConfig/config.ts @@ -603,10 +603,6 @@ const config: LinkingOptions['config'] = { [SCREENS.WORKSPACE.DISTANCE_RATES]: { path: ROUTES.WORKSPACE_DISTANCE_RATES.route, }, - [SCREENS.SETTINGS.SAVE_THE_WORLD]: { - path: ROUTES.SETTINGS_SAVE_THE_WORLD, - exact: true, - }, }, }, }, @@ -614,4 +610,4 @@ const config: LinkingOptions['config'] = { }, }; -export default config; +export default config; \ No newline at end of file diff --git a/src/pages/settings/InitialSettingsPage.tsx b/src/pages/settings/InitialSettingsPage.tsx index 297d6de47927..c215385e3330 100755 --- a/src/pages/settings/InitialSettingsPage.tsx +++ b/src/pages/settings/InitialSettingsPage.tsx @@ -224,8 +224,9 @@ function InitialSettingsPage({session, userWallet, bankAccountList, fundList, wa * Retuns a list of menu items data for general section * @returns object with translationKey, style and items for the general section */ - const generalMenuItemsData: Menu = useMemo( - () => ({ + const generalMenuItemsData: Menu = useMemo(() => { + const signOutTranslationKey = Session.isSupportAuthToken() && Session.hasStashedSession() ? 'initialSettingsPage.restoreStashed' : 'initialSettingsPage.signOut'; + const defaultMenu: Menu = { sectionStyle: { ...styles.pt4, }, @@ -247,14 +248,18 @@ function InitialSettingsPage({session, userWallet, bankAccountList, fundList, wa routeName: ROUTES.SETTINGS_ABOUT, }, { - translationKey: 'sidebarScreen.saveTheWorld', - icon: Expensicons.Heart, - routeName: ROUTES.SETTINGS_SAVE_THE_WORLD, + translationKey: signOutTranslationKey, + icon: Expensicons.Exit, + action: () => { + signOut(false); + }, }, ], - }), - [styles.pt4], - ); + }; + + return defaultMenu; + }, [styles.pt4, signOut]); + /** * Retuns JSX.Element with menu items From e60c4619fce77418fbe1e600abbce61615b0bce6 Mon Sep 17 00:00:00 2001 From: Amar Parab Date: Mon, 18 Mar 2024 03:16:34 +0530 Subject: [PATCH 25/31] Reconfigure to default for IDEAL NAV 2 --- src/ROUTES.ts | 2 +- src/SCREENS.ts | 2 +- src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx | 2 +- src/libs/Navigation/linkingConfig/config.ts | 2 +- src/pages/settings/InitialSettingsPage.tsx | 1 - 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/ROUTES.ts b/src/ROUTES.ts index 23f2678b08b0..1bcf6fc02032 100644 --- a/src/ROUTES.ts +++ b/src/ROUTES.ts @@ -656,4 +656,4 @@ type Route = RouteIsPlainString extends true ? never : AllRoutes; type HybridAppRoute = (typeof HYBRID_APP_ROUTES)[keyof typeof HYBRID_APP_ROUTES]; -export type {Route, HybridAppRoute, AllRoutes}; \ No newline at end of file +export type {Route, HybridAppRoute, AllRoutes}; diff --git a/src/SCREENS.ts b/src/SCREENS.ts index 5104872b2d0b..5d872d194dc5 100644 --- a/src/SCREENS.ts +++ b/src/SCREENS.ts @@ -294,4 +294,4 @@ type Screen = DeepValueOf; export default SCREENS; export {PROTECTED_SCREENS}; -export type {Screen}; \ No newline at end of file +export type {Screen}; diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx b/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx index 91396a872261..549b5056eb73 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx @@ -354,4 +354,4 @@ export { WalletStatementStackNavigator, ProcessMoneyRequestHoldStackNavigator, WorkspaceSettingsModalStackNavigator, -}; \ No newline at end of file +}; diff --git a/src/libs/Navigation/linkingConfig/config.ts b/src/libs/Navigation/linkingConfig/config.ts index b2f0528ee846..4f8ccb7ec2c9 100644 --- a/src/libs/Navigation/linkingConfig/config.ts +++ b/src/libs/Navigation/linkingConfig/config.ts @@ -610,4 +610,4 @@ const config: LinkingOptions['config'] = { }, }; -export default config; \ No newline at end of file +export default config; diff --git a/src/pages/settings/InitialSettingsPage.tsx b/src/pages/settings/InitialSettingsPage.tsx index c215385e3330..41657a3f5ff6 100755 --- a/src/pages/settings/InitialSettingsPage.tsx +++ b/src/pages/settings/InitialSettingsPage.tsx @@ -260,7 +260,6 @@ function InitialSettingsPage({session, userWallet, bankAccountList, fundList, wa return defaultMenu; }, [styles.pt4, signOut]); - /** * Retuns JSX.Element with menu items * @param menuItemsData list with menu items data From f6a56c53aba65222fe83a6125857c2cd840cba8f Mon Sep 17 00:00:00 2001 From: Amar Parab Date: Mon, 18 Mar 2024 03:43:49 +0530 Subject: [PATCH 26/31] Move TeachersUnite to settings after IDEAL NAV 2 --- src/ROUTES.ts | 8 +++++--- src/SCREENS.ts | 1 + .../Navigation/AppNavigator/ModalStackNavigators.tsx | 1 + .../CentralPaneNavigator/BaseCentralPaneNavigator.tsx | 1 + src/libs/Navigation/linkingConfig/config.ts | 1 + src/libs/Navigation/types.ts | 3 ++- src/pages/settings/InitialSettingsPage.tsx | 11 ++++++++--- 7 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/ROUTES.ts b/src/ROUTES.ts index 1bcf6fc02032..cd7f5211abfe 100644 --- a/src/ROUTES.ts +++ b/src/ROUTES.ts @@ -170,6 +170,8 @@ const ROUTES = { getRoute: (backTo?: string) => getUrlWithBackToParam('settings/exit-survey/confirm', backTo), }, + SETTINGS_SAVE_THE_WORLD: 'settings/teachersunite', + KEYBOARD_SHORTCUTS: 'keyboard-shortcuts', NEW: 'new', @@ -438,9 +440,9 @@ const ROUTES = { ONBOARD_EXPENSIFY_CLASSIC: 'onboard/expensify-classic', TEACHERS_UNITE: 'teachersunite', - I_KNOW_A_TEACHER: 'teachersunite/i-know-a-teacher', - I_AM_A_TEACHER: 'teachersunite/i-am-a-teacher', - INTRO_SCHOOL_PRINCIPAL: 'teachersunite/intro-school-principal', + I_KNOW_A_TEACHER: 'settings/teachersunite/i-know-a-teacher', + I_AM_A_TEACHER: 'settings/teachersunite/i-am-a-teacher', + INTRO_SCHOOL_PRINCIPAL: 'settings/teachersunite/intro-school-principal', ERECEIPT: { route: 'eReceipt/:transactionID', diff --git a/src/SCREENS.ts b/src/SCREENS.ts index 5d872d194dc5..b0d19004cd05 100644 --- a/src/SCREENS.ts +++ b/src/SCREENS.ts @@ -29,6 +29,7 @@ const SCREENS = { WORKSPACES: 'Settings_Workspaces', SECURITY: 'Settings_Security', ABOUT: 'Settings_About', + SAVE_THE_WORLD: 'Settings_TeachersUnite', APP_DOWNLOAD_LINKS: 'Settings_App_Download_Links', ADD_DEBIT_CARD: 'Settings_Add_Debit_Card', ADD_BANK_ACCOUNT: 'Settings_Add_Bank_Account', diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx b/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx index 549b5056eb73..be8458612a2b 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx @@ -279,6 +279,7 @@ const SettingsModalStackNavigator = createModalStackNavigator require('../../../pages/settings/ExitSurvey/ExitSurveyConfirmPage').default as React.ComponentType, [SCREENS.WORKSPACE.WORKFLOWS_AUTO_REPORTING_FREQUENCY]: () => require('../../../pages/workspace/workflows/WorkspaceAutoReportingFrequencyPage').default as React.ComponentType, [SCREENS.WORKSPACE.WORKFLOWS_AUTO_REPORTING_MONTHLY_OFFSET]: () => require('../../../pages/workspace/workflows/WorkspaceAutoReportingMonthlyOffsetPage').default as React.ComponentType, + [SCREENS.SETTINGS.SAVE_THE_WORLD]: () => require('../../../pages/TeachersUnite/SaveTheWorldPage').default as React.ComponentType, }); const EnablePaymentsStackNavigator = createModalStackNavigator({ diff --git a/src/libs/Navigation/AppNavigator/Navigators/CentralPaneNavigator/BaseCentralPaneNavigator.tsx b/src/libs/Navigation/AppNavigator/Navigators/CentralPaneNavigator/BaseCentralPaneNavigator.tsx index 16f403342a58..2b63037a436f 100644 --- a/src/libs/Navigation/AppNavigator/Navigators/CentralPaneNavigator/BaseCentralPaneNavigator.tsx +++ b/src/libs/Navigation/AppNavigator/Navigators/CentralPaneNavigator/BaseCentralPaneNavigator.tsx @@ -20,6 +20,7 @@ const settingsScreens = { [SCREENS.SETTINGS.PROFILE.ROOT]: () => require('../../../../../pages/settings/Profile/ProfilePage').default as React.ComponentType, [SCREENS.SETTINGS.WALLET.ROOT]: () => require('../../../../../pages/settings/Wallet/WalletPage').default as React.ComponentType, [SCREENS.SETTINGS.ABOUT]: () => require('../../../../../pages/settings/AboutPage/AboutPage').default as React.ComponentType, + [SCREENS.SETTINGS.SAVE_THE_WORLD]: () => require('../../../../../pages/TeachersUnite/SaveTheWorldPage').default as React.ComponentType, } satisfies Screens; function BaseCentralPaneNavigator() { diff --git a/src/libs/Navigation/linkingConfig/config.ts b/src/libs/Navigation/linkingConfig/config.ts index 4f8ccb7ec2c9..f82998aa71dc 100644 --- a/src/libs/Navigation/linkingConfig/config.ts +++ b/src/libs/Navigation/linkingConfig/config.ts @@ -61,6 +61,7 @@ const config: LinkingOptions['config'] = { exact: true, }, [SCREENS.SETTINGS.WORKSPACES]: ROUTES.SETTINGS_WORKSPACES, + [SCREENS.SETTINGS.SAVE_THE_WORLD]: ROUTES.SETTINGS_SAVE_THE_WORLD, }, }, [SCREENS.NOT_FOUND]: '*', diff --git a/src/libs/Navigation/types.ts b/src/libs/Navigation/types.ts index 5e6ecf7a47c7..16e262c54321 100644 --- a/src/libs/Navigation/types.ts +++ b/src/libs/Navigation/types.ts @@ -15,7 +15,7 @@ import type CONST from '@src/CONST'; import type {Country} from '@src/CONST'; import type NAVIGATORS from '@src/NAVIGATORS'; import type {HybridAppRoute, Route as Routes} from '@src/ROUTES'; -import type SCREENS from '@src/SCREENS'; +import SCREENS from '@src/SCREENS'; import type EXIT_SURVEY_REASON_FORM_INPUT_IDS from '@src/types/form/ExitSurveyReasonForm'; type NavigationRef = NavigationContainerRefWithCurrent; @@ -59,6 +59,7 @@ type CentralPaneNavigatorParamList = { [SCREENS.SETTINGS.WALLET.ROOT]: undefined; [SCREENS.SETTINGS.ABOUT]: undefined; [SCREENS.SETTINGS.WORKSPACES]: undefined; + [SCREENS.SETTINGS.SAVE_THE_WORLD]: undefined; }; type WorkspaceSwitcherNavigatorParamList = { diff --git a/src/pages/settings/InitialSettingsPage.tsx b/src/pages/settings/InitialSettingsPage.tsx index 41657a3f5ff6..156040b17010 100755 --- a/src/pages/settings/InitialSettingsPage.tsx +++ b/src/pages/settings/InitialSettingsPage.tsx @@ -230,10 +230,10 @@ function InitialSettingsPage({session, userWallet, bankAccountList, fundList, wa sectionStyle: { ...styles.pt4, }, - sectionTranslationKey: 'initialSettingsPage.general' as const, + sectionTranslationKey: 'initialSettingsPage.general', items: [ { - translationKey: 'initialSettingsPage.help' as const, + translationKey: 'initialSettingsPage.help', icon: Expensicons.QuestionMark, action: () => { Link.openExternalLink(CONST.NEWHELP_URL); @@ -243,10 +243,15 @@ function InitialSettingsPage({session, userWallet, bankAccountList, fundList, wa link: CONST.NEWHELP_URL, }, { - translationKey: 'initialSettingsPage.about' as const, + translationKey: 'initialSettingsPage.about', icon: Expensicons.Info, routeName: ROUTES.SETTINGS_ABOUT, }, + { + translationKey: 'sidebarScreen.saveTheWorld', + icon: Expensicons.Heart, + routeName: ROUTES.SETTINGS_SAVE_THE_WORLD, + }, { translationKey: signOutTranslationKey, icon: Expensicons.Exit, From 660c43db75c823d48e4714f39ea65f2141b4c234 Mon Sep 17 00:00:00 2001 From: Amar Parab Date: Mon, 18 Mar 2024 03:55:42 +0530 Subject: [PATCH 27/31] Move TeachersUnite to settings after IDEAL NAV 2 --- src/libs/Navigation/types.ts | 2 +- src/pages/TeachersUnite/SaveTheWorldPage.tsx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libs/Navigation/types.ts b/src/libs/Navigation/types.ts index 16e262c54321..0e6b7cd897f8 100644 --- a/src/libs/Navigation/types.ts +++ b/src/libs/Navigation/types.ts @@ -15,7 +15,7 @@ import type CONST from '@src/CONST'; import type {Country} from '@src/CONST'; import type NAVIGATORS from '@src/NAVIGATORS'; import type {HybridAppRoute, Route as Routes} from '@src/ROUTES'; -import SCREENS from '@src/SCREENS'; +import type SCREENS from '@src/SCREENS'; import type EXIT_SURVEY_REASON_FORM_INPUT_IDS from '@src/types/form/ExitSurveyReasonForm'; type NavigationRef = NavigationContainerRefWithCurrent; diff --git a/src/pages/TeachersUnite/SaveTheWorldPage.tsx b/src/pages/TeachersUnite/SaveTheWorldPage.tsx index 4b7225f95f88..1f044dce7073 100644 --- a/src/pages/TeachersUnite/SaveTheWorldPage.tsx +++ b/src/pages/TeachersUnite/SaveTheWorldPage.tsx @@ -1,5 +1,6 @@ import React, {useMemo} from 'react'; -import {ScrollView, View} from 'react-native'; +import {View} from 'react-native'; +import ScrollView from '@components/ScrollView'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; import * as Illustrations from '@components/Icon/Illustrations'; import LottieAnimations from '@components/LottieAnimations'; From 06ef8293b493c0f69e6bb7990a26beea9d6a12b6 Mon Sep 17 00:00:00 2001 From: Amar Parab Date: Mon, 18 Mar 2024 04:02:02 +0530 Subject: [PATCH 28/31] Move TeachersUnite to settings after IDEAL NAV 2 --- src/pages/TeachersUnite/SaveTheWorldPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/TeachersUnite/SaveTheWorldPage.tsx b/src/pages/TeachersUnite/SaveTheWorldPage.tsx index 1f044dce7073..cc414315e725 100644 --- a/src/pages/TeachersUnite/SaveTheWorldPage.tsx +++ b/src/pages/TeachersUnite/SaveTheWorldPage.tsx @@ -1,11 +1,11 @@ import React, {useMemo} from 'react'; import {View} from 'react-native'; -import ScrollView from '@components/ScrollView'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; import * as Illustrations from '@components/Icon/Illustrations'; import LottieAnimations from '@components/LottieAnimations'; import MenuItemList from '@components/MenuItemList'; import ScreenWrapper from '@components/ScreenWrapper'; +import ScrollView from '@components/ScrollView'; import Section from '@components/Section'; import useLocalize from '@hooks/useLocalize'; import useTheme from '@hooks/useTheme'; From 4382bddff971dc225c688cd49a6744dd857cb568 Mon Sep 17 00:00:00 2001 From: Amar Parab Date: Fri, 5 Apr 2024 06:16:52 +0530 Subject: [PATCH 29/31] Add modalstack navigator --- src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx b/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx index e2f51beb5f8f..cc7850eb69b3 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx @@ -268,6 +268,7 @@ const SettingsModalStackNavigator = createModalStackNavigator require('../../../../pages/workspace/taxes/NamePage').default as React.ComponentType, [SCREENS.WORKSPACE.TAX_VALUE]: () => require('../../../../pages/workspace/taxes/ValuePage').default as React.ComponentType, [SCREENS.WORKSPACE.TAX_CREATE]: () => require('../../../../pages/workspace/taxes/WorkspaceCreateTaxPage').default as React.ComponentType, + [SCREENS.SETTINGS.SAVE_THE_WORLD]: () => require('../../../../pages/TeachersUnite/SaveTheWorldPage').default as React.ComponentType, }); const EnablePaymentsStackNavigator = createModalStackNavigator({ From 161391d1b097ece5c897bb5ba00c4aaa8377f484 Mon Sep 17 00:00:00 2001 From: Amar Parab Date: Fri, 5 Apr 2024 06:23:52 +0530 Subject: [PATCH 30/31] Fix linter --- .../sidebar/SidebarScreen/FloatingActionButtonAndPopover.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js index e9a2a1c171cd..5dc1019f3bad 100644 --- a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js +++ b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js @@ -15,7 +15,6 @@ import usePrevious from '@hooks/usePrevious'; import useThemeStyles from '@hooks/useThemeStyles'; import compose from '@libs/compose'; import interceptAnonymousUser from '@libs/interceptAnonymousUser'; -import Navigation from '@libs/Navigation/Navigation'; import * as ReportUtils from '@libs/ReportUtils'; import personalDetailsPropType from '@pages/personalDetailsPropType'; import * as App from '@userActions/App'; @@ -25,7 +24,6 @@ import * as Report from '@userActions/Report'; import * as Task from '@userActions/Task'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import ROUTES from '@src/ROUTES'; /** * @param {Object} [policy] From 11fc00a77f9fa8098131ee08d34d54dd79c5990e Mon Sep 17 00:00:00 2001 From: Amar Parab Date: Sun, 7 Apr 2024 01:26:01 +0530 Subject: [PATCH 31/31] Remove old teachersunite route --- src/ROUTES.ts | 2 +- src/libs/Navigation/linkingConfig/config.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ROUTES.ts b/src/ROUTES.ts index e5e234f15fb6..ac2e782e5fa2 100644 --- a/src/ROUTES.ts +++ b/src/ROUTES.ts @@ -441,7 +441,7 @@ const ROUTES = { ONBOARD_MANAGE_EXPENSES: 'onboard/manage-expenses', ONBOARD_EXPENSIFY_CLASSIC: 'onboard/expensify-classic', - TEACHERS_UNITE: 'teachersunite', + TEACHERS_UNITE: 'settings/teachersunite', I_KNOW_A_TEACHER: 'settings/teachersunite/i-know-a-teacher', I_AM_A_TEACHER: 'settings/teachersunite/i-am-a-teacher', INTRO_SCHOOL_PRINCIPAL: 'settings/teachersunite/intro-school-principal', diff --git a/src/libs/Navigation/linkingConfig/config.ts b/src/libs/Navigation/linkingConfig/config.ts index c2e25b84ce1f..780a03634481 100644 --- a/src/libs/Navigation/linkingConfig/config.ts +++ b/src/libs/Navigation/linkingConfig/config.ts @@ -488,7 +488,6 @@ const config: LinkingOptions['config'] = { }, [SCREENS.RIGHT_MODAL.TEACHERS_UNITE]: { screens: { - [SCREENS.SAVE_THE_WORLD.ROOT]: ROUTES.TEACHERS_UNITE, [SCREENS.I_KNOW_A_TEACHER]: ROUTES.I_KNOW_A_TEACHER, [SCREENS.INTRO_SCHOOL_PRINCIPAL]: ROUTES.INTRO_SCHOOL_PRINCIPAL, [SCREENS.I_AM_A_TEACHER]: ROUTES.I_AM_A_TEACHER,