-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add welcome screen * get the token if it existed * redirect to log in if not * get user data and send to app file - add render propse to the routes insted of send the component beside send the client data inside component #25
- Loading branch information
1 parent
37968c7
commit df8fdf4
Showing
12 changed files
with
286 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,87 @@ | ||
import React from 'react'; | ||
import { NativeRouter, Route } from 'react-router-native'; | ||
import React, { useState } from 'react'; | ||
import { NativeRouter, Route, useHistory } from 'react-router-native'; | ||
import HomeScreen from './screens/Home'; | ||
import Login from './screens/signIn'; | ||
import SignUp from './screens/SignUp'; | ||
import SearchScreen from './screens/Search'; | ||
import FavoritesScreen from './screens/Favorites'; | ||
import OrdersScreen from './screens/Orders'; | ||
import ProfileScreen from './screens/Profile'; | ||
// import BottomTabBar from './components/BottomTabBar'; | ||
import WelcomePage from './screens/Welcome'; | ||
import BottomTabBar from './components/BottomTabBar'; | ||
|
||
const App = () => { | ||
const [clientData, setClientData] = useState(); | ||
|
||
export default function App() { | ||
return ( | ||
<NativeRouter> | ||
<Route exact path='/' component={Login} /> | ||
<Route exact path='/signup' component={SignUp} /> | ||
<Route exact path='/home' component={HomeScreen} /> | ||
<Route exact path='/search' component={SearchScreen} /> | ||
<Route exact path='/favorites' component={FavoritesScreen} /> | ||
<Route exact path='/orders' component={OrdersScreen} /> | ||
<Route exact path='/profile' component={ProfileScreen} /> | ||
{/* <BottomTabBar /> */} | ||
<Route | ||
exact | ||
path='/' | ||
render={() => <WelcomePage setClientData={setClientData} />} | ||
/> | ||
<Route | ||
exact | ||
path='/login' | ||
render={() => <Login setClientData={setClientData} />} | ||
/> | ||
<Route | ||
exact | ||
path='/signup' | ||
render={() => <SignUp setClientData={setClientData} />} | ||
/> | ||
<Route | ||
exact | ||
path='/home' | ||
render={() => ( | ||
<> | ||
<HomeScreen clientData={clientData} /> | ||
<BottomTabBar tab={0} /> | ||
</> | ||
)} | ||
/> | ||
<Route | ||
exact | ||
path='/search' | ||
render={() => ( | ||
<> | ||
<SearchScreen clientData={clientData} /> | ||
<BottomTabBar tab={1} /> | ||
</> | ||
)} | ||
/> | ||
<Route | ||
exact | ||
path='/favorites' | ||
render={() => ( | ||
<> | ||
<FavoritesScreen clientData={clientData} /> | ||
<BottomTabBar tab={2} /> | ||
</> | ||
)} | ||
/> | ||
<Route | ||
exact | ||
path='/orders' | ||
render={() => ( | ||
<> | ||
<OrdersScreen clientData={clientData} /> | ||
<BottomTabBar tab={3} /> | ||
</> | ||
)} | ||
/> | ||
<Route | ||
exact | ||
path='/profile' | ||
render={() => ( | ||
<> | ||
<ProfileScreen clientData={clientData} /> | ||
<BottomTabBar tab={4} /> | ||
</> | ||
)} | ||
/> | ||
</NativeRouter> | ||
); | ||
} | ||
}; | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.