small cleanups

This commit is contained in:
0xturboblitz
2024-08-27 16:00:57 +08:00
parent 44f88341f2
commit a8206de69e
3 changed files with 5 additions and 21 deletions

View File

@@ -34,11 +34,8 @@ function App(): JSX.Element {
if (AMPLITUDE_KEY) {
amplitude.init(AMPLITUDE_KEY);
}
//initUserStore();
}, []);
// TODO: when passportData already stored, retrieve and jump to main screen
return (
<YStack f={1} bc={bgWhite} h="100%" w="100%">
<YStack h="100%" w="100%">

View File

@@ -39,13 +39,6 @@ import AppScreen from './AppScreen';
// import constants
import { RPC_URL, SignatureAlgorithm } from '../../../common/src/constants/constants';
import { mock_csca_sha256_rsa_4096, mock_dsc_sha256_rsa_4096 } from '../../../common/src/constants/mockCertificates';
const { nativeModule } = NativeModules;
let emitter: NativeEventEmitter | null = null;
if (Platform.OS === 'android') {
emitter = new NativeEventEmitter(nativeModule);
}
import DatePicker from 'react-native-date-picker'
import StartScreen from './StartScreen';
import CustomButton from '../components/CustomButton';
@@ -55,8 +48,11 @@ import ValidProofScreen from './ValidProofScreen';
import WrongProofScreen from './WrongProofScreen';
import MockDataScreen from './MockDataScreen';
const emitter = (Platform.OS === 'android')
? new NativeEventEmitter(NativeModules.nativeModule)
: null
const MainScreen: React.FC = () => {
const [NFCScanIsOpen, setNFCScanIsOpen] = useState(false);
const [scanningMessage, setScanningMessage] = useState('');
const [displayOtherOptions, setDisplayOtherOptions] = useState(false);
const [SettingsIsOpen, setSettingsIsOpen] = useState(false);
@@ -153,7 +149,6 @@ const MainScreen: React.FC = () => {
}
else {
console.log('android :)');
setNFCScanIsOpen(true);
scan(setModalProofStep);
}
}
@@ -239,7 +234,6 @@ const MainScreen: React.FC = () => {
// selectedTab: "scan",
// })
// timeoutId = setTimeout(() => {
// setNFCScanIsOpen(false);
// }, 0);
// }
// else if (step == Steps.MRZ_SCAN_COMPLETED) {
@@ -247,13 +241,11 @@ const MainScreen: React.FC = () => {
// selectedTab: "nfc",
// })
// timeoutId = setTimeout(() => {
// setNFCScanIsOpen(false);
// }, 0);
// }
// else if (step == Steps.NEXT_SCREEN) {
// // Set the timeout and store its ID
// timeoutId = setTimeout(() => {
// setNFCScanIsOpen(false);
// }, 700);
// }
// else if (step == Steps.PROOF_GENERATED) {
@@ -301,11 +293,6 @@ const MainScreen: React.FC = () => {
<XStack onPress={() => setHelpIsOpen(true)}><HelpCircle size={28} color={textBlack} /></XStack>
<XStack p="$2" onPress={() => setSettingsIsOpen(true)}><Cog size={24} color={textBlack} /></XStack>
</XStack>
}
{/* {selectedTab !== "start" && selectedTab !== "scan" && selectedTab !== "nfc" && selectedTab !== "next" && selectedTab !== "register" && (

View File

@@ -23,7 +23,7 @@ export const scan = async (setModalProofStep: (modalProofStep: number) => void)
dateOfExpiry,
} = useUserStore.getState()
const { toast, setStep, nfcSheetIsOpen, setNfcSheetIsOpen } = useNavigationStore.getState();
const { toast, setStep } = useNavigationStore.getState();
const check = checkInputs(
passportNumber,