Skip to content

Commit

Permalink
refactor(router): replace push with navigate for consistent routing
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert27 committed Dec 10, 2024
1 parent 5406bb2 commit 66be9f2
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ android {
applicationId 'app.neuland'
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 253
versionCode 254
versionName "0.11.0"
}
signingConfigs {
Expand Down
2 changes: 1 addition & 1 deletion app.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"android": {
"package": "app.neuland",
"userInterfaceStyle": "automatic",
"versionCode": 253
"versionCode": 254
},
"sdkVersion": "52.0.0",
"experiments": {
Expand Down
Binary file modified bun.lockb
Binary file not shown.
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@maplibre/maplibre-react-native": "10.0.0-alpha.28",
"@react-native-community/datetimepicker": "8.2.0",
"@react-native-community/netinfo": "11.4.1",
"@react-navigation/native": "^7.0.13",
"@react-navigation/native": "^7.0.0",
"@react-navigation/stack": "^7.0.18",
"@shopify/flash-list": "1.7.1",
"@tanstack/query-sync-storage-persister": "^5.62.3",
Expand All @@ -41,7 +41,7 @@
"@th3rdwave/react-navigation-bottom-sheet": "0.3.2",
"burnt": "^0.12.2",
"color": "^4.2.3",
"expo": "~52.0.17",
"expo": "~52.0.18",
"expo-alternate-app-icons": "^1.1.0",
"expo-application": "~6.0.1",
"expo-blur": "~14.0.1",
Expand All @@ -54,12 +54,12 @@
"expo-linear-gradient": "~14.0.1",
"expo-local-authentication": "~15.0.1",
"expo-localization": "~16.0.0",
"expo-navigation-bar": "~4.0.5",
"expo-router": "~4.0.11",
"expo-navigation-bar": "~4.0.6",
"expo-router": "~4.0.12",
"expo-screen-orientation": "~8.0.1",
"expo-secure-store": "~14.0.0",
"expo-splash-screen": "~0.29.16",
"expo-system-ui": "~4.0.5",
"expo-splash-screen": "~0.29.18",
"expo-system-ui": "~4.0.6",
"fuse.js": "^7.0.0",
"graphql": "^16.9.0",
"i18next": "^23.16.8",
Expand All @@ -70,7 +70,7 @@
"react-content-loader": "^7.0.2",
"react-dom": "18.3.1",
"react-i18next": "^15.1.4",
"react-native": "0.76.3",
"react-native": "0.76.5",
"react-native-calendars": "^1.1307.0",
"react-native-collapsible": "1.6.1",
"react-native-context-menu-view": "^1.16.0",
Expand All @@ -82,7 +82,7 @@
"react-native-mmkv": "^3.1.0",
"react-native-pager-view": "6.5.1",
"react-native-paper": "5.12.5",
"react-native-reanimated": "~3.16.4",
"react-native-reanimated": "~3.16.5",
"react-native-reanimated-carousel": "^3.5.1",
"react-native-safe-area-context": "4.12.0",
"react-native-screens": "~4.1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/app/(screens)/calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default function CalendarPage(): JSX.Element {
gcTime: 1000 * 60 * 60 * 24, // 24 hours
retry(failureCount, error) {
if (error instanceof NoSessionError) {
router.push('/login')
router.navigate('/login')
return false
}
return failureCount < 2
Expand Down
4 changes: 2 additions & 2 deletions src/app/(screens)/foodPreferences.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ export default function FoodPreferences(): JSX.Element {
title: t('preferences.formlist.allergens'),
icon: chevronIcon,
onPress: () => {
router.push('/foodAllergens')
router.navigate('/foodAllergens')
},
},
{
title: t('preferences.formlist.flags'),
icon: chevronIcon,
onPress: () => {
router.push('/foodFlags')
router.navigate('/foodFlags')
},
},
],
Expand Down
2 changes: 1 addition & 1 deletion src/app/(screens)/lecture.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default function TimetableDetails(): JSX.Element {
title: t(titleKey),
icon: chevronIcon,
onPress: () => {
router.push({
router.navigate({
pathname: '/webView',
params: {
title: t(titleKey),
Expand Down
2 changes: 1 addition & 1 deletion src/app/(screens)/lecturers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default function LecturersCard(): JSX.Element {
gcTime: 1000 * 60 * 60 * 24 * 7, // 7 days
retry(failureCount: number, error: any) {
if (error instanceof NoSessionError) {
router.push('/login')
router.navigate('/login')
return false
}
return failureCount < 2
Expand Down
2 changes: 1 addition & 1 deletion src/app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ function RootLayout(): JSX.Element {
headerRight: () => (
<Pressable
onPress={() => {
router.push('/libraryCode')
router.navigate('/libraryCode')
}}
accessibilityLabel={t('button.libraryBarcode', {
ns: 'accessibility',
Expand Down
8 changes: 4 additions & 4 deletions src/components/Dashboard/HeaderRight.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -235,18 +235,18 @@ export const IndexHeaderRight = (): JSX.Element => {
]}
onPress={(e) => {
if (e.nativeEvent.name === t('navigation.profile')) {
router.push('/profile')
router.navigate('/profile')
} else if (e.nativeEvent.name === t('navigation.accent')) {
router.push('/accent')
router.navigate('/accent')
} else if (e.nativeEvent.name === t('navigation.about')) {
router.push('/about')
router.navigate('/about')
} else if (e.nativeEvent.name === 'Logout') {
logoutAlert()
} else if (
e.nativeEvent.name ===
t('menu.guest.title', { ns: 'settings' })
) {
router.push('/login')
router.navigate('/login')
}
}}
onPreviewPress={() => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Food/AllergensBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const AllergensBanner = ({
<View>
<TouchableOpacity
onPress={() => {
router.push('/foodAllergens')
router.navigate('/foodAllergens')
}}
>
<Text style={styles.bannerTitle}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Food/HeaderRight.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const FoodHeaderRight = (): JSX.Element => {
return (
<Pressable
onPress={() => {
router.push('/foodPreferences')
router.navigate('/foodPreferences')
}}
hitSlop={10}
style={styles.headerButton}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Food/MealEntry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const MealEntry = ({

const itemPressed = (): void => {
setSelectedMeal(meal)
router.push({
router.navigate({
pathname: '/meal',
})
}
Expand Down

0 comments on commit 66be9f2

Please sign in to comment.