From a3f84e2644770d8641cf3e51e0f403284995b7d2 Mon Sep 17 00:00:00 2001 From: Cindy Green Date: Thu, 14 Nov 2024 12:57:37 -0500 Subject: [PATCH 1/3] Adds on success handler to the hook so that the modal is only closed after the refresh is done. --- .../screens/Settings/MapManagement/BackgroundMaps.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/frontend/screens/Settings/MapManagement/BackgroundMaps.tsx b/src/frontend/screens/Settings/MapManagement/BackgroundMaps.tsx index 883484c38..d33d6f5b0 100644 --- a/src/frontend/screens/Settings/MapManagement/BackgroundMaps.tsx +++ b/src/frontend/screens/Settings/MapManagement/BackgroundMaps.tsx @@ -206,8 +206,11 @@ export function BackgroundMapsScreen() { text: t(m.deleteMapButtonText), icon: , onPress: () => { - removeCustomMapMutation.mutate(); - removeMapBottomSheet.closeSheet(); + removeCustomMapMutation.mutate(undefined, { + onSuccess: () => { + removeMapBottomSheet.closeSheet(); + }, + }); }, }, { From baf8b034944a79ced5dcf1334ce633c6df7b8c52 Mon Sep 17 00:00:00 2001 From: Cindy Green Date: Mon, 18 Nov 2024 12:27:47 -0500 Subject: [PATCH 2/3] Adds body text and header text to the background map files so that they line up with figma designs. Adds warning red so that the red color is as design specifies --- src/frontend/lib/styles.ts | 1 + .../Settings/MapManagement/BackgroundMaps.tsx | 29 ++++++------ .../Settings/MapManagement/ChooseMapFile.tsx | 24 +++++----- .../MapManagement/CustomMapDetails.tsx | 44 +++++++++++-------- 4 files changed, 54 insertions(+), 44 deletions(-) diff --git a/src/frontend/lib/styles.ts b/src/frontend/lib/styles.ts index bca8a9a31..ee9ec2ba2 100644 --- a/src/frontend/lib/styles.ts +++ b/src/frontend/lib/styles.ts @@ -24,3 +24,4 @@ export const DARK_ORANGE = '#E86826'; export const SYNC_BACKGROUND = '#2348B2'; export const GPS_MODAL_TEXT = 'rgb(40,40,40)'; export const DARK_GREEN = '#59A553'; +export const WARNING_RED = '#D92222'; diff --git a/src/frontend/screens/Settings/MapManagement/BackgroundMaps.tsx b/src/frontend/screens/Settings/MapManagement/BackgroundMaps.tsx index d33d6f5b0..d860c5770 100644 --- a/src/frontend/screens/Settings/MapManagement/BackgroundMaps.tsx +++ b/src/frontend/screens/Settings/MapManagement/BackgroundMaps.tsx @@ -14,7 +14,7 @@ import { import ErrorSvg from '../../../images/Error.svg'; import GreenCheckSvg from '../../../images/GreenCheck.svg'; import noop from '../../../lib/noop'; -import {DARK_GREY, RED, WHITE} from '../../../lib/styles'; +import {RED, WHITE} from '../../../lib/styles'; import { BottomSheetModal, BottomSheetModalContent, @@ -23,7 +23,8 @@ import { import {Button} from '../../../sharedComponents/Button'; import {ErrorBottomSheet} from '../../../sharedComponents/ErrorBottomSheet'; import {Loading} from '../../../sharedComponents/Loading'; -import {Text} from '../../../sharedComponents/Text'; +import {HeaderText} from '../../../sharedComponents/Text/HeaderText'; +import {BodyText} from '../../../sharedComponents/Text/BodyText'; import {type NativeRootNavigationProps} from '../../../sharedTypes/navigation'; import {ChooseMapFile} from './ChooseMapFile'; import {CustomMapDetails} from './CustomMapDetails'; @@ -130,10 +131,12 @@ export function BackgroundMapsScreen() { return ( <> - {t(m.about)} + + {t(m.about)} + - {t(m.description1)} - {t(m.description2)} + {t(m.description1)} + {t(m.description2)} - + {t(m.customMapInfoLoadError)} - + )} @@ -325,22 +330,16 @@ const styles = StyleSheet.create({ }, aboutText: { textAlign: 'center', - fontWeight: 'bold', - fontSize: 36, - color: DARK_GREY, }, infoLoadErrorText: { textAlign: 'center', color: RED, - fontSize: 20, }, removeMapFileButton: { backgroundColor: RED, }, removeMapFileButtonText: { - fontWeight: '700', letterSpacing: 0.5, - fontSize: 18, color: RED, }, }); diff --git a/src/frontend/screens/Settings/MapManagement/ChooseMapFile.tsx b/src/frontend/screens/Settings/MapManagement/ChooseMapFile.tsx index 5cb284431..e71197ba1 100644 --- a/src/frontend/screens/Settings/MapManagement/ChooseMapFile.tsx +++ b/src/frontend/screens/Settings/MapManagement/ChooseMapFile.tsx @@ -2,10 +2,11 @@ import React from 'react'; import {defineMessages, useIntl} from 'react-intl'; import {StyleSheet, View} from 'react-native'; -import {MEDIUM_GREY, RED} from '../../../lib/styles'; +import {NEW_DARK_GREY, RED} from '../../../lib/styles'; import {Button} from '../../../sharedComponents/Button'; -import {Text} from '../../../sharedComponents/Text'; import {DownloadIcon} from '../../../sharedComponents/icons'; +import {HeaderText} from '../../../sharedComponents/Text/HeaderText'; +import {BodyText} from '../../../sharedComponents/Text/BodyText'; const m = defineMessages({ chooseFile: { @@ -27,14 +28,19 @@ export function ChooseMapFile({onChooseFile}: {onChooseFile: () => void}) { - + {t(m.chooseFile)} - * - + + {' '} + * + + - {t(m.acceptedFileTypes)} + + {t(m.acceptedFileTypes)} + ); } @@ -49,17 +55,13 @@ const styles = StyleSheet.create({ gap: 12, }, buttonTextBase: { - fontWeight: '700', letterSpacing: 0.5, - fontSize: 18, }, asteriskText: { - fontSize: 18, color: RED, }, fileTypeText: { - color: MEDIUM_GREY, - fontSize: 14, textAlign: 'center', + color: NEW_DARK_GREY, }, }); diff --git a/src/frontend/screens/Settings/MapManagement/CustomMapDetails.tsx b/src/frontend/screens/Settings/MapManagement/CustomMapDetails.tsx index 3eb5edfd1..0dff655b4 100644 --- a/src/frontend/screens/Settings/MapManagement/CustomMapDetails.tsx +++ b/src/frontend/screens/Settings/MapManagement/CustomMapDetails.tsx @@ -4,9 +4,15 @@ import {StyleSheet, View} from 'react-native'; import {TouchableOpacity} from 'react-native-gesture-handler'; import {bytesToMegabytes} from '../../../lib/bytesToMegabytes'; -import {BLACK, MEDIUM_GREY, RED, VERY_LIGHT_GREY} from '../../../lib/styles'; +import { + BLACK, + NEW_DARK_GREY, + WARNING_RED, + VERY_LIGHT_GREY, +} from '../../../lib/styles'; import {Loading} from '../../../sharedComponents/Loading'; -import {Text} from '../../../sharedComponents/Text'; +import {BodyText} from '../../../sharedComponents/Text/BodyText'; +import {HeaderText} from '../../../sharedComponents/Text/HeaderText'; const m = defineMessages({ mapNameColumn: { @@ -53,34 +59,40 @@ export function CustomMapDetails({ return ( - {t(m.mapNameColumn)} - {t(m.dateAddedColumn)} + + {t(m.mapNameColumn)} + + + {t(m.dateAddedColumn)} + - {name} - + {name} + {displayedSize !== undefined && t(m.sizeInMegabytes, { value: displayedSize, })} - + - + - + - {t(m.removeMap)} + + {t(m.removeMap)} + {loading && } @@ -119,21 +131,17 @@ const styles = StyleSheet.create({ justifyContent: 'space-between', }, columnTitleText: { - color: MEDIUM_GREY, + color: NEW_DARK_GREY, }, dateAddedText: { - color: MEDIUM_GREY, + color: NEW_DARK_GREY, }, sizeText: { - color: MEDIUM_GREY, + color: NEW_DARK_GREY, }, removeMapText: { fontWeight: 'bold', - color: RED, - }, - nameText: { - fontWeight: 'bold', - fontSize: 18, + color: WARNING_RED, }, columnLeft: { flex: 1, From 866045907ffe92c4bcda3f6b449b3cfcffe63ab8 Mon Sep 17 00:00:00 2001 From: Cindy Green Date: Tue, 19 Nov 2024 10:02:41 -0500 Subject: [PATCH 3/3] Uses Full screen menu list for map management menu screen. --- .../screens/Settings/MapManagement/index.tsx | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/src/frontend/screens/Settings/MapManagement/index.tsx b/src/frontend/screens/Settings/MapManagement/index.tsx index cad00b4f8..70f610a6b 100644 --- a/src/frontend/screens/Settings/MapManagement/index.tsx +++ b/src/frontend/screens/Settings/MapManagement/index.tsx @@ -1,10 +1,9 @@ import React from 'react'; import {type NativeStackNavigationOptions} from '@react-navigation/native-stack'; import {defineMessages, useIntl, type MessageDescriptor} from 'react-intl'; -import {ScrollView} from 'react-native'; - -import {List, ListItem, ListItemText} from '../../../sharedComponents/List'; import {type NativeRootNavigationProps} from '../../../sharedTypes/navigation'; +import {FullScreenMenuList} from '../../../sharedComponents/MenuList/FullScreenMenuList'; +import {MenuListItemType} from '../../../sharedComponents/MenuList/MenuListItem'; const m = defineMessages({ screenTitle: { @@ -21,18 +20,17 @@ export function MapManagementScreen({ navigation, }: NativeRootNavigationProps<'MapManagement'>) { const {formatMessage: t} = useIntl(); - return ( - - - { - navigation.navigate('BackgroundMaps'); - }}> - - - - - ); + + const menuItems: MenuListItemType[] = [ + { + onPress: () => { + navigation.navigate('BackgroundMaps'); + }, + primaryText: t(m.backgroundMaps), + }, + ]; + + return ; } export function createNavigationOptions({