Skip to content

Commit

Permalink
fix: show wallet icon in header
Browse files Browse the repository at this point in the history
  • Loading branch information
schmanu committed Apr 5, 2024
1 parent 91d342e commit 4b4d545
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
10 changes: 2 additions & 8 deletions src/components/WalletIcon/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import { Skeleton } from '@mui/material'
import metamaskIcon from '@web3-onboard/injected-wallets/dist/icons/metamask'
import coinbaseIcon from '@web3-onboard/coinbase/dist/icon'
import keystoneIcon from '@web3-onboard/keystone/dist/icon'
import walletConnectIcon from '@web3-onboard/walletconnect/dist/icon'
import trezorIcon from '@web3-onboard/trezor/dist/icon'
import ledgerIcon from '@web3-onboard/ledger/dist/icon'
import tahoIcon from '@web3-onboard/taho/dist/icon'

import { WALLET_KEYS } from '@/utils/onboard'

Expand All @@ -14,8 +8,8 @@ type Props = {
}

const WALLET_ICONS: Props = {
[WALLET_KEYS.WALLETCONNECT_V2]: walletConnectIcon,
}
WALLETCONNECT: walletConnectIcon,
} as const

export const WalletIcon = ({ provider }: { provider: string }) => {
const icon = WALLET_ICONS[provider.toUpperCase() as keyof typeof WALLET_ICONS]
Expand Down
6 changes: 3 additions & 3 deletions src/utils/onboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import { getRpcServiceUrl } from '@/utils/web3'
import { WC_PROJECT_ID } from '@/config/constants'

export const enum WALLET_KEYS {
WALLETCONNECT_V2 = 'WALLETCONNECT_V2',
WALLETCONNECT = 'WalletConnect',
}

const CGW_NAMES: { [key in WALLET_KEYS]: string } = {
[WALLET_KEYS.WALLETCONNECT_V2]: 'walletConnect_v2',
[WALLET_KEYS.WALLETCONNECT]: 'WalletConnect',
}

const walletConnectV2 = (chain: ChainInfo): WalletInit => {
Expand All @@ -31,7 +31,7 @@ const walletConnectV2 = (chain: ChainInfo): WalletInit => {
}

const WALLET_MODULES: { [key in WALLET_KEYS]: (chain: ChainInfo) => WalletInit } = {
[WALLET_KEYS.WALLETCONNECT_V2]: (chain) => walletConnectV2(chain),
[WALLET_KEYS.WALLETCONNECT]: (chain) => walletConnectV2(chain),
}

const getAllWallets = (chain: ChainInfo): WalletInit[] => {
Expand Down

0 comments on commit 4b4d545

Please sign in to comment.