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#37175 from Amarparab2024/issue36649
Remove `Save the World` from Global Create, and move it into Settings
- Loading branch information
Showing
11 changed files
with
133 additions
and
40 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
assets/images/simple-illustrations/simple-illustration__teachers-unite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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 |
---|---|---|
@@ -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; |
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