diff --git a/src/components/Modal/CustomModal.tsx b/src/components/Modal/CustomModal.tsx index 2236a8d8..8d9bf38b 100644 --- a/src/components/Modal/CustomModal.tsx +++ b/src/components/Modal/CustomModal.tsx @@ -1,9 +1,9 @@ import React from 'react'; import { Alert, Modal, StyleSheet, Text, Pressable, View } from 'react-native'; -const message = "Press Done button once you verify yourself from My-site" +const message = 'Press Done button once you verify yourself from My-site'; const CustomModal = ({ modalVisible, setModalVisible }) => { - console.log('mess',message) + console.log('mess', message); return ( { // TODO: will revamp github signIn feature const { setLoggedInUserData } = useContext(AuthContext); @@ -36,7 +34,6 @@ const AuthScreen = () => { const [scannedUserId, setScannedUserID] = useState(''); const [modalVisible, setModalVisible] = useState(false); - const activateCamera = async () => { try { // await Camera.requestCameraPermission(); // Request camera permission @@ -80,9 +77,9 @@ const AuthScreen = () => { const getAuthStatus = async () => { const deviceInfo = await DeviceInfo.getDeviceName(); const deviceId = await DeviceInfo.getUniqueId(); - console.log("device info",deviceInfo) - console.log("device id",deviceId) - console.log('userID',scannedUserId) + console.log('device info', deviceInfo); + console.log('device id', deviceId); + console.log('userID', scannedUserId); setLoading(true); try { const data = await fetch(AuthApis.QR_AUTH_API, { @@ -102,16 +99,22 @@ const AuthScreen = () => { if (data.ok) { const dataJson = await data.json(); console.log('Post call successful', dataJson); - Alert.alert('Please Confirm',dataJson.message, [ + Alert.alert('Please Confirm', dataJson.message, [ { text: 'Cancel', - onPress: () => setCameraActive(false) + onPress: () => setCameraActive(false), }, - { text: 'OK', onPress: () => {setCameraActive(false); setModalVisible(true)}}, // ok -> Modal (press done button once you verify yourself from mysite) -> Done > loader? -> get call implementation =?> userdata => autorize -> if fail ? toast msgs ? homscreen + { + text: 'OK', + onPress: () => { + setCameraActive(false); + setModalVisible(true); + }, + }, // ok -> Modal (press done button once you verify yourself from mysite) -> Done > loader? -> get call implementation =?> userdata => autorize -> if fail ? toast msgs ? homscreen ]); } else { const dataJson = await data.json(); - console.log('data in else', dataJson.message) + console.log('data in else', dataJson.message); Toast.show({ type: 'error', text1: 'Something went wrong, please try again', @@ -238,9 +241,11 @@ const AuthScreen = () => { /> )} - { modalVisible && ( - - + {modalVisible && ( + )} );