Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Started migrating nav! #209

Merged
merged 2 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 38 additions & 6 deletions client/App.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,44 @@
import React from "react";
import { StyleSheet, View, Text } from "react-native";
import { AuthStore } from "./src/services/store";
import { NavigationContainer } from "@react-navigation/native";
import { createStackNavigator } from "@react-navigation/stack";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
import WelcomeScreen from "./src/components/Home/WelcomeScreen";
import SignUpScreen from "./src/components/Auth/SignUpScreen";
import LoginScreen from "./src/components/Auth/LoginScreen";
import ChatScreen from "./src/components/Chat/ChatScreen";
import SettingsScreen from "./src/components/Settings/SettingsScreen";

const Stack = createStackNavigator();
const Tab = createBottomTabNavigator();

const App = () => {
const { initialized, isLoggedin } = AuthStore.useState();

if (!initialized) return <Text>Loading...</Text>;

export default function App() {
return (
<View>
<Text>This Componenet is DEPRECATED.</Text>
<Text>DO NOT TOUCH. THE NEW ENTRY POINT IS AT 'app/index.tsx'</Text>
</View>
<NavigationContainer>
{isLoggedin ? (
<Tab.Navigator>
<Tab.Screen name="Home" component={ChatScreen} />
<Tab.Screen name="Settings" component={SettingsScreen} />
</Tab.Navigator>
) : (
<Stack.Navigator
screenOptions={{
headerShown: false,
}}
>
<Stack.Screen name="Welcome" component={WelcomeScreen} />
<Stack.Screen name="Login" component={SignUpScreen} />
<Stack.Screen name="Register" component={LoginScreen} />
</Stack.Navigator>
)}
</NavigationContainer>
);
}
};

const styles = StyleSheet.create({
container: {
Expand All @@ -18,3 +48,5 @@ const styles = StyleSheet.create({
justifyContent: "center",
},
});

export default App;
Loading
Loading