Added creating family devices, refetch calendar on notification received

This commit is contained in:
Milan Paunovic
2024-10-13 10:21:38 +02:00
parent 9123aab566
commit 1e506dd246
6 changed files with 479 additions and 391 deletions

View File

@ -3,15 +3,22 @@ import {Button, Card, Colors, Dialog, Hint, ListItem, Text, View} from 'react-na
import QRCode from 'react-native-qrcode-svg';
import {PanningDirectionsEnum} from "react-native-ui-lib/src/components/panningViews/panningProvider";
const UserMenu = ({userId}:{userId: string}) => {
const UserMenu = ({
userId,
showQRCodeDialog,
setShowQRCodeDialog
}: {
userId: string,
showQRCodeDialog: boolean,
setShowQRCodeDialog: (value: boolean) => void
}) => {
const [showHint, setShowHint] = useState(false);
const [showQRCodeDialog, setShowQRCodeDialog] = useState(false);
const handleShowQRCode = () => {
setShowHint(false);
setTimeout(() => {
setShowQRCodeDialog(true);
}, 500)
}, 500);
};
return (
@ -22,9 +29,7 @@ const UserMenu = ({userId}:{userId: string}) => {
color={Colors.white}
customContent={
<View height={18}>
<ListItem
onPress={handleShowQRCode}
>
<ListItem onPress={handleShowQRCode}>
<Text>Show Login QR Code</Text>
</ListItem>
</View>
@ -34,7 +39,7 @@ const UserMenu = ({userId}:{userId: string}) => {
backdropColor="transparent"
>
<View>
<Button link onPress={() => setShowHint(x => !x)}>
<Button link onPress={() => setShowHint(!showHint)}>
<Text>...</Text>
</Button>
</View>
@ -47,7 +52,7 @@ const UserMenu = ({userId}:{userId: string}) => {
>
<Card padding-20 center>
<Text marginB-10>Scan this QR Code to Login:</Text>
<QRCode value={userId} size={150} />
<QRCode value={userId} size={150}/>
<Button
marginT-20
label="Close"