import { StyleSheet, View, ActivityIndicator } from 'react-native'; import { useSnapshot } from 'valtio'; import WalletItem, { WALLET_FULL_HEIGHT } from '../components/WalletItem'; import ViewAllBox from '../components/ViewAllBox'; import QRIcon from '../assets/QRCode'; import ModalHeader from '../components/ModalHeader'; import type { Listing } from '../types/controllerTypes'; import { RouterCtrl } from '../controllers/RouterCtrl'; import { OptionsCtrl } from '../controllers/OptionsCtrl'; import { WcConnectionCtrl } from '../controllers/WcConnectionCtrl'; import type { RouterProps } from '../types/routerTypes'; import useTheme from '../hooks/useTheme'; import { DataUtil } from '../utils/DataUtil'; function InitialExplorer({ isPortrait }: RouterProps) { const Theme = useTheme(); const { isDataLoaded } = useSnapshot(OptionsCtrl.state); const { pairingUri } = useSnapshot(WcConnectionCtrl.state); const wallets = DataUtil.getInitialWallets(); const recentWallet = DataUtil.getRecentWallet(); const loading = !isDataLoaded || !pairingUri; const viewHeight = isPortrait ? WALLET_FULL_HEIGHT * 2 : WALLET_FULL_HEIGHT; return ( <> RouterCtrl.push('Qrcode')} actionIcon={} /> {loading ? ( ) : ( {wallets.slice(0, 7).map((item: Listing) => ( ))} RouterCtrl.push('WalletExplorer')} wallets={wallets.slice(-4)} style={isPortrait && styles.wallet} /> )} ); } const styles = StyleSheet.create({ explorerContainer: { flexDirection: 'row', flexWrap: 'wrap', justifyContent: 'center', alignItems: 'center', }, wallet: { width: '25%', }, }); export default InitialExplorer;