From b648167c0fc05c4cc5b87d0d509503fb48dcca78 Mon Sep 17 00:00:00 2001 From: Stephen McMurtry Date: Mon, 3 May 2021 12:21:10 -0600 Subject: [PATCH] Moving the ExposureHistory to its own navigator and folder (#1554) * move the recent exposures screen to its own folder * split out NoExposureHistoryScreen * put the exposure history pages in their own navigation stack * changed toolbar * reverted change for testing * renamed Toolbar2 --- .../{Toolbar2.tsx => ToolbarWithClose.tsx} | 10 +- src/components/index.ts | 2 +- src/navigation/MainNavigator.tsx | 21 +++- .../ExposureHistoryScreen.tsx | 108 ++---------------- .../RecentExposureView.tsx | 6 +- .../exposureHistory/views/ExposureList.tsx | 78 +++++++++++++ .../views/NoExposureHistoryScreen.tsx | 24 ++++ src/screens/menu/MenuScreen.tsx | 2 +- .../qr/components/BaseQRCodeScreen.tsx | 8 +- src/screens/qr/views/QRCodeScanner.tsx | 9 +- 10 files changed, 147 insertions(+), 121 deletions(-) rename src/components/{Toolbar2.tsx => ToolbarWithClose.tsx} (83%) rename src/screens/{qr => exposureHistory}/ExposureHistoryScreen.tsx (56%) rename src/screens/{exposures => exposureHistory}/RecentExposureView.tsx (84%) create mode 100644 src/screens/exposureHistory/views/ExposureList.tsx create mode 100644 src/screens/exposureHistory/views/NoExposureHistoryScreen.tsx diff --git a/src/components/Toolbar2.tsx b/src/components/ToolbarWithClose.tsx similarity index 83% rename from src/components/Toolbar2.tsx rename to src/components/ToolbarWithClose.tsx index 18741ea72..2e17f03f4 100644 --- a/src/components/Toolbar2.tsx +++ b/src/components/ToolbarWithClose.tsx @@ -5,13 +5,13 @@ import {useNavigation} from '@react-navigation/native'; import {useI18n} from 'locale'; export interface ToolbarProps2 { - onIconClicked(): void; - navText?: string; + onClose(): void; + closeText?: string; showBackButton?: boolean; useWhiteText?: boolean; } -export const Toolbar2 = ({navText, onIconClicked, showBackButton, useWhiteText = false}: ToolbarProps2) => { +export const ToolbarWithClose = ({closeText, onClose, showBackButton = true, useWhiteText = false}: ToolbarProps2) => { const navigation = useNavigation(); const i18n = useI18n(); const onBack = useCallback(() => navigation.goBack(), [navigation]); @@ -31,9 +31,9 @@ export const Toolbar2 = ({navText, onIconClicked, showBackButton, useWhiteText =