-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
396 additions
and
25 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
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,11 @@ | ||
import { View } from 'react-native'; | ||
|
||
import { Text } from './Text'; | ||
|
||
export const Chip = ({ text }: { text?: string }) => { | ||
return ( | ||
<View className="rounded-full bg-cyan-200 p-4"> | ||
<Text className="text-coolGray-700 text-xl">{text}</Text> | ||
</View> | ||
); | ||
}; |
41 changes: 41 additions & 0 deletions
41
apps/expo/src/components/molecules/AddEditDemographicsModal.tsx
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,41 @@ | ||
import { Modal } from 'react-native'; | ||
import { AutocompleteDropdownContextProvider } from 'react-native-autocomplete-dropdown'; | ||
|
||
import { type Patient } from '@careforge/canvas'; | ||
|
||
import { ScreenView } from '../molecules/ScreenView'; | ||
import { DemographicsForm, type DemographicsFormType } from '../organisms/DemographicsForm'; | ||
|
||
export const AddEditDemographicsModal = ({ | ||
isOpen, | ||
onSubmit, | ||
onClose, | ||
patient, | ||
isMutating, | ||
}: { | ||
patient: Patient; | ||
isOpen: boolean; | ||
onClose: () => void; | ||
onSubmit: (form: DemographicsFormType) => void; | ||
isMutating?: boolean; | ||
}) => { | ||
return ( | ||
<Modal | ||
animationType="slide" | ||
visible={isOpen} | ||
presentationStyle="pageSheet" | ||
onRequestClose={onClose} | ||
> | ||
<AutocompleteDropdownContextProvider> | ||
<ScreenView> | ||
<DemographicsForm | ||
onCancel={onClose} | ||
onSubmit={onSubmit} | ||
isMutating={isMutating} | ||
patient={patient} | ||
/> | ||
</ScreenView> | ||
</AutocompleteDropdownContextProvider> | ||
</Modal> | ||
); | ||
}; |
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,32 @@ | ||
import { Modal, ScrollView, View } from 'react-native'; | ||
import { AutocompleteDropdownContextProvider } from 'react-native-autocomplete-dropdown'; | ||
|
||
import { Button } from '../atoms/Button'; | ||
import { Text } from '../atoms/Text'; | ||
import { ScreenView } from '../molecules/ScreenView'; | ||
|
||
export const AddGoalModal = ({ isOpen, onClose }: { isOpen: boolean; onClose: () => void }) => { | ||
return ( | ||
<Modal | ||
animationType="slide" | ||
visible={isOpen} | ||
presentationStyle="pageSheet" | ||
onRequestClose={onClose} | ||
> | ||
<AutocompleteDropdownContextProvider> | ||
<ScreenView> | ||
<ScrollView className="h-full"> | ||
<Text className="mt-8 text-xl"> | ||
To update your health goals, please reach out to your care team | ||
</Text> | ||
<View className="mt-8 flex flex-row gap-8"> | ||
<View className="flex-1"> | ||
<Button text="Close" variant="secondary" onPress={onClose} /> | ||
</View> | ||
</View> | ||
</ScrollView> | ||
</ScreenView> | ||
</AutocompleteDropdownContextProvider> | ||
</Modal> | ||
); | ||
}; |
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,59 @@ | ||
import React from 'react'; | ||
import { View } from 'react-native'; | ||
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'; | ||
import { zodResolver } from '@hookform/resolvers/zod'; | ||
import { useForm } from 'react-hook-form'; | ||
import { z } from 'zod'; | ||
|
||
import { type Patient } from '@careforge/canvas'; | ||
|
||
import { Button } from '../atoms/Button'; | ||
import { Text } from '../atoms/Text'; | ||
|
||
const DemographicsFormSchema = z.object({}); | ||
|
||
export type DemographicsFormType = z.infer<typeof DemographicsFormSchema>; | ||
|
||
export const DemographicsForm = ({ | ||
patient: _patient, | ||
onSubmit, | ||
onCancel, | ||
isMutating, | ||
}: { | ||
patient: Patient; | ||
onSubmit: (form: DemographicsFormType) => void; | ||
onCancel: () => void; | ||
isMutating?: boolean; | ||
}) => { | ||
const { | ||
formState: { isValid }, | ||
handleSubmit, | ||
} = useForm<DemographicsFormType>({ | ||
resolver: zodResolver(DemographicsFormSchema), | ||
defaultValues: {}, | ||
}); | ||
|
||
return ( | ||
<KeyboardAwareScrollView showsVerticalScrollIndicator={false} className="h-full"> | ||
<Text className="text-3xl" weight="bold"> | ||
Edit Demographics | ||
</Text> | ||
<View className="mt-8 flex gap-8"> | ||
<Text>TODO</Text> | ||
</View> | ||
<View className="mt-8 flex flex-row gap-8"> | ||
<View className="flex-1"> | ||
<Button text="Cancel" variant="secondary" onPress={onCancel} /> | ||
</View> | ||
<View className="flex-1"> | ||
<Button | ||
disabled={!isValid} | ||
text="Save" | ||
onPress={handleSubmit(onSubmit)} | ||
isLoading={isMutating} | ||
/> | ||
</View> | ||
</View> | ||
</KeyboardAwareScrollView> | ||
); | ||
}; |
Oops, something went wrong.