From c184ba741a52d3a0c589668bcdb66e19c9e1b66f Mon Sep 17 00:00:00 2001 From: Vincent Wijaya Date: Tue, 17 Oct 2023 15:42:12 +1100 Subject: [PATCH] Fix native base warning and various other bugs (#100) Co-authored-by: Josiah S --- src/frontend/Finding-Neno/App.js | 2 +- .../Finding-Neno/Pages/DashboardPage.jsx | 2 +- src/frontend/Finding-Neno/Pages/MapPage.jsx | 4 ++-- .../Finding-Neno/Pages/ReportsPage.jsx | 2 +- .../Finding-Neno/Pages/SightingsPage.jsx | 2 +- .../Finding-Neno/components/Reports/Report.js | 2 +- .../components/Reports/ReportsList.jsx | 2 +- .../components/Shared/ImageHandler.jsx | 2 +- .../components/Sightings/SightingsList.jsx | 2 +- src/frontend/Finding-Neno/package-lock.json | 8 +++---- src/frontend/Finding-Neno/package.json | 2 +- .../patches/native-base+3.4.28.patch | 21 +++++++++++++++++++ 12 files changed, 36 insertions(+), 15 deletions(-) create mode 100644 src/frontend/Finding-Neno/patches/native-base+3.4.28.patch diff --git a/src/frontend/Finding-Neno/App.js b/src/frontend/Finding-Neno/App.js index c9c217b..aeda801 100644 --- a/src/frontend/Finding-Neno/App.js +++ b/src/frontend/Finding-Neno/App.js @@ -72,7 +72,7 @@ export default function App() { - + diff --git a/src/frontend/Finding-Neno/Pages/DashboardPage.jsx b/src/frontend/Finding-Neno/Pages/DashboardPage.jsx index b51c23c..4fc821e 100644 --- a/src/frontend/Finding-Neno/Pages/DashboardPage.jsx +++ b/src/frontend/Finding-Neno/Pages/DashboardPage.jsx @@ -154,7 +154,7 @@ const DashboardPage = () => { initialLayout={{ width: WINDOW_WIDTH }} /> - navigation.navigate('Dashboard', { screen: 'New Missing Report' }), color: Color.NENO_BLUE, style: { backgroundColor: Color.FAINT_NENO_BLUE } }, { icon: 'magnify', label: 'New Sighting', onPress: () => navigation.navigate('Dashboard', { screen: 'New Sighting' }), color: Color.NENO_BLUE, style: { backgroundColor: Color.FAINT_NENO_BLUE } }, diff --git a/src/frontend/Finding-Neno/Pages/MapPage.jsx b/src/frontend/Finding-Neno/Pages/MapPage.jsx index caaf12e..5f7c2f5 100644 --- a/src/frontend/Finding-Neno/Pages/MapPage.jsx +++ b/src/frontend/Finding-Neno/Pages/MapPage.jsx @@ -381,12 +381,12 @@ export default function MapPage({ navigation: { navigate } }) { { - tabValue == "reports" ? {reports.length} reports in area : {sightings.length} sightings in area + tabValue == "reports" ? {reports.length} report{reports.length == 1 ? '' : 's'} in area : {sightings.length} sighting{sightings.length == 1 ? '' : 's'} in area } - navigate('New Missing Report'), color: Color.NENO_BLUE, style: { backgroundColor: Color.FAINT_NENO_BLUE } }, { icon: 'magnify', label: 'New Sighting', onPress: () => navigate('New Sighting'), color: Color.NENO_BLUE, style: { backgroundColor: Color.FAINT_NENO_BLUE } }, diff --git a/src/frontend/Finding-Neno/Pages/ReportsPage.jsx b/src/frontend/Finding-Neno/Pages/ReportsPage.jsx index 41130ea..d0a27d7 100644 --- a/src/frontend/Finding-Neno/Pages/ReportsPage.jsx +++ b/src/frontend/Finding-Neno/Pages/ReportsPage.jsx @@ -58,7 +58,7 @@ export default function ReportsPage({ navigation: { navigate } }) { - navigate('New Missing Report'), color: Color.NENO_BLUE, style: { backgroundColor: Color.FAINT_NENO_BLUE } }, { icon: 'magnify', label: 'New Sighting', onPress: () => navigate('New Sighting'), color: Color.NENO_BLUE, style: { backgroundColor: Color.FAINT_NENO_BLUE } }, diff --git a/src/frontend/Finding-Neno/Pages/SightingsPage.jsx b/src/frontend/Finding-Neno/Pages/SightingsPage.jsx index 3097453..c744caf 100644 --- a/src/frontend/Finding-Neno/Pages/SightingsPage.jsx +++ b/src/frontend/Finding-Neno/Pages/SightingsPage.jsx @@ -124,7 +124,7 @@ export default function SightingsPage({ navigation: { navigate } }) { initialLayout={{ width: WINDOW_WIDTH }} /> - navigate('New Missing Report'), color: Color.NENO_BLUE, style: { backgroundColor: Color.FAINT_NENO_BLUE } }, { icon: 'magnify', label: 'New Sighting', onPress: () => navigate('New Sighting'), color: Color.NENO_BLUE, style: { backgroundColor: Color.FAINT_NENO_BLUE } }, diff --git a/src/frontend/Finding-Neno/components/Reports/Report.js b/src/frontend/Finding-Neno/components/Reports/Report.js index 5c04be3..99d10f8 100644 --- a/src/frontend/Finding-Neno/components/Reports/Report.js +++ b/src/frontend/Finding-Neno/components/Reports/Report.js @@ -53,7 +53,7 @@ const Report = ({ report, userId }) => { }, [petName]); const message = - `Have you seen this missing pet? \n\nName: ${petName} \nSpecies: ${petSpecies} \nBreed: ${petBreed} \nLast seen ${lastSeen} around ${suburb} \nPet Image: ${petImage} ${reportDesc ? "Additional description: " + reportDesc : ""} \n\nIf you have seen this pet, please report your sighting on the Finding Neno app.` + `Have you seen this missing pet? \n\nName: ${petName} \nSpecies: ${petSpecies} \nBreed: ${petBreed} \nLast seen ${lastSeen} around ${suburb} \nPet Image: ${petImage} ${reportDesc ? "\nAdditional description: " + reportDesc : ""} \n\nIf you have seen this pet, please report your sighting on the Finding Neno app.` const closeImageModal = () => { setEnlargeImage(false); diff --git a/src/frontend/Finding-Neno/components/Reports/ReportsList.jsx b/src/frontend/Finding-Neno/components/Reports/ReportsList.jsx index 7df6aab..5bbb2e1 100644 --- a/src/frontend/Finding-Neno/components/Reports/ReportsList.jsx +++ b/src/frontend/Finding-Neno/components/Reports/ReportsList.jsx @@ -20,7 +20,7 @@ function ReportsList({reports, onRefresh, columns, userId}) { onRefresh={onListRefresh} refreshing={refreshing} ListEmptyComponent={There are no reports of missing pets.} - ListFooterComponent={Last updated {formatDateTimeDisplay(new Date())}} + ListFooterComponent={Last updated {formatDateTimeDisplay(new Date())}} /> ) } diff --git a/src/frontend/Finding-Neno/components/Shared/ImageHandler.jsx b/src/frontend/Finding-Neno/components/Shared/ImageHandler.jsx index 22ee87c..cd14908 100644 --- a/src/frontend/Finding-Neno/components/Shared/ImageHandler.jsx +++ b/src/frontend/Finding-Neno/components/Shared/ImageHandler.jsx @@ -141,7 +141,7 @@ const ImageHandler = ({ image, setImage, setIsButtonDisabled, isRequired, error { isUploading ? : image && - + setEnlargeImage(true)} underlayColor="#DDDDDD" style={{ borderRadius: 20 }}> pet sighting image diff --git a/src/frontend/Finding-Neno/components/Sightings/SightingsList.jsx b/src/frontend/Finding-Neno/components/Sightings/SightingsList.jsx index d1e695d..eae5ad6 100644 --- a/src/frontend/Finding-Neno/components/Sightings/SightingsList.jsx +++ b/src/frontend/Finding-Neno/components/Sightings/SightingsList.jsx @@ -19,7 +19,7 @@ function SightingsList({sightings, onRefresh, columns, emptyText}) { refreshing={refreshing} ListEmptyComponent={{emptyText}} - ListFooterComponent={Last updated {formatDateTimeDisplay(new Date())}} + ListFooterComponent={Last updated {formatDateTimeDisplay(new Date())}} /> ) } diff --git a/src/frontend/Finding-Neno/package-lock.json b/src/frontend/Finding-Neno/package-lock.json index 3291cff..09047c8 100644 --- a/src/frontend/Finding-Neno/package-lock.json +++ b/src/frontend/Finding-Neno/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "dependencies": { "@react-native-async-storage/async-storage": "^1.17.11", - "@react-native-community/datetimepicker": "6.7.3", + "@react-native-community/datetimepicker": "7.2.0", "@react-native-community/masked-view": "^0.1.11", "@react-native-picker/picker": "2.4.8", "@react-navigation/bottom-tabs": "^6.5.7", @@ -5779,9 +5779,9 @@ } }, "node_modules/@react-native-community/datetimepicker": { - "version": "6.7.3", - "resolved": "https://registry.npmjs.org/@react-native-community/datetimepicker/-/datetimepicker-6.7.3.tgz", - "integrity": "sha512-fXWbEdHMLW/e8cts3snEsbOTbnFXfUHeO2pkiDFX3fWpFoDtUrRWvn50xbY13IJUUKHDhoJ+mj24nMRVIXfX1A==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@react-native-community/datetimepicker/-/datetimepicker-7.2.0.tgz", + "integrity": "sha512-dO1sQy83M/EvnHE2egto05iwXZX7EYn5f/VDMp6afZFRFXRiRo7CzB3VFg4B55gJRJMNBv06NYMLPM3SlpnEGQ==", "dependencies": { "invariant": "^2.2.4" } diff --git a/src/frontend/Finding-Neno/package.json b/src/frontend/Finding-Neno/package.json index 9f2f7ed..b106af0 100644 --- a/src/frontend/Finding-Neno/package.json +++ b/src/frontend/Finding-Neno/package.json @@ -10,7 +10,7 @@ }, "dependencies": { "@react-native-async-storage/async-storage": "^1.17.11", - "@react-native-community/datetimepicker": "6.7.3", + "@react-native-community/datetimepicker": "7.2.0", "@react-native-community/masked-view": "^0.1.11", "@react-native-picker/picker": "2.4.8", "@react-navigation/bottom-tabs": "^6.5.7", diff --git a/src/frontend/Finding-Neno/patches/native-base+3.4.28.patch b/src/frontend/Finding-Neno/patches/native-base+3.4.28.patch new file mode 100644 index 0000000..1246302 --- /dev/null +++ b/src/frontend/Finding-Neno/patches/native-base+3.4.28.patch @@ -0,0 +1,21 @@ +diff --git a/node_modules/native-base/src/core/NativeBaseProvider.tsx b/node_modules/native-base/src/core/NativeBaseProvider.tsx +index 43b4bd1..dd1329c 100644 +--- a/node_modules/native-base/src/core/NativeBaseProvider.tsx ++++ b/node_modules/native-base/src/core/NativeBaseProvider.tsx +@@ -4,7 +4,6 @@ import { + Metrics, + initialWindowMetrics as defaultInitialWindowMetrics, + } from 'react-native-safe-area-context'; +-import { SSRProvider } from '@react-native-aria/utils'; + import { theme as defaultTheme, ITheme } from './../theme'; + import type { IColorModeProviderProps } from './color-mode'; + import HybridProvider from './hybrid-overlay/HybridProvider'; +@@ -94,7 +93,7 @@ const NativeBaseProvider = (props: NativeBaseProviderProps) => { + + + +- {children} ++ {children} + + +