-
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.
Merge branch 'bugfix/cycleimport' into feature/addtitletotaskmodel
- Loading branch information
Showing
12 changed files
with
196 additions
and
55 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,30 @@ | ||
import React, { useState } from 'react'; | ||
import { FlatList, Pressable, View } from 'react-native'; | ||
|
||
export function HealthStats() { | ||
const [canPress, setCanPress] = useState(true); | ||
|
||
return ( | ||
<FlatList | ||
keyboardShouldPersistTaps="always" | ||
className="mt-10 h-fit max-h-fit flex-grow-0" | ||
onScrollBeginDrag={() => setCanPress(false)} | ||
onScrollEndDrag={() => setCanPress(true)} | ||
horizontal | ||
showsHorizontalScrollIndicator={false} | ||
data={Array.from({ length: 10 }, (_, i) => i)} | ||
renderItem={({ index }) => ( | ||
<Pressable | ||
key={index} | ||
onTouchEnd={() => { | ||
if (canPress) console.log('Pressed'); | ||
}} | ||
> | ||
<View className="items-center px-2"> | ||
<View className="z-10 h-48 w-32 rounded-3xl border border-carewallet-black bg-carewallet-white" /> | ||
</View> | ||
</Pressable> | ||
)} | ||
/> | ||
); | ||
} |
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,38 +1,46 @@ | ||
import React from 'react'; | ||
import { Pressable, Text, View } from 'react-native'; | ||
import { Text, View } from 'react-native'; | ||
|
||
import { useNavigation } from '@react-navigation/native'; | ||
import { IconButton } from 'react-native-paper'; | ||
|
||
import { AppStackNavigation } from '../../navigation/AppNavigation'; | ||
import { User } from '../../types/user'; | ||
|
||
interface ProfileTopHeaderProps { | ||
user: User; | ||
onTouchEndLeft?: () => void; | ||
onTouchEndLeft?: AppStackNavigation; | ||
leftButtonText?: JSX.Element | string; | ||
onTouchEndRight?: () => void; | ||
rightButtonText?: string; | ||
rightButtonText?: JSX.Element | string; | ||
} | ||
|
||
export function ProfileTopHeader({ | ||
user, | ||
onTouchEndLeft, | ||
leftButtonText, | ||
onTouchEndRight, | ||
rightButtonText | ||
}: ProfileTopHeaderProps) { | ||
const navigation = useNavigation<AppStackNavigation>(); | ||
return ( | ||
<View className="flex w-full flex-row items-center justify-center"> | ||
<Pressable className="ml-5 mr-auto" onTouchEnd={onTouchEndLeft}> | ||
<View className="mt-14 h-7 w-14 items-center justify-center self-start rounded-lg bg-carewallet-white"> | ||
{leftButtonText} | ||
</View> | ||
</Pressable> | ||
<Text className="mt-14 self-center text-center text-3xl font-extrabold text-carewallet-white"> | ||
<View className="flex flex-row"> | ||
{leftButtonText && ( | ||
<IconButton | ||
className="absolute mt-14 flex h-[40px] self-start rounded-xl bg-carewallet-gray" | ||
mode="contained" | ||
icon={() => leftButtonText} | ||
onPress={() => navigation.goBack()} | ||
/> | ||
)} | ||
<Text className="mx-auto mt-14 flex-wrap self-center text-center text-3xl font-semibold text-carewallet-white"> | ||
{user.first_name} {user.last_name} | ||
</Text> | ||
<Pressable className="ml-auto mr-5" onTouchEnd={onTouchEndRight}> | ||
<View className="text mt-14 h-7 w-14 items-center justify-center self-start rounded-lg bg-carewallet-white"> | ||
<Text className="text-md">{rightButtonText}</Text> | ||
</View> | ||
</Pressable> | ||
{rightButtonText && ( | ||
<IconButton | ||
className="absolute right-0 mr-2 mt-14 flex h-[40px] self-start rounded-xl bg-carewallet-gray" | ||
mode="contained" | ||
icon={() => rightButtonText} | ||
/> | ||
)} | ||
</View> | ||
); | ||
} |
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,19 @@ | ||
import { NavigationProp } from '@react-navigation/native'; | ||
import { createNativeStackNavigator } from '@react-navigation/native-stack'; | ||
|
||
export type AppStackParamList = { | ||
Main: undefined; | ||
Home: undefined; | ||
Login: undefined; | ||
Profile: undefined; | ||
PatientView: undefined; | ||
ProfileScreens: undefined; | ||
Landing: undefined; | ||
Calendar: undefined; | ||
Notifications: undefined; | ||
TaskType: undefined; | ||
}; | ||
|
||
export type AppStackNavigation = NavigationProp<AppStackParamList>; | ||
|
||
export const AppStack = createNativeStackNavigator<AppStackParamList>(); |
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,47 @@ | ||
import React from 'react'; | ||
import { Pressable, Text, View } from 'react-native'; | ||
|
||
import { CircleCard } from '../../components/profile/CircleCard'; | ||
import { Header } from '../../components/profile/Header'; | ||
import { HealthStats } from '../../components/profile/HealthStats'; | ||
import { useCareWalletContext } from '../../contexts/CareWalletContext'; | ||
import { useGroup } from '../../services/group'; | ||
import { useUsers } from '../../services/user'; | ||
import { Role } from '../../types/group'; | ||
|
||
export default function PatientView() { | ||
const { group } = useCareWalletContext(); | ||
const { roles } = useGroup(group.groupID); | ||
const { users } = useUsers(roles?.map((role) => role.user_id) ?? []); | ||
const patientId = roles?.find((role) => role.role === Role.PATIENT)?.user_id; | ||
|
||
return ( | ||
<View className="flex flex-1 flex-col"> | ||
<Header | ||
user={users?.find((user) => user.user_id === patientId)} | ||
role={roles?.find((role) => role.user_id === patientId)} | ||
/> | ||
<View className="mb-5 items-center"> | ||
<CircleCard ButtonText="View Current Health Stats" /> | ||
</View> | ||
<View className="h-[35vh] w-[80vw] self-center rounded-lg border"> | ||
<Text className="text-md pt-2 text-center font-semibold text-carewallet-black"> | ||
View Past Health Stats | ||
</Text> | ||
<HealthStats /> | ||
</View> | ||
<View className="flex flex-row space-x-10"> | ||
<Pressable className="ml-10 mt-5 h-[10vh] w-[35vw] rounded-lg border"> | ||
<Text className="my-auto text-center text-lg text-carewallet-black"> | ||
Upload Files | ||
</Text> | ||
</Pressable> | ||
<Pressable className="ml-2 mt-5 h-[10vh] w-[35vw] rounded-lg border"> | ||
<Text className="my-auto text-center text-lg text-carewallet-black"> | ||
View Files | ||
</Text> | ||
</Pressable> | ||
</View> | ||
</View> | ||
); | ||
} |
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