import React, { useEffect, useState } from 'react' import { View, TextInput, TouchableOpacity, StyleSheet, ActivityIndicator, ScrollView, KeyboardAvoidingView, Platform } from 'react-native' import { Text, showToast} from '@tencentcloud/chat-uikit-react-native' import { SafeAreaView } from 'react-native-safe-area-context' import { useNavigation } from '@react-navigation/native' import type { NativeStackNavigationProp } from '@react-navigation/native-stack' import AsyncStorage from '@react-native-async-storage/async-storage' import { useTranslation } from 'react-i18next' import { useLoginState } from 'tuikit-atomicx-react-native' import { genTestUserSig } from './debug/GenerateTestUserSig' import { setDemoLanguage } from './i18n' type RootStackParamList = { Login: undefined Main: undefined } type Nav = NativeStackNavigationProp const LANG_STORAGE_KEY = '@demo:language' type LanguageOption = 'zh-CN' | 'en' const resolveCurrentLang = (i18nLang: string): LanguageOption => { return i18nLang === 'en' ? 'en' : 'zh-CN' } export const LoginScreen: React.FC = () => { const navigation = useNavigation