diff --git a/client/App.tsx b/client/App.tsx index 2fdfb75..e266d1b 100644 --- a/client/App.tsx +++ b/client/App.tsx @@ -1,23 +1,45 @@ import * as React from 'react'; -import { View, Text } from 'react-native'; -import { getAllMedications } from './services/medication'; -import UnionSvg from './assets/Union.svg'; +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 Medication from './screens/Medication'; +import Home from './assets/home.svg'; +export type ScreenNames = ['BottomNav', 'Landing']; +export type RootStackParamList = Record; +export type StackNavigation = NavigationProp; + +const Stack = createNativeStackNavigator(); +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() { - const [medications, setMedications] = React.useState(); - React.useEffect(() => { - getAllMedications().then((med) => setMedications(med)); - }, []); - // Adding the UnionSvg component here to show that it's able to be displayed here return ( - - {medications && - medications.map((med, index) => ( - - {`Name: ${med.medication_name} id: ${med.medication_id}`} - - ))} - - + + + + + + ); +} + +function Tabs() { + return ( + + , + tabBarLabel: () => Landing + }} + component={Medication} + /> + ); } diff --git a/client/assets/Union.svg b/client/assets/Union.svg deleted file mode 100644 index f4d58d2..0000000 --- a/client/assets/Union.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/client/assets/home.svg b/client/assets/home.svg new file mode 100644 index 0000000..1449ac4 --- /dev/null +++ b/client/assets/home.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/client/package.json b/client/package.json index bfc1a9f..d6d2357 100644 --- a/client/package.json +++ b/client/package.json @@ -11,15 +11,23 @@ "format": "prettier --write ." }, "dependencies": { + "@fortawesome/fontawesome-svg-core": "^6.5.1", + "@fortawesome/free-brands-svg-icons": "^6.5.1", + "@fortawesome/free-regular-svg-icons": "^6.5.1", + "@fortawesome/free-solid-svg-icons": "^6.5.1", + "@fortawesome/react-native-fontawesome": "^0.3.0", + "@react-navigation/bottom-tabs": "^6.5.11", "@react-navigation/native": "^6.1.9", + "@react-navigation/native-stack": "^6.9.17", "axios": "^1.6.4", "expo": "~49.0.15", "expo-status-bar": "~1.6.0", "nativewind": "^2.0.11", "react": "18.2.0", "react-native": "0.72.6", + "react-native-safe-area-context": "4.6.3", "react-native-screens": "~3.22.0", - "react-native-safe-area-context": "4.6.3" + "react-native-svg-transformer": "^1.3.0" }, "devDependencies": { "@babel/core": "^7.20.0", diff --git a/client/screens/Medication.tsx b/client/screens/Medication.tsx new file mode 100644 index 0000000..ecef132 --- /dev/null +++ b/client/screens/Medication.tsx @@ -0,0 +1,21 @@ +import * as React from 'react'; +import { View, Text } from 'react-native'; +import { getAllMedications } from '../services/medication'; + +export default function Medication() { + const [medications, setMedications] = React.useState(); + React.useEffect(() => { + getAllMedications().then((med) => setMedications(med)); + }, []); + + return ( + + {medications && + medications.map((med, index) => ( + + {`Name: ${med.medication_name} id: ${med.medication_id}`} + + ))} + + ); +}