Skip to content

Commit

Permalink
Re-implement token title card to fix all layout issues
Browse files Browse the repository at this point in the history
  • Loading branch information
csillag committed Jun 30, 2023
1 parent a19b05b commit 3d223d1
Showing 1 changed file with 43 additions and 12 deletions.
55 changes: 43 additions & 12 deletions src/app/pages/TokenDashboardPage/TokenTitleCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import { FC } from 'react'
import { useRequiredScopeParam } from '../../hooks/useScopeParam'
import { useLoaderData } from 'react-router-dom'
import Card from '@mui/material/Card'
import CardHeader from '@mui/material/CardHeader'
import CardContent from '@mui/material/CardContent'
import Typography from '@mui/material/Typography'
import { COLORS } from '../../../styles/theme/colors'
import { useTokenInfo } from './hook'
import Skeleton from '@mui/material/Skeleton'
import { ContractVerificationIcon } from '../../components/ContractVerificationIcon'
Expand All @@ -27,16 +29,45 @@ export const TokenTitleCard: FC = () => {

return (
<Card>
<CardHeader
disableTypography
component="h2"
title={title}
subheader={subTitle}
action={
addressEth ? (
<CardContent>
<Box
sx={{
display: 'flex',
flexWrap: 'wrap',
justifyContent: 'space-between',
alignItems: 'center',
}}
>
<Box
sx={{
display: 'flex',
}}
>
<Typography
variant="h2"
sx={{
fontWeight: 700,
}}
>
{title}
</Typography>
&nbsp;
<Typography
variant="h2"
sx={{
color: COLORS.grayMedium,
fontWeight: 700,
}}
>
{subTitle}
</Typography>
</Box>
{addressEth && (
<Box
sx={{
display: 'inline-flex',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
}}
>
<ContractVerificationIcon
Expand All @@ -47,9 +78,9 @@ export const TokenTitleCard: FC = () => {
<AccountLink scope={account} address={addressEth} />
<CopyToClipboard value={account.address_eth || account.address} />
</Box>
) : null
}
/>
)}
</Box>
</CardContent>
</Card>
)
}

0 comments on commit 3d223d1

Please sign in to comment.