Skip to content

Commit

Permalink
[feat] implement working bottom tab navigation between Cases and Prof…
Browse files Browse the repository at this point in the history
…ile pages.
  • Loading branch information
ronniebeggs committed Oct 7, 2023
1 parent f1b6516 commit 607640f
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 44 deletions.
2 changes: 1 addition & 1 deletion src/app/(BottomTabNavigation)/Cases/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import styles from './styles';
function CasesScreen() {
return (
<View style={styles.container}>
<Text>This is the cases screen!</Text>
<Text>This is the /Cases/index cases screen!</Text>
</View>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/(BottomTabNavigation)/Profile/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import styles from './styles';
function ProfileScreen() {
return (
<View style={styles.container}>
<Text>This is the profile screen!</Text>
<Text>This is the /Profile/index profile screen!</Text>
</View>
);
}
Expand Down
16 changes: 11 additions & 5 deletions src/app/(BottomTabNavigation)/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@ import { Tabs } from 'expo-router/tabs';

export default function AppLayout() {
return (
<Tabs initialRouteName="home" screenOptions={{ headerShown: false }}>
<Tabs screenOptions={{ headerShown: true }}>
<Tabs.Screen
name="home"
name="Cases"
options={{
href: '/home',
tabBarLabel: 'Home',
title: 'Home',
tabBarLabel: 'Cases',
title: 'Cases',
}}
/>
<Tabs.Screen
name="Profile"
options={{
tabBarLabel: 'Profile',
title: 'Profile',
}}
/>
</Tabs>
Expand Down
11 changes: 0 additions & 11 deletions src/app/(BottomTabNavigation)/home.tsx

This file was deleted.

Empty file.
4 changes: 1 addition & 3 deletions src/app/_layout.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { Stack } from 'expo-router';
// import AppLayout from './(BottomTabNavigation)/_layout';

export default function StackLayout() {
// return <AppLayout />;
return (
<Stack screenOptions={{ headerShown: true }}>
<Stack screenOptions={{ headerShown: false }}>
<Stack.Screen name="(BottomTabNavigation)" options={{}} />
</Stack>
);
Expand Down
27 changes: 4 additions & 23 deletions src/app/index.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,9 @@
import { Link } from 'expo-router';
import { Text, View } from 'react-native';
import { TouchableOpacity } from 'react-native-gesture-handler';
import styles from './styles';
// import { Text, View } from 'react-native';
// import styles from './styles';
import { Redirect } from 'expo-router';

function StartScreen() {
return (
<View style={styles.container}>
<Link href="/Welcome" asChild>
<TouchableOpacity style={styles.button}>
<Text>Welcome Screen</Text>
</TouchableOpacity>
</Link>
<Link href="/Cases" asChild>
<TouchableOpacity style={styles.button}>
<Text>Cases Screen</Text>
</TouchableOpacity>
</Link>
<Link href="/Profile" asChild>
<TouchableOpacity style={styles.button}>
<Text>Profile Screen</Text>
</TouchableOpacity>
</Link>
</View>
);
return <Redirect href="/(BottomTabNavigation)/Cases" />;
}

export default StartScreen;

0 comments on commit 607640f

Please sign in to comment.