-
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.
feat: add a user context provider to the app (#24)
* feat: userContext stuff idk man * refactor: general all around fixes (removing unused imports, fixing navigation errors) * refactor: all over the place with this commit, but added swagger docs for file upload * refactor: make context more general * refactor: utilize card and popup in the medlist FE
- Loading branch information
1 parent
97ffda1
commit 571f0a8
Showing
16 changed files
with
339 additions
and
170 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,17 @@ | ||
import * as React from 'react'; | ||
import { Text } from 'react-native'; | ||
import { createNativeStackNavigator } from '@react-navigation/native-stack'; | ||
import { NavigationContainer, NavigationProp } from '@react-navigation/native'; | ||
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'; | ||
import LoginPage from './screens/Login'; | ||
import MedList from './screens/Medication'; | ||
import Home from './assets/home.svg'; | ||
import DocPickerButton from './components/DocPickerButton'; | ||
import { SafeAreaView } from 'react-native-safe-area-context'; | ||
import Router from './navigation/Router'; | ||
import CareWalletProvider from './contexts/CareWalletContext'; | ||
import { PaperProvider } from 'react-native-paper'; | ||
|
||
export type ScreenNames = ['BottomNav', 'Landing', 'TEMP-FileUpload', 'Login']; | ||
export type RootStackParamList = Record<ScreenNames[number], any>; | ||
export type StackNavigation = NavigationProp<RootStackParamList>; | ||
|
||
const Stack = createNativeStackNavigator<RootStackParamList>(); | ||
const Tab = createBottomTabNavigator(); | ||
|
||
// TODO: figure out a way to do this better, I didnt enjoy this way of doing it in SaluTemp there HAS to be a better way | ||
export default function App() { | ||
return ( | ||
<NavigationContainer> | ||
<Stack.Navigator> | ||
<Stack.Screen | ||
name="Login" | ||
options={{ headerShown: true }} | ||
component={LoginPage} | ||
/> | ||
<Stack.Screen | ||
name="BottomNav" | ||
options={{ headerShown: false }} | ||
component={Tabs} | ||
/> | ||
<Stack.Screen | ||
name="TEMP-FileUpload" | ||
options={{ headerShown: true }} | ||
component={DocPickerButton} | ||
/> | ||
</Stack.Navigator> | ||
</NavigationContainer> | ||
); | ||
} | ||
|
||
function Tabs() { | ||
return ( | ||
<Tab.Navigator> | ||
<Tab.Screen | ||
name="Landing" | ||
options={{ | ||
headerShown: true, | ||
tabBarIcon: () => <Home color={'gray'} />, | ||
tabBarLabel: () => <Text>Landing</Text> | ||
}} | ||
component={MedList} | ||
/> | ||
</Tab.Navigator> | ||
<CareWalletProvider> | ||
<SafeAreaView className="flex-1"> | ||
<PaperProvider> | ||
<Router /> | ||
</PaperProvider> | ||
</SafeAreaView> | ||
</CareWalletProvider> | ||
); | ||
} |
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.