mirror of
https://github.com/urosran/cally.git
synced 2025-07-17 02:25:10 +00:00
user creation flow fix
This commit is contained in:
@ -1,7 +1,8 @@
|
||||
import React, {useState} from 'react';
|
||||
import {Button, Card, Colors, Dialog, Hint, ListItem, Text, View} from 'react-native-ui-lib';
|
||||
import React from 'react';
|
||||
import {Button, Card, Dialog, Text, TouchableOpacity} from 'react-native-ui-lib';
|
||||
import QRCode from 'react-native-qrcode-svg';
|
||||
import {PanningDirectionsEnum} from "react-native-ui-lib/src/components/panningViews/panningProvider";
|
||||
import Ionicons from "@expo/vector-icons/Ionicons";
|
||||
|
||||
const UserMenu = ({
|
||||
userId,
|
||||
@ -10,40 +11,20 @@ const UserMenu = ({
|
||||
}: {
|
||||
userId: string,
|
||||
showQRCodeDialog: boolean,
|
||||
setShowQRCodeDialog: (value: boolean) => void
|
||||
setShowQRCodeDialog: (value: string | boolean) => void
|
||||
}) => {
|
||||
const [showHint, setShowHint] = useState(false);
|
||||
|
||||
const handleShowQRCode = () => {
|
||||
setShowHint(false);
|
||||
setTimeout(() => {
|
||||
setShowQRCodeDialog(true);
|
||||
}, 500);
|
||||
setShowQRCodeDialog(userId);
|
||||
};
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<Hint
|
||||
onBackgroundPress={() => setShowHint(false)}
|
||||
onPress={() => setShowHint(true)}
|
||||
color={Colors.white}
|
||||
customContent={
|
||||
<View height={18}>
|
||||
<ListItem onPress={handleShowQRCode}>
|
||||
<Text style={{fontFamily: "Manrope_500Medium"}}>Show Login QR Code</Text>
|
||||
</ListItem>
|
||||
</View>
|
||||
}
|
||||
enableShadow
|
||||
visible={showHint}
|
||||
backdropColor="transparent"
|
||||
<TouchableOpacity
|
||||
onPress={handleShowQRCode}
|
||||
>
|
||||
<View>
|
||||
<Button link onPress={() => setShowHint(!showHint)}>
|
||||
<Text>...</Text>
|
||||
</Button>
|
||||
</View>
|
||||
</Hint>
|
||||
<Ionicons name="qr-code-outline" size={24} color="black"/>
|
||||
</TouchableOpacity>
|
||||
|
||||
<Dialog
|
||||
visible={showQRCodeDialog}
|
||||
|
Reference in New Issue
Block a user