Major refactoring: navigation does not break anymore. the user can now navigate between the tabs without loosing context

This commit is contained in:
Jakob Stornig 2024-01-20 11:54:25 +01:00
parent 457b098883
commit 1beee68bff
23 changed files with 137 additions and 80 deletions

40
app/expense/_layout.tsx Normal file
View file

@ -0,0 +1,40 @@
import { StyleSheet, Text, View } from 'react-native'
import { Stack } from 'expo-router'
import React from 'react'
import { useTheme } from '../contexts/ThemeContext'
const _layout = () => {
const {colors} = useTheme();
return (
<Stack
initialRouteName="new"
screenOptions={{
contentStyle: {
backgroundColor:colors.containerColor,
},
headerStyle: {
backgroundColor: colors.containerColor
},
headerTintColor: colors.primaryText
}}>
<Stack.Screen name='new'
options={{
title: "New Expense"
}}
/>
<Stack.Screen name="[expense]"
options={{
headerBackButtonMenuEnabled: true,
headerBackVisible: true,
title: "edit Expense"
}}
getId={(params) => String(Date.now())}
/>
</Stack>
)
}
export default _layout
const styles = StyleSheet.create({})