diff --git a/client/screens/MedicationList.tsx b/client/screens/MedicationList.tsx index ef1bd68..720ba93 100644 --- a/client/screens/MedicationList.tsx +++ b/client/screens/MedicationList.tsx @@ -15,11 +15,9 @@ export default function MedicationList() { const [newMedState, setNewMedState] = useState({ id: '', name: '' }); - const [medPopupVisible, setMedPopupVisible] = useState({ - medVisible: false, - newMedVisible: false, - userGroupVisible: false - }); + const [medVisible, setMedVisible] = useState(false); + const [newMedVisible, setNewMedVisible] = useState(false); + const [userGroupVisible, setUserGroupVisible] = useState(false); const { user, group } = useCareWalletContext(); @@ -42,29 +40,13 @@ export default function MedicationList() { return ( - - setMedPopupVisible({ - ...medPopupVisible, - medVisible: val - }) - } - > + {selectedMed?.medication_name} ID: {selectedMed?.medication_id} - - setMedPopupVisible({ - ...medPopupVisible, - newMedVisible: val - }) - } - > + ID: Add Medication @@ -103,12 +82,7 @@ export default function MedicationList() { - setMedPopupVisible({ - ...medPopupVisible, - newMedVisible: true - }) - } + onPress={() => setNewMedVisible(true)} > Add Medication @@ -120,10 +94,7 @@ export default function MedicationList() { title={med.medication_name} onPress={() => { setSelectedMed(med); - setMedPopupVisible({ - ...medPopupVisible, - medVisible: true - }); + setMedVisible(true); }} > - - setMedPopupVisible({ - ...medPopupVisible, - userGroupVisible: true - }) - } - > + setUserGroupVisible(true)}> Show User and Group Info - - setMedPopupVisible({ - ...medPopupVisible, - userGroupVisible: val - }) - } - > + User ID: {user.userID}