mirror of
https://github.com/urosran/cally.git
synced 2025-11-26 08:24:55 +00:00
Fix profile type
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import React, {useEffect, useState} from "react";
|
||||
import {Button, Text, TextInput} from "react-native";
|
||||
import {Checkbox, Picker, TextField, View} from "react-native-ui-lib";
|
||||
import {Button, TextInput} from "react-native";
|
||||
import {Checkbox, Picker, TextField, View, Text} from "react-native-ui-lib";
|
||||
import useAuth from "@/hooks/firebase/useAuth";
|
||||
import useChildren from "@/hooks/firebase/useChildren";
|
||||
import useCaregivers from "@/hooks/firebase/useCaregivers";
|
||||
@ -25,20 +25,17 @@ const Screen: React.FC = () => {
|
||||
} = useAuth();
|
||||
|
||||
const {
|
||||
children,
|
||||
child,
|
||||
setChild,
|
||||
handleNewChild,
|
||||
} = useChildren(user);
|
||||
|
||||
const {data: childrenByParentId} = useGetChildrenByParentId()
|
||||
const {data: children} = useGetChildrenByParentId()
|
||||
|
||||
const {
|
||||
caregivers,
|
||||
caregiver,
|
||||
setCaregiver,
|
||||
fetchCaregivers,
|
||||
handleNewCaregiver,
|
||||
} = useCaregivers();
|
||||
|
||||
const {mutateAsync: createSubUser} = useCreateSubUser()
|
||||
@ -121,13 +118,15 @@ const Screen: React.FC = () => {
|
||||
</View>
|
||||
);
|
||||
|
||||
console.log(profileType, profileData)
|
||||
|
||||
return (
|
||||
<View>
|
||||
{user ? (
|
||||
<View paddingH-20>
|
||||
{profileType === ProfileType.parent && <Text>Parent</Text>}
|
||||
{profileType === ProfileType.child && <Text>Child</Text>}
|
||||
{profileType === ProfileType.caregiver && <Text>Caregiver</Text>}
|
||||
<View paddingH-20 marginT-20>
|
||||
{profileType === ProfileType.PARENT && <Text>Parent</Text>}
|
||||
{profileType === ProfileType.CHILD && <Text>Child</Text>}
|
||||
{profileType === ProfileType.CAREGIVER && <Text>Caregiver</Text>}
|
||||
<Button title="Sign Out" onPress={handleSignOut}/>
|
||||
<TextField
|
||||
placeholder={"Child Name"}
|
||||
@ -198,7 +197,7 @@ const Screen: React.FC = () => {
|
||||
/>
|
||||
<View margin-20>
|
||||
<Text>Children:</Text>
|
||||
{children.map((child) => (
|
||||
{children?.map((child) => (
|
||||
<View key={child.name} row>
|
||||
<Text>Name: {child.name} </Text>
|
||||
<Picker label="Pick Caregiver">
|
||||
|
||||
Reference in New Issue
Block a user