import { useMemo, useState } from 'react' import { Row, Col, Tooltip, Switch, Typography, Divider, Space } from 'antd' import IonIcon from '@sentre/antd-ionicon' import Coin98 from './coin98' import Phantom from './phantom' import SolflareExtension from './solflareExt' import SolflareWeb from './solflareWeb' import KeyStore from './keystore' import SecretKey from './secretKey' import CloverWallet from './clover' import Exodus from './exodus' import NetSwitch from 'view/actionCenter/settings/network/netSwitch' import { env } from 'shared/runtime' const LIST_WALLET = [ { key: 'coin98', component: Coin98, priority: 1 }, { key: 'phantom', component: Phantom, priority: 2 }, { key: 'exodus', component: Exodus, priority: 3 }, { key: 'clover_solana', component: CloverWallet, priority: 4 }, { key: 'solflare', component: SolflareExtension, priority: 5 }, { key: 'solflareWeb', component: SolflareWeb, priority: 6 }, ] const SecureMethods = () => { const sortedWallet = useMemo( () => LIST_WALLET.sort((a: any, b: any) => { if (window?.[a.key] && !window?.[b.key]) return -1 if (!window?.[a.key] && window?.[b.key]) return 1 return a.priority - b.priority }), [], ) return ( {sortedWallet.map((wallet) => ( ))} ) } const UnsecureMethods = () => { return ( These connections are for development only. Because other applications can read your secret data including private keys, you shouldn't connect by any mainnet wallet. ) } const WalletConnection = () => { const [advanced, setAdvanced] = useState(false) return ( Wallet Connection {env === 'production' ? null : ( Dev Only } unCheckedChildren={} /> )} {advanced ? : } ) } export default WalletConnection