diff --git a/app.json b/app.json index 35ad2a2..0b6d0de 100644 --- a/app.json +++ b/app.json @@ -23,6 +23,14 @@ }, "web": { "favicon": "./assets/favicon.png" - } + }, + "plugins": [ + [ + "expo-local-authentication", + { + "faceIDPermission": "Allow B-Easy to use Face ID." + } + ] + ] } } diff --git a/src/components/BalanceContainer.tsx b/src/components/BalanceContainer.tsx index 5f5e248..8ecc650 100644 --- a/src/components/BalanceContainer.tsx +++ b/src/components/BalanceContainer.tsx @@ -1,6 +1,7 @@ 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"; @@ -9,6 +10,18 @@ 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 ( { - setShowBalance(!showBalance)}> + {showBalance ? (