Skip to content

Commit

Permalink
Fix native base warning and various other bugs (#100)
Browse files Browse the repository at this point in the history
Co-authored-by: Josiah S <[email protected]>
  • Loading branch information
vincent-wijaya and josiahschuller authored Oct 17, 2023
1 parent ac9f4ec commit c184ba7
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/frontend/Finding-Neno/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default function App() {
<NativeBaseProvider>
<Provider store={store}>
<NavigationContainer theme={scheme === 'dark' ? FindingNenoDarkTheme : FindingNenoLightTheme}>
<StatusBar style='auto' backgroundColor='transparent' translucent />
<StatusBar style='auto'/>
<MainNavigator />
</NavigationContainer>
</Provider>
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/Finding-Neno/Pages/DashboardPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ const DashboardPage = () => {
initialLayout={{ width: WINDOW_WIDTH }}
/>
<Portal>
<FAB.Group color='white' fabStyle={{ backgroundColor: Color.LIGHTER_NENO_BLUE, bottom: -33 }} icon={open ? "close" : "plus"} open={open} visible onStateChange={onStateChange}
<FAB.Group color='white' fabStyle={{ backgroundColor: Color.LIGHTER_NENO_BLUE }} icon={open ? "close" : "plus"} open={open} visible onStateChange={onStateChange}
actions={[
{ icon: 'file-document', label: 'New Missing Report', onPress: () => 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 } },
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/Finding-Neno/Pages/MapPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -381,12 +381,12 @@ export default function MapPage({ navigation: { navigate } }) {
</Button>
<View style={{ marginTop: 5 }}>
{
tabValue == "reports" ? <Text style={styles.boldText}> {reports.length} reports in area</Text> : <Text style={styles.boldText}> {sightings.length} sightings in area</Text>
tabValue == "reports" ? <Text style={styles.boldText}> {reports.length} report{reports.length == 1 ? '' : 's'} in area</Text> : <Text style={styles.boldText}> {sightings.length} sighting{sightings.length == 1 ? '' : 's'} in area</Text>
}
</View>
</View>
<Portal>
<FAB.Group color='white' fabStyle={{ backgroundColor: Color.LIGHTER_NENO_BLUE, bottom: -33 }} icon={open ? "close" : "plus"} open={open} visible onStateChange={onStateChange}
<FAB.Group color='white' fabStyle={{ backgroundColor: Color.LIGHTER_NENO_BLUE }} icon={open ? "close" : "plus"} open={open} visible onStateChange={onStateChange}
actions={[
{ icon: 'file-document', label: 'New Missing Report', onPress: () => 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 } },
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/Finding-Neno/Pages/ReportsPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default function ReportsPage({ navigation: { navigate } }) {
<ReportsList reports={reports} onRefresh={onRefresh} userId={USER_ID}/>
</View>
<Portal>
<FAB.Group color='white' fabStyle={{ backgroundColor: Color.LIGHTER_NENO_BLUE, bottom: -33 }} icon={open ? "close" : "plus"} open={open} visible onStateChange={onStateChange}
<FAB.Group color='white' fabStyle={{ backgroundColor: Color.LIGHTER_NENO_BLUE }} icon={open ? "close" : "plus"} open={open} visible onStateChange={onStateChange}
actions={[
{ icon: 'file-document', label: 'New Missing Report', onPress: () => 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 } },
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/Finding-Neno/Pages/SightingsPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export default function SightingsPage({ navigation: { navigate } }) {
initialLayout={{ width: WINDOW_WIDTH }}
/>
<Portal>
<FAB.Group color='white' fabStyle={{ backgroundColor: Color.LIGHTER_NENO_BLUE, bottom: -33 }} icon={open ? "close" : "plus"} open={open} visible onStateChange={onStateChange}
<FAB.Group color='white' fabStyle={{ backgroundColor: Color.LIGHTER_NENO_BLUE }} icon={open ? "close" : "plus"} open={open} visible onStateChange={onStateChange}
actions={[
{ icon: 'file-document', label: 'New Missing Report', onPress: () => 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 } },
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/Finding-Neno/components/Reports/Report.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function ReportsList({reports, onRefresh, columns, userId}) {
onRefresh={onListRefresh}
refreshing={refreshing}
ListEmptyComponent={<Text style={{ paddingTop: 30, fontSize: 15, fontWeight: '700', alignSelf: 'center'}}>There are no reports of missing pets.</Text>}
ListFooterComponent={<Text style={{ paddingTop: 30, fontSize: 15, fontWeight: '700', alignSelf: 'center'}}>Last updated {formatDateTimeDisplay(new Date())}</Text>}
ListFooterComponent={<Text style={{ paddingVertical: 30, fontSize: 15, fontWeight: '700', alignSelf: 'center'}}>Last updated {formatDateTimeDisplay(new Date())}</Text>}
/>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ const ImageHandler = ({ image, setImage, setIsButtonDisabled, isRequired, error
{
isUploading ? <ActivityIndicator /> :
image &&
<View borderRadius={"10%"} alignItems={"center"}>
<View borderRadius={0.1} alignItems={"center"}>
<TouchableHighlight onPress={() => setEnlargeImage(true)} underlayColor="#DDDDDD" style={{ borderRadius: 20 }}>
<Image source={{ uri: image }} style={{ width: "100%", aspectRatio: "1", borderRadius: 10 }} alt='pet sighting image' />
</TouchableHighlight>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function SightingsList({sightings, onRefresh, columns, emptyText}) {
refreshing={refreshing}

ListEmptyComponent={<Text style={{ paddingTop: 30, fontSize: 15, fontWeight: '700', alignSelf: 'center'}}>{emptyText}</Text>}
ListFooterComponent={<Text style={{ paddingTop: 30, fontSize: 15, fontWeight: '700' , alignSelf: 'center'}}>Last updated {formatDateTimeDisplay(new Date())}</Text>}
ListFooterComponent={<Text style={{ paddingVertical: 30, fontSize: 15, fontWeight: '700' , alignSelf: 'center'}}>Last updated {formatDateTimeDisplay(new Date())}</Text>}
/>
)
}
Expand Down
8 changes: 4 additions & 4 deletions src/frontend/Finding-Neno/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/frontend/Finding-Neno/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
21 changes: 21 additions & 0 deletions src/frontend/Finding-Neno/patches/native-base+3.4.28.patch
Original file line number Diff line number Diff line change
@@ -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) => {
<OverlayProvider isSSR>
<ToastProvider>
<InitializeToastRef />
- <SSRProvider>{children}</SSRProvider>
+ {children}
</ToastProvider>
</OverlayProvider>
</HybridProvider>

0 comments on commit c184ba7

Please sign in to comment.