mirror of
https://github.com/urosran/cally.git
synced 2025-11-27 00:44:54 +00:00
added new colors, ui changes
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user