Skip to content

Commit

Permalink
replaced stack with tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderWangY committed Mar 2, 2024
1 parent 5ab06ab commit 7daf4ba
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 10 deletions.
8 changes: 7 additions & 1 deletion client/package-lock.json

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

3 changes: 2 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
"react-native-uuid": "^2.0.1",
"react-native-web": "~0.19.6",
"socket.io-client": "^4.7.4",
"expo-network": "~5.4.0"
"expo-network": "~5.4.0",
"undefined": "@expo/vector-icons/FontAwesome"
},
"devDependencies": {
"@babel/core": "^7.20.0",
Expand Down
26 changes: 18 additions & 8 deletions client/src/app/(home)/_layout.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,33 @@
import React from "react";
import { Stack } from "expo-router";
import { Stack, Tabs } from "expo-router";
import { SettingsProvider } from "../../contexts/SettingsContext";
import { SocketProvider } from "../../contexts/SocketContext";
import { LocationProvider } from "../../contexts/LocationContext";
import { UserProvider } from "../../contexts/UserContext";
import FontAwesome from "@expo/vector-icons/FontAwesome";

const AuthLayout = () => {
return (
<LocationProvider>
<SocketProvider>
<UserProvider>
<SettingsProvider>
<Stack
screenOptions={{
headerShown: false,
}}
>
<Stack.Screen name="chatchannel" options={{}} />
</Stack>
<Tabs screenOptions={{ tabBarActiveTintColor: 'blue' }}>
<Tabs.Screen
name="chatchannel"
options={{
title: 'Chat',
tabBarIcon: ({ color }) => <FontAwesome size={28} name="home" color={color} />,
}}
/>
<Tabs.Screen
name="settings"
options={{
title: 'Settings',
tabBarIcon: ({ color }) => <FontAwesome size={28} name="cog" color={color} />,
}}
/>
</Tabs>
</SettingsProvider>
</UserProvider>
</SocketProvider>
Expand Down
11 changes: 11 additions & 0 deletions client/src/app/(home)/settings.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react'
import { View, Text, StyleSheet } from 'react-native';
import SettingsScreen from '../../components/Settings/SettingsScreen';

const SettingsPage = () => {
return (
<SettingsScreen />
)
}

export default SettingsPage;

0 comments on commit 7daf4ba

Please sign in to comment.