diff --git a/src/app/components/Snapshots/SnapshotCard.tsx b/src/app/components/Snapshots/SnapshotCard.tsx index 96bd4f512..458ed027f 100644 --- a/src/app/components/Snapshots/SnapshotCard.tsx +++ b/src/app/components/Snapshots/SnapshotCard.tsx @@ -82,6 +82,7 @@ type SnapshotTextCardProps = { label?: ReactNode title: ReactNode withContentPadding?: boolean + withConstantHeight?: boolean } export const SnapshotTextCard: FC = ({ @@ -89,10 +90,16 @@ export const SnapshotTextCard: FC = ({ label, title, withContentPadding, + withConstantHeight, }) => { return ( - - + + = ({ scope, address }) => { const { t } = useTranslation() @@ -15,25 +12,12 @@ export const TokenHoldersCountCard: FC<{ scope: SearchScope; address: string }> const title = t('tokens.holders') return ( - - - {isLoading ? ( - - ) : ( - isFetched && ( - - {t('tokens.holdersValue', { value: token?.num_holders })} - - ) - )} - - + + {isLoading ? ( + + ) : ( + isFetched && <>{t('tokens.holdersValue', { value: token?.num_holders })} + )} + ) } diff --git a/src/app/pages/TokenDashboardPage/TokenSupplyCard.tsx b/src/app/pages/TokenDashboardPage/TokenSupplyCard.tsx index 08fc10a91..b03536517 100644 --- a/src/app/pages/TokenDashboardPage/TokenSupplyCard.tsx +++ b/src/app/pages/TokenDashboardPage/TokenSupplyCard.tsx @@ -1,9 +1,6 @@ import { FC } from 'react' import { useTranslation } from 'react-i18next' -import Box from '@mui/material/Box' -import Typography from '@mui/material/Typography' -import { SnapshotCard } from '../../components/Snapshots/SnapshotCard' -import { COLORS } from '../../../styles/theme/colors' +import { SnapshotTextCard } from '../../components/Snapshots/SnapshotCard' import { useTokenInfo } from './hook' import Skeleton from '@mui/material/Skeleton' import { SearchScope } from '../../../types/searchScope' @@ -11,39 +8,27 @@ import { RoundedBalance } from '../../components/RoundedBalance' export const TokenSupplyCard: FC<{ scope: SearchScope; address: string }> = ({ scope, address }) => { const { t } = useTranslation() - const { isLoading, token, isFetched } = useTokenInfo(scope, address) return ( - : token?.symbol} > - - {isLoading ? ( - - ) : ( - isFetched && - token && ( - - {token.total_supply ? ( - - ) : ( - t('common.not_defined') - )} - - ) - )} - - + {isLoading ? ( + + ) : ( + isFetched && + token && ( + <> + {token.total_supply ? ( + + ) : ( + t('common.not_defined') + )} + + ) + )} + ) } diff --git a/src/app/pages/TokenDashboardPage/TokenTotalTransactionsCard.tsx b/src/app/pages/TokenDashboardPage/TokenTotalTransactionsCard.tsx index 13003137a..2d1a34a52 100644 --- a/src/app/pages/TokenDashboardPage/TokenTotalTransactionsCard.tsx +++ b/src/app/pages/TokenDashboardPage/TokenTotalTransactionsCard.tsx @@ -1,10 +1,7 @@ import { FC } from 'react' import { useTranslation } from 'react-i18next' -import Box from '@mui/material/Box' -import Typography from '@mui/material/Typography' -import { SnapshotCard } from '../../components/Snapshots/SnapshotCard' -import { COLORS } from '../../../styles/theme/colors' import Skeleton from '@mui/material/Skeleton' +import { SnapshotTextCard } from '../../components/Snapshots/SnapshotCard' import { useTokenInfo } from './hook' import { SearchScope } from '../../../types/searchScope' @@ -16,25 +13,12 @@ export const TokenTotalTransactionsCard: FC<{ scope: SearchScope; address: strin const { isLoading, token, isFetched } = useTokenInfo(scope, address) return ( - - - {isLoading ? ( - - ) : ( - isFetched && ( - - {t('common.valuePair', { value: token?.num_transfers })} - - ) - )} - - + + {isLoading ? ( + + ) : ( + isFetched && <>{t('common.valuePair', { value: token?.num_transfers })} + )} + ) }