diff --git a/mobile/src/screens/VerifyHumanScreen.tsx b/mobile/src/screens/VerifyHumanScreen.tsx index 15a7a5f6..449c7b42 100644 --- a/mobile/src/screens/VerifyHumanScreen.tsx +++ b/mobile/src/screens/VerifyHumanScreen.tsx @@ -28,8 +28,8 @@ const VerifyHumanScreen: React.FC = ({ onVerified }) => // Save verification status try { await AsyncStorage.setItem(HUMAN_VERIFIED_KEY, 'true'); - } catch (error) { - console.error('Failed to save verification:', error); + } catch (_error) { + if (__DEV__) console.error('Failed to save verification:', _error); } // Animate and navigate @@ -84,7 +84,7 @@ const VerifyHumanScreen: React.FC = ({ onVerified }) => {isChecked && } - I'm not a robot + I'm not a robot @@ -252,8 +252,8 @@ export const checkHumanVerification = async (): Promise => { try { const verified = await AsyncStorage.getItem(HUMAN_VERIFIED_KEY); return verified === 'true'; - } catch (error) { - console.error('Failed to check verification:', error); + } catch (_error) { + if (__DEV__) console.error('Failed to check verification:', _error); return false; } }; diff --git a/mobile/src/screens/WalletSetupScreen.tsx b/mobile/src/screens/WalletSetupScreen.tsx index 3f98fdfd..596c96bb 100644 --- a/mobile/src/screens/WalletSetupScreen.tsx +++ b/mobile/src/screens/WalletSetupScreen.tsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect } from 'react'; +import React, { useState } from 'react'; import { View, Text, @@ -11,26 +11,33 @@ import { Alert, Platform, } from 'react-native'; -import { useNavigation } from '@react-navigation/native'; +import { useNavigation, NavigationProp, ParamListBase } from '@react-navigation/native'; import { LinearGradient } from 'expo-linear-gradient'; import { KurdistanColors } from '../theme/colors'; import { usePezkuwi } from '../contexts/PezkuwiContext'; import { mnemonicGenerate, mnemonicValidate } from '@pezkuwi/util-crypto'; +// Alert button type for cross-platform compatibility +interface AlertButton { + text: string; + onPress?: () => void; + style?: 'default' | 'cancel' | 'destructive'; +} + // Cross-platform alert helper -const showAlert = (title: string, message: string, buttons?: Array<{text: string; onPress?: () => void; style?: string}>) => { +const showAlert = (title: string, message: string, buttons?: AlertButton[]) => { if (Platform.OS === 'web') { window.alert(`${title}\n\n${message}`); if (buttons?.[0]?.onPress) buttons[0].onPress(); } else { - Alert.alert(title, message, buttons as any); + Alert.alert(title, message, buttons); } }; type SetupStep = 'choice' | 'create-show' | 'create-verify' | 'import' | 'wallet-name' | 'success'; const WalletSetupScreen: React.FC = () => { - const navigation = useNavigation(); + const navigation = useNavigation>(); const { createWallet, importWallet, connectWallet, isReady } = usePezkuwi(); const [step, setStep] = useState('choice'); @@ -111,9 +118,9 @@ const WalletSetupScreen: React.FC = () => { setCreatedAddress(address); await connectWallet(); setStep('success'); - } catch (error: any) { - console.error('[WalletSetup] Create wallet error:', error); - showAlert('Error', error.message || 'Failed to create wallet'); + } catch (error: unknown) { + if (__DEV__) console.error('[WalletSetup] Create wallet error:', error); + showAlert('Error', error instanceof Error ? error.message : 'Failed to create wallet'); } finally { setIsLoading(false); } @@ -166,9 +173,9 @@ const WalletSetupScreen: React.FC = () => { setCreatedAddress(address); await connectWallet(); setStep('success'); - } catch (error: any) { - console.error('[WalletSetup] Import wallet error:', error); - showAlert('Error', error.message || 'Failed to import wallet'); + } catch (error: unknown) { + if (__DEV__) console.error('[WalletSetup] Import wallet error:', error); + showAlert('Error', error instanceof Error ? error.message : 'Failed to import wallet'); } finally { setIsLoading(false); } @@ -179,8 +186,8 @@ const WalletSetupScreen: React.FC = () => { navigation.replace('Wallet'); }; - // Go back to previous step - const handleBack = () => { + // Go back to previous step (TODO: add back button UI) + const _handleBack = () => { switch (step) { case 'create-show': case 'import': @@ -297,7 +304,7 @@ const WalletSetupScreen: React.FC = () => { onPress={handleMnemonicConfirmed} testID="wallet-setup-continue-button" > - I've Written It Down + I've Written It Down ); @@ -306,7 +313,7 @@ const WalletSetupScreen: React.FC = () => { Verify Your Phrase - Select the correct words to verify you've saved your recovery phrase + Select the correct words to verify you've saved your recovery phrase diff --git a/mobile/src/screens/WelcomeScreen.tsx b/mobile/src/screens/WelcomeScreen.tsx index fe52b03c..9f83e2f1 100644 --- a/mobile/src/screens/WelcomeScreen.tsx +++ b/mobile/src/screens/WelcomeScreen.tsx @@ -14,6 +14,7 @@ import AsyncStorage from '@react-native-async-storage/async-storage'; import { KurdistanColors } from '../theme/colors'; import PrivacyPolicyModal from '../components/PrivacyPolicyModal'; import TermsOfServiceModal from '../components/TermsOfServiceModal'; +import kurdistanMapImage from '../../assets/kurdistan-map.png'; interface WelcomeScreenProps { onContinue?: () => void; @@ -29,9 +30,11 @@ const WelcomeScreen: React.FC = ({ onContinue }) => { try { await AsyncStorage.setItem('@pezkuwi/privacy_consent_accepted', 'true'); - onContinue && onContinue(); - } catch (error) { - if (__DEV__) console.error('Error saving privacy consent:', error); + if (onContinue) { + onContinue(); + } + } catch (_error) { + if (__DEV__) console.error('Error saving privacy consent:', _error); } }; @@ -52,7 +55,7 @@ const WelcomeScreen: React.FC = ({ onContinue }) => { @@ -68,7 +71,7 @@ const WelcomeScreen: React.FC = ({ onContinue }) => { - Pezkuwi is a pioneering experiment in digital statehood, merging technology with sociology, economy with politics. Starting with the Kurdish digital nation, we are building the world's first territory-independent nation governed by algorithmic sovereignty and social trust rather than borders and bureaucracy. + Pezkuwi is a pioneering experiment in digital statehood, merging technology with sociology, economy with politics. Starting with the Kurdish digital nation, we are building the world's first territory-independent nation governed by algorithmic sovereignty and social trust rather than borders and bureaucracy.