From ae214a125b20bfc8dce00357c747c2259c045f4d Mon Sep 17 00:00:00 2001 From: isaacwsolomon <isaacwsolomon@gmail.com> Date: Sun, 11 May 2025 20:37:28 +0200 Subject: [PATCH] Created details page and button to navigate to the page --- App.tsx | 3 +++ app/screens/Details.tsx | 12 ++++++++++++ app/screens/list.tsx | 5 +++-- 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 app/screens/Details.tsx diff --git a/App.tsx b/App.tsx index ea7f797..d87bbf4 100644 --- a/App.tsx +++ b/App.tsx @@ -2,7 +2,9 @@ import { StatusBar } from 'expo-status-bar'; import { StyleSheet, Text, View } from 'react-native'; import { createNativeStackNavigator } from '@react-navigation/native-stack'; import { NavigationContainer } from '@react-navigation/native'; + import List from './app/screens/list'; +import Details from './app/screens/Details'; const Stack = createNativeStackNavigator(); @@ -12,6 +14,7 @@ export default function App() { <NavigationContainer> <Stack.Navigator> <Stack.Screen name="My Todos" component={List}/> + <Stack.Screen name="Details" component={Details}/> </Stack.Navigator> </NavigationContainer> ); diff --git a/app/screens/Details.tsx b/app/screens/Details.tsx new file mode 100644 index 0000000..6a88f08 --- /dev/null +++ b/app/screens/Details.tsx @@ -0,0 +1,12 @@ +import { View, Text } from 'react-native' +import React from 'react' + +const Details = () => { + return ( + <View> + <Text>Details</Text> + </View> + ) +} + +export default Details \ No newline at end of file diff --git a/app/screens/list.tsx b/app/screens/list.tsx index 7f97d85..2c909ef 100644 --- a/app/screens/list.tsx +++ b/app/screens/list.tsx @@ -1,11 +1,12 @@ import React from 'react'; -import { View, Text } from 'react-native'; +import { View, Text, Button } from 'react-native'; -const List = () => { +const List = ({navigation} : any) => { return ( <View> <Text>List</Text> + <Button onPress={() => navigation.navigate('Details')} title="Open Details"/> </View> ); }; -- GitLab