Skip to content

Commit

Permalink
Remove ContractVerificationIcon wrapper over VerificationIcon
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaw3d committed Sep 12, 2024
1 parent 1386a1b commit 19ea54a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 27 deletions.
8 changes: 6 additions & 2 deletions src/app/components/Account/RuntimeAccountDetailsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import Link from '@mui/material/Link'
import { DashboardLink } from '../../pages/ParatimeDashboardPage/DashboardLink'
import { AllTokenPrices } from '../../../coin-gecko/api'
import { ContractCreatorInfo } from './ContractCreatorInfo'
import { ContractVerificationIcon } from '../ContractVerificationIcon'
import { VerificationIcon } from '../ContractVerificationIcon'
import { TokenLink } from '../Tokens/TokenLink'
import { AccountAvatar } from '../AccountAvatar'
import { RuntimeBalanceDisplay } from '../Balance/RuntimeBalanceDisplay'
Expand Down Expand Up @@ -94,7 +94,11 @@ export const RuntimeAccountDetailsView: FC<RuntimeAccountDetailsViewProps> = ({
<>
<dt>{t('contract.verification.title')}</dt>
<dd>
<ContractVerificationIcon account={account} />
<VerificationIcon
address_eth={account.address_eth!}
scope={account}
verified={!!account.evm_contract?.verification}
/>
</dd>
</>
)}
Expand Down
26 changes: 1 addition & 25 deletions src/app/components/ContractVerificationIcon/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import { styled } from '@mui/material/styles'
import { COLORS } from '../../../styles/theme/colors'
import Link from '@mui/material/Link'
import Typography from '@mui/material/Typography'
import Skeleton from '@mui/material/Skeleton'
import { Layer, RuntimeAccount } from '../../../oasis-nexus/api'
import { Layer } from '../../../oasis-nexus/api'
import { SearchScope } from '../../../types/searchScope'
import { Network } from '../../../types/network'
import * as externalLinks from '../../utils/externalLinks'
Expand Down Expand Up @@ -54,29 +53,6 @@ const StyledPill = styled(Box, {
}
})

type ContractVerificationIconProps = {
account: Pick<RuntimeAccount, 'address_eth' | 'evm_contract' | 'network' | 'layer'> | undefined
noLink?: boolean
}

const Waiting: FC = () => (
<Skeleton
variant="text"
sx={{ display: 'inline-block', width: '100%', height: verificationIconBoxHeight }}
/>
)

export const ContractVerificationIcon: FC<ContractVerificationIconProps> = ({ account, noLink = false }) => {
if (!account) {
return <Waiting />
}

const verified = !!account.evm_contract?.verification
const address_eth = account.address_eth!

return <VerificationIcon address_eth={address_eth} scope={account} verified={verified} noLink={noLink} />
}

export const VerificationIcon: FC<{
address_eth: string
scope: SearchScope
Expand Down

0 comments on commit 19ea54a

Please sign in to comment.