import Box from "@components/bases/Box"; import Text from "@components/bases/Text"; import { images } from "@styles/Commons"; import * as LocalAuthentication from "expo-local-authentication"; import { useState } from "react"; import { Image, TouchableOpacity } from "react-native"; type Props = { balance: number; label: string }; const BalanceContainer = ({ label, balance }: Props) => { const [showBalance, setShowBalance] = useState(false); const handleLocalAuthentication = async () => { console.log("handleLocalAuthentication :: start"); if (showBalance) { return setShowBalance(false); } const result = await LocalAuthentication.authenticateAsync(); if (result.success) { setShowBalance(true); } console.log("handleLocalAuthentication :: end", result); }; return ( {showBalance ? ( {balance} ) : ( )} {label} ); }; export default BalanceContainer;