-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1640 from oasisprotocol/mz/cardCleanUp
Minor styles updates
- Loading branch information
Showing
10 changed files
with
57 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Minor styles updates: | ||
|
||
- remove custom styling in tokens Snapshots cards | ||
- use new prop in Consensus Snapshot cards | ||
- sync table header styles with Figma |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,17 @@ | ||
import { FC } from 'react' | ||
import { useTranslation } from 'react-i18next' | ||
import Box from '@mui/material/Box' | ||
import { SnapshotTextCard } from '../../components/Snapshots/SnapshotCard' | ||
import { useScreenSize } from '../../hooks/useScreensize' | ||
|
||
type SnapshotDelegatorsProps = { | ||
totalDelegators: number | undefined | ||
} | ||
|
||
export const SnapshotDelegators: FC<SnapshotDelegatorsProps> = ({ totalDelegators }) => { | ||
const { t } = useTranslation() | ||
const { isMobile } = useScreenSize() | ||
|
||
return ( | ||
<SnapshotTextCard title={t('validator.delegators')}> | ||
{totalDelegators && <Box sx={{ pb: isMobile ? 3 : 5 }}>{totalDelegators.toLocaleString()}</Box>} | ||
<SnapshotTextCard title={t('validator.delegators')} alignWithCardsWithActions> | ||
{typeof totalDelegators === 'number' && totalDelegators.toLocaleString()} | ||
</SnapshotTextCard> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,34 @@ | ||
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' | ||
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 ( | ||
<SnapshotCard | ||
<SnapshotTextCard | ||
title={t('tokens.totalSupply')} | ||
label={isLoading ? <Skeleton variant="text" sx={{ width: '4em' }} /> : token?.symbol} | ||
> | ||
<Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'center', height: '100%' }}> | ||
{isLoading ? ( | ||
<Skeleton variant="text" sx={{ width: '50%' }} /> | ||
) : ( | ||
isFetched && | ||
token && ( | ||
<Typography | ||
component="span" | ||
sx={{ | ||
fontSize: '32px', | ||
fontWeight: 700, | ||
color: COLORS.brandDark, | ||
textAlign: 'center', | ||
width: '100%', | ||
}} | ||
> | ||
{token.total_supply ? ( | ||
<RoundedBalance value={token.total_supply} compactLargeNumbers /> | ||
) : ( | ||
t('common.not_defined') | ||
)} | ||
</Typography> | ||
) | ||
)} | ||
</Box> | ||
</SnapshotCard> | ||
{isLoading ? ( | ||
<Skeleton variant="text" /> | ||
) : ( | ||
isFetched && | ||
token && ( | ||
<> | ||
{token.total_supply ? ( | ||
<RoundedBalance value={token.total_supply} compactLargeNumbers /> | ||
) : ( | ||
t('common.not_defined') | ||
)} | ||
</> | ||
) | ||
)} | ||
</SnapshotTextCard> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters