-
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.
Start handling mobile auth workflows
- Loading branch information
1 parent
0244aac
commit a8033ca
Showing
27 changed files
with
373 additions
and
137 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,21 +1,7 @@ | ||
import { NavigationContainer } from '@react-navigation/native'; | ||
import { createNativeStackNavigator } from '@react-navigation/native-stack'; | ||
import { observer } from 'mobx-react-lite'; | ||
import { Routes } from './Routes'; | ||
|
||
import { AboutScreen } from '../screens/AboutScreen'; | ||
import { HomeScreen } from '../screens/HomeScreen'; | ||
|
||
const Stack = createNativeStackNavigator(); | ||
|
||
const App = observer(() => { | ||
return ( | ||
<NavigationContainer> | ||
<Stack.Navigator initialRouteName="Home"> | ||
<Stack.Screen name="Home" component={HomeScreen} /> | ||
<Stack.Screen name="About" component={AboutScreen} /> | ||
</Stack.Navigator> | ||
</NavigationContainer> | ||
); | ||
}); | ||
const App = () => { | ||
return <Routes />; | ||
}; | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { NavigationContainer } from '@react-navigation/native'; | ||
import { createNativeStackNavigator } from '@react-navigation/native-stack'; | ||
import { AuthStoreContext } from '@rufferal-frontend/store'; | ||
import { useContext } from 'react'; | ||
import { AboutScreen } from '../screens/AboutScreen'; | ||
import { DashboardScreen } from '../screens/DashboardScreen'; | ||
import { HomeScreen } from '../screens/HomeScreen'; | ||
import { ProfileScreen } from '../screens/ProfileScreen'; | ||
|
||
const Stack = createNativeStackNavigator(); | ||
|
||
export const Routes = () => { | ||
const authStore = useContext(AuthStoreContext); | ||
|
||
return ( | ||
<NavigationContainer> | ||
{/* <Stack.Navigator screenOptions={{ headerShown: false }}> */} | ||
<Stack.Navigator> | ||
{authStore.isLoggedIn ? ( | ||
<> | ||
{/* My Profile - Owner */} | ||
{/* AuthedSearchServices */} | ||
{/* Pet Profiles + Care Plans */} | ||
{/* Bookings */} | ||
{/* Messaging */} | ||
{/* Account Settings */} | ||
{/* My Profile - Caretaker */} | ||
{/* AuthedSearchGigs */} | ||
<Stack.Screen name="Dashboard" component={DashboardScreen} /> | ||
<Stack.Screen name="Profile" component={ProfileScreen} /> | ||
</> | ||
) : ( | ||
<> | ||
{/* Onboarding */} | ||
{/* Login + Social Login */} | ||
{/* SearchServices */} | ||
{/* Sign Up */} | ||
{/* SearchGigs */} | ||
<Stack.Screen name="Home" component={HomeScreen} /> | ||
<Stack.Screen name="About" component={AboutScreen} /> | ||
</> | ||
)} | ||
</Stack.Navigator> | ||
</NavigationContainer> | ||
); | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { RDashboard } from '@rufferal-frontend/store'; | ||
|
||
export const DashboardScreen = () => { | ||
return <RDashboard />; | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { RProfile } from '@rufferal-frontend/store'; | ||
|
||
export const ProfileScreen = () => { | ||
return <RProfile />; | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { RDashboard } from '@rufferal-frontend/store'; | ||
import { ProtectedRoute } from './ProtectedRoutes'; | ||
|
||
export const Dashboard = () => { | ||
return ( | ||
<ProtectedRoute> | ||
<RDashboard /> | ||
</ProtectedRoute> | ||
); | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { RProfile } from '@rufferal-frontend/store'; | ||
import { ProtectedRoute } from './ProtectedRoutes'; | ||
|
||
export const Profile = () => { | ||
return ( | ||
<ProtectedRoute> | ||
<RProfile /> | ||
</ProtectedRoute> | ||
); | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,5 @@ | ||
import { RAbout } from '@rufferal-frontend/store'; | ||
import { ProtectedRoute } from './ProtectedRoutes'; | ||
|
||
export const About = () => { | ||
return ( | ||
<ProtectedRoute> | ||
<RAbout /> | ||
</ProtectedRoute> | ||
); | ||
return <RAbout />; | ||
}; |
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,3 +1,5 @@ | ||
export { About } from './About'; | ||
export { Dashboard } from './Dashboard'; | ||
export { Home } from './Home'; | ||
export { Profile } from './Profile'; | ||
export { ProtectedRoute } from './ProtectedRoutes'; |
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
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.