diff --git a/src/components/Balance.tsx b/src/components/Balance.tsx new file mode 100644 index 0000000..8fc4088 --- /dev/null +++ b/src/components/Balance.tsx @@ -0,0 +1,55 @@ +import { asp as g } from "@asp/asp"; +import Entypo from "@expo/vector-icons/Entypo"; +import { ImageBackground } from "expo-image"; +import * as LocalAuthentication from "expo-local-authentication"; +import { type FC, useState } from "react"; +import type { ViewProps } from "react-native"; +import { Text, TouchableOpacity } from "react-native"; + +type BalanceProps = Omit & { amount: number }; + +export const Balance: FC = ({ style, amount = 0, ...rest }) => { + 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 ? ( + setShowBalance(false)}> + {amount} + + ) : ( + + )} + + ); +};