added new colors, ui changes

This commit is contained in:
ivic00
2024-11-26 19:32:40 +01:00
parent 29ec985ffa
commit 4b5900c652
8 changed files with 549 additions and 409 deletions

View File

@ -12,7 +12,7 @@ import Ionicons from "@expo/vector-icons/Ionicons";
import { useGetFamilyMembers } from "@/hooks/firebase/useGetFamilyMembers";
import { UserProfile } from "@/hooks/firebase/types/profileTypes";
import { StyleSheet } from "react-native";
import { ProfileType } from "@/contexts/AuthContext";
import { ProfileType, useAuthContext } from "@/contexts/AuthContext";
const UserMenu = ({
user,
@ -23,10 +23,24 @@ const UserMenu = ({
showQRCodeDialog: boolean;
setShowQRCodeDialog: (value: string | boolean) => void;
}) => {
const {user: currentUser} = useAuthContext();
const handleShowQRCode = () => {
setShowQRCodeDialog(user.uid!);
};
const getQRCodeText = () => {
if (user.userType === ProfileType.FAMILY_DEVICE) {
return "Open Cally on the family device and scan the code to link it to your family group";
}
if (currentUser?.uid === user.uid) {
return "To connect another device to your profile, open the Cally app on that device and scan this QR code.";
}
return `To connect ${user.firstName}'s device to your Family Group, open the Cally app on their device and scan the QR code.`;
};
return (
<>
<TouchableOpacity onPress={handleShowQRCode}>
@ -46,9 +60,7 @@ const UserMenu = ({
marginB-25
style={{ fontSize: 18, fontFamily: "Manrope_500Medium" }}
>
{user.userType !== ProfileType.FAMILY_DEVICE
? `Open Cally on ${user.firstName}'s device and scan the code to link it to your family group`
: "Open Cally on the family device and scan the code to link it to your family group"}
{getQRCodeText()}
</Text>
<QRCode value={user.uid!} size={150} />
<Button