Skip to content

Commit

Permalink
Merge pull request #1 from calblueprint/charlottelaw/jdi-10-home-page…
Browse files Browse the repository at this point in the history
…-navigation

App Routing
  • Loading branch information
philipye314 authored Oct 6, 2024
2 parents 3518eff + 91a6613 commit ca5e439
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 17 deletions.
34 changes: 17 additions & 17 deletions App.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import { StyleSheet, Text, View } from 'react-native';
import { StatusBar } from 'expo-status-bar';
import Logo from '@/components/Logo';
import * as React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import HealingResources from '@/HealingResources';
import Home from '@/Home';
import LegalRights from '@/LegalRights';
import SeekHelp from '@/SeekHelp';

const Stack = createNativeStackNavigator();

export default function App() {
return (
<View style={styles.container}>
<Logo />
<Text>Open up App.tsx to start working on your app!</Text>
<StatusBar style="auto" />
</View>
<NavigationContainer independent={true}>
<Stack.Navigator initialRouteName="Home">
<Stack.Screen name="Home" component={Home} />
<Stack.Screen name="Healing Resources" component={HealingResources} />
<Stack.Screen name="Legal Rights" component={LegalRights} />
<Stack.Screen name="Seek Help" component={SeekHelp} />
</Stack.Navigator>
</NavigationContainer>
);
}

const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});
32 changes: 32 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
},
"dependencies": {
"@react-navigation/native": "^6.1.18",
"@react-navigation/native-stack": "^6.11.0",
"@supabase/supabase-js": "^2.45.4",
"expo": "~51.0.21",
"expo-status-bar": "~1.12.1",
Expand Down
5 changes: 5 additions & 0 deletions src/HealingResources/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Text } from 'react-native';

export default function HealingResources() {
return <Text>hello</Text>;
}
21 changes: 21 additions & 0 deletions src/Home/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Button, Text, View } from 'react-native';

export default function Home({ navigation }) {
return (
<View>
<Text>hello</Text>
<Button
title="Healing Resources"
onPress={() => navigation.navigate('Healing Resources')}
/>
<Button
title="Legal Rights"
onPress={() => navigation.navigate('Legal Rights')}
/>
<Button
title="Seek Help"
onPress={() => navigation.navigate('Seek Help')}
/>
</View>
);
}
5 changes: 5 additions & 0 deletions src/LegalRights/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Text } from 'react-native';

export default function LegalRights() {
return <Text>LEGAL RIGHTS!!</Text>;
}
5 changes: 5 additions & 0 deletions src/SeekHelp/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Text } from 'react-native';

export default function SeekHelp() {
return <Text>SEEK HELP!</Text>;
}

0 comments on commit ca5e439

Please sign in to comment.