Skip to content

Commit

Permalink
fix: update navigation handling in login screen and adjust theme prov…
Browse files Browse the repository at this point in the history
…ider structure
  • Loading branch information
Robert27 committed Nov 18, 2024
1 parent b2115bc commit b0fc9b6
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 26 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 211
versionCode 212
versionName "0.10.2"
}
signingConfigs {
Expand Down
2 changes: 1 addition & 1 deletion app.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"android": {
"package": "app.neuland",
"userInterfaceStyle": "automatic",
"versionCode": 211
"versionCode": 212
},
"sdkVersion": "52.0.0",
"experiments": {
Expand Down
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion src/app/(screens)/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export default function Login(): JSX.Element {
router.replace('(tabs)/(index)')
return
}
router.navigate('(tabs)/(index)')
router.dismissAll()
}

useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {
export const unstable_settings = {
initialRouteName: '(index)',
}

function RootLayout(): JSX.Element {
const router = useRouter()
const { t } = useTranslation(['navigation'])
Expand Down Expand Up @@ -137,6 +136,7 @@ function RootLayout(): JSX.Element {
name="(screens)/settings"
options={{
title: t('navigation.settings'),
animation: 'fade',
}}
/>
<Stack.Screen
Expand Down
3 changes: 1 addition & 2 deletions src/components/Map/BottomSheetDetailModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export const BottomSheetDetailModal = ({
}}
android={{
name: 'expand_more',
size: 21,
size: 22,
}}
style={styles.xIcon(Platform.OS)}
/>
Expand Down Expand Up @@ -208,7 +208,6 @@ const stylesheet = createStyleSheet((theme) => ({
}),
xIcon: (platform) => ({
color: Color(theme.colors.text).darken(0.1).hex(),
marginRight: platform === 'android' ? 2 : 0,
marginTop: platform === 'ios' ? 1 : 0,
}),
}))
51 changes: 31 additions & 20 deletions src/components/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ import i18n from '@/localization/i18n'
import { syncStoragePersister } from '@/utils/storage'
import { trackEvent } from '@aptabase/react-native'
import { BottomSheetModalProvider } from '@gorhom/bottom-sheet'
import {
DarkTheme,
DefaultTheme,
ThemeProvider,
} from '@react-navigation/native'
import { QueryClient, focusManager } from '@tanstack/react-query'
import { PersistQueryClientProvider } from '@tanstack/react-query-persist-client'
import { useSegments } from 'expo-router'
Expand Down Expand Up @@ -269,27 +274,33 @@ export default function Provider({
client={queryClient}
persistOptions={{ persister: syncStoragePersister }}
>
<ThemeContext.Provider value={themeHook}>
<PreferencesContext.Provider value={preferences}>
<BottomSheetModalProvider>
<FlowContext.Provider value={flow}>
<UserKindContext.Provider value={userKind}>
<FoodFilterContext.Provider
value={foodFilter}
>
<DashboardContext.Provider
value={dashboard}
<ThemeProvider
value={
themeHook.theme === 'dark' ? DarkTheme : DefaultTheme
}
>
<ThemeContext.Provider value={themeHook}>
<PreferencesContext.Provider value={preferences}>
<BottomSheetModalProvider>
<FlowContext.Provider value={flow}>
<UserKindContext.Provider value={userKind}>
<FoodFilterContext.Provider
value={foodFilter}
>
<SafeAreaProvider>
{children}
</SafeAreaProvider>
</DashboardContext.Provider>
</FoodFilterContext.Provider>
</UserKindContext.Provider>
</FlowContext.Provider>
</BottomSheetModalProvider>
</PreferencesContext.Provider>
</ThemeContext.Provider>
<DashboardContext.Provider
value={dashboard}
>
<SafeAreaProvider>
{children}
</SafeAreaProvider>
</DashboardContext.Provider>
</FoodFilterContext.Provider>
</UserKindContext.Provider>
</FlowContext.Provider>
</BottomSheetModalProvider>
</PreferencesContext.Provider>
</ThemeContext.Provider>
</ThemeProvider>
</PersistQueryClientProvider>
</GestureHandlerRootView>
)
Expand Down

0 comments on commit b0fc9b6

Please sign in to comment.