Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Save the World from Global Create, and move it into Settings #37175

Merged
merged 43 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
118a6d4
Update ROUTES.ts
aeioual Feb 24, 2024
804fe4a
Update SCREENS.ts
aeioual Feb 24, 2024
9d3bec7
Update ModalStackNavigators.tsx
aeioual Feb 24, 2024
e4d9f7b
Update config.ts
aeioual Feb 24, 2024
cac93d7
Update ImTeacherUpdateEmailPage.tsx
aeioual Feb 24, 2024
c5658bd
Update IntroSchoolPrincipalPage.tsx
aeioual Feb 24, 2024
ece8a45
Update KnowATeacherPage.tsx
aeioual Feb 24, 2024
4d285c6
Update SaveTheWorldPage.tsx
aeioual Feb 24, 2024
a2cd758
Update InitialSettingsPage.js
aeioual Feb 24, 2024
89371d4
Update FloatingActionButtonAndPopover.js
aeioual Feb 24, 2024
b4ab920
Update Illustrations.ts
aeioual Feb 27, 2024
8dac188
Update SaveTheWorldPage.tsx
aeioual Feb 27, 2024
8d80ca0
Create simple-illustration__teachers-unite.svg
aeioual Feb 27, 2024
c28bb4d
merge changes
aeioual Feb 27, 2024
61ae205
Merge branch 'main' into issue36649
aeioual Feb 27, 2024
54f6ee8
Update InitialSettingsPage.tsx
aeioual Feb 27, 2024
b6b630e
Update InitialSettingsPage.tsx
aeioual Feb 27, 2024
94c9f2b
Update SCREENS.ts
aeioual Feb 29, 2024
9dfb26d
Merge branch 'Expensify:main' into issue36649
aeioual Feb 29, 2024
fad2fc1
Merge branch 'Expensify:main' into issue36649
aeioual Mar 4, 2024
5554088
Merge branch 'main' into issue36649
aeioual Mar 6, 2024
3270b83
Update ImTeacherUpdateEmailPage.tsx
aeioual Mar 6, 2024
2f2d147
Update IntroSchoolPrincipalPage.tsx
aeioual Mar 6, 2024
85aba8a
Update KnowATeacherPage.tsx
aeioual Mar 6, 2024
43d4a94
Merge branch 'Expensify:main' into issue36649
aeioual Mar 6, 2024
6a21c8c
Update KnowATeacherPage.tsx
aeioual Mar 6, 2024
3c292f8
Update IntroSchoolPrincipalPage.tsx
aeioual Mar 6, 2024
06405f2
fix lint
aeioual Mar 6, 2024
9268753
Merge branch 'main' into issue36649
aeioual Mar 13, 2024
a6e029c
Merge branch 'Expensify:main' into issue36649
aeioual Mar 17, 2024
daa6d4d
Reconfigure to default for IDEAL NAV 2
aeioual Mar 17, 2024
e60c461
Reconfigure to default for IDEAL NAV 2
aeioual Mar 17, 2024
f6a56c5
Move TeachersUnite to settings after IDEAL NAV 2
aeioual Mar 17, 2024
660c43d
Move TeachersUnite to settings after IDEAL NAV 2
aeioual Mar 17, 2024
06ef829
Move TeachersUnite to settings after IDEAL NAV 2
aeioual Mar 17, 2024
4ab2612
Merge branch 'main' into issue36649
aeioual Mar 19, 2024
14a280f
Merge branch 'main' into issue36649
aeioual Mar 20, 2024
c352e9b
Merge branch 'main' into issue36649
aeioual Mar 22, 2024
49c3366
Resolve merge conflict
aeioual Apr 5, 2024
4382bdd
Add modalstack navigator
aeioual Apr 5, 2024
161391d
Fix linter
aeioual Apr 5, 2024
9bdbb68
Merge branch 'Expensify:main' into issue36649
aeioual Apr 6, 2024
11fc00a
Remove old teachersunite route
aeioual Apr 6, 2024
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 6 additions & 4 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ const ROUTES = {
getRoute: (backTo?: string) => getUrlWithBackToParam('settings/exit-survey/confirm', backTo),
},

SETTINGS_SAVE_THE_WORLD: 'settings/teachersunite',

KEYBOARD_SHORTCUTS: 'keyboard-shortcuts',

NEW: 'new',
Expand Down Expand Up @@ -439,10 +441,10 @@ const ROUTES = {
ONBOARD_MANAGE_EXPENSES: 'onboard/manage-expenses',
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',
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',

ERECEIPT: {
route: 'eReceipt/:transactionID',
Expand Down
1 change: 1 addition & 0 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 2 additions & 0 deletions src/components/Icon/Illustrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ import ShieldYellow from '@assets/images/simple-illustrations/simple-illustratio
import SmallRocket from '@assets/images/simple-illustrations/simple-illustration__smallrocket.svg';
import SplitBill from '@assets/images/simple-illustrations/simple-illustration__splitbill.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';
Expand Down Expand Up @@ -158,6 +159,7 @@ export {
Workflows,
ThreeLeggedLaptopWoman,
House,
TeachersUnite,
Abacus,
Binoculars,
CompanyCard,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ const SettingsModalStackNavigator = createModalStackNavigator<SettingsNavigatorP
[SCREENS.WORKSPACE.TAX_NAME]: () => 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<EnablePaymentsNavigatorParamList>({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion src/libs/Navigation/linkingConfig/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const config: LinkingOptions<RootStackParamList>['config'] = {
exact: true,
},
[SCREENS.SETTINGS.WORKSPACES]: ROUTES.SETTINGS_WORKSPACES,
[SCREENS.SETTINGS.SAVE_THE_WORLD]: ROUTES.SETTINGS_SAVE_THE_WORLD,
},
},
[SCREENS.NOT_FOUND]: '*',
Expand Down Expand Up @@ -487,7 +488,6 @@ const config: LinkingOptions<RootStackParamList>['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,
Expand Down
1 change: 1 addition & 0 deletions src/libs/Navigation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
94 changes: 66 additions & 28 deletions src/pages/TeachersUnite/SaveTheWorldPage.tsx
Original file line number Diff line number Diff line change
@@ -1,49 +1,87 @@
import React from 'react';
import React, {useMemo} from 'react';
import {View} from 'react-native';
import IllustratedHeaderPageLayout from '@components/IllustratedHeaderPageLayout';
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 ScrollView from '@components/ScrollView';
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 (
<IllustratedHeaderPageLayout
shouldShowBackButton
title={translate('sidebarScreen.saveTheWorld')}
backgroundColor={theme.PAGE_THEMES[SCREENS.SAVE_THE_WORLD.ROOT].backgroundColor}
onBackButtonPress={Navigation.goBack}
illustration={LottieAnimations.SaveTheWorld}
<ScreenWrapper
testID={SaveTheWorldPage.displayName}
includeSafeAreaPaddingBottom={false}
shouldEnablePickerAvoiding={false}
shouldShowOfflineIndicatorInWideScreen
>
<View style={[styles.mb4, styles.justifyContentBetween, styles.mh5]}>
<Text style={[styles.textHeadline, styles.mb3]}>{translate('teachersUnitePage.teachersUnite')}</Text>
<Text>{translate('teachersUnitePage.joinExpensifyOrg')}</Text>
</View>

<MenuItem
shouldShowRightIcon
title={translate('teachersUnitePage.iKnowATeacher')}
onPress={() => Navigation.navigate(ROUTES.I_KNOW_A_TEACHER)}
/>

<MenuItem
shouldShowRightIcon
title={translate('teachersUnitePage.iAmATeacher')}
onPress={() => Navigation.navigate(ROUTES.I_AM_A_TEACHER)}
<HeaderWithBackButton
title={translate('sidebarScreen.saveTheWorld')}
shouldShowBackButton={isSmallScreenWidth}
onBackButtonPress={() => Navigation.goBack()}
icon={Illustrations.TeachersUnite}
/>
</IllustratedHeaderPageLayout>
<ScrollView contentContainerStyle={styles.pt3}>
<View style={[styles.flex1, isSmallScreenWidth ? styles.workspaceSectionMobile : styles.workspaceSection]}>
<Section
title={translate('teachersUnitePage.teachersUnite')}
subtitle={translate('teachersUnitePage.joinExpensifyOrg')}
isCentralPane
subtitleMuted
illustration={LottieAnimations.SaveTheWorld}
illustrationBackgroundColor={theme.PAGE_THEMES[SCREENS.SAVE_THE_WORLD.ROOT].backgroundColor}
titleStyles={styles.accountSettingsSectionTitle}
childrenStyles={styles.pt5}
>
<MenuItemList
menuItems={menuItems}
shouldUseSingleExecution
/>
</Section>
</View>
</ScrollView>
</ScreenWrapper>
);
}

SaveTheWorldPage.displayName = 'SaveTheWorldPage';
SaveTheWorldPage.displayName = 'SettingSecurityPage';

export default SaveTheWorldPage;
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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]
Expand Down Expand Up @@ -334,11 +332,6 @@ function FloatingActionButtonAndPopover(props) {
text: translate('newTaskPage.assignTask'),
onSelected: () => interceptAnonymousUser(() => Task.clearOutTaskInfoAndNavigate()),
},
{
icon: Expensicons.Heart,
text: translate('sidebarScreen.saveTheWorld'),
onSelected: () => interceptAnonymousUser(() => Navigation.navigate(ROUTES.TEACHERS_UNITE)),
},
...(!props.isLoading && !Policy.hasActiveChatEnabledPolicies(props.allPolicies)
? [
{
Expand Down
5 changes: 5 additions & 0 deletions src/pages/settings/InitialSettingsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,11 @@ function InitialSettingsPage({session, userWallet, bankAccountList, fundList, wa
icon: Expensicons.Info,
routeName: ROUTES.SETTINGS_ABOUT,
},
{
translationKey: 'sidebarScreen.saveTheWorld',
icon: Expensicons.Heart,
routeName: ROUTES.SETTINGS_SAVE_THE_WORLD,
},
{
translationKey: signOutTranslationKey,
icon: Expensicons.Exit,
Expand Down
Loading