Changeset View
Changeset View
Standalone View
Standalone View
web/account/connected-wallet-info.react.js
// @flow | // @flow | ||||
import { emojiAvatarForAddress, useAccountModal } from '@rainbow-me/rainbowkit'; | import { emojiAvatarForAddress, useAccountModal } from '@rainbow-me/rainbowkit'; | ||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import { useAccount, useEnsAvatar } from 'wagmi'; | import { useAccount, useEnsAvatar } from 'wagmi'; | ||||
import SWMansionIcon from 'lib/components/SWMansionIcon.react.js'; | |||||
import { useENSName } from 'lib/hooks/ens-cache.js'; | import { useENSName } from 'lib/hooks/ens-cache.js'; | ||||
import SWMansionIcon from '../SWMansionIcon.react.js'; | |||||
import css from './connected-wallet-info.css'; | import css from './connected-wallet-info.css'; | ||||
function shortenAddressToFitWidth(address: string): string { | function shortenAddressToFitWidth(address: string): string { | ||||
if (address.length < 22) { | if (address.length < 22) { | ||||
return address; | return address; | ||||
} | } | ||||
return `${address.slice(0, 10)}…${address.slice(-10)}`; | return `${address.slice(0, 10)}…${address.slice(-10)}`; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 53 Lines • Show Last 20 Lines |