Skip to content

Commit

Permalink
fix: adjust font sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick-1979 committed Sep 29, 2024
1 parent 49a9746 commit 89a17bc
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,13 @@ const BalanceRow = ({ api, asset, pricesInCurrencies }: BalanceRowProps) => {
token={asset.token}
/>
</Grid>
<Grid item sx={{ fontSize: '13px', fontWeight: 400, lineHeight: 1 }}>
<FormatPrice
amount={total}
decimals={asset.decimal}
fontSize='13px'
price={pricesInCurrencies?.prices?.[asset.priceId]?.value ?? 0}
/>
</Grid>
<FormatPrice
amount={total}
decimals={asset.decimal}
fontSize='13px'
fontWeight={ 400}
price={pricesInCurrencies?.prices?.[asset.priceId]?.value ?? 0}
/>
</Grid>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@ interface PriceJSXType {
}

const Price = ({ balanceToShow, isPriceOutdated, price }: PriceJSXType) => (
<Grid item sx={{ '> div span': { display: 'block' }, color: isPriceOutdated ? 'primary.light' : 'text.primary', fontWeight: 400 }}>
<FormatPrice
amount={getValue('total', balanceToShow)}
decimals={balanceToShow?.decimal}
price={price}
skeletonHeight={22}
width='80px'
/>
</Grid>
<FormatPrice
amount={getValue('total', balanceToShow)}
decimals={balanceToShow?.decimal}
fontSize='28px'
fontWeight= { 400 }
price={price}
skeletonHeight={22}
textColor={ isPriceOutdated ? 'primary.light' : 'text.primary'}
width='80px'
/>
);

interface BalanceJSXType {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2019-2024 @polkadot/extension-polkagate authors & contributors
// SPDX-License-Identifier: Apache-2.0
// @ts-nocheck

/* eslint-disable react/jsx-max-props-per-line */

Expand All @@ -19,7 +18,7 @@ interface Props {
setAssetId: React.Dispatch<React.SetStateAction<number | undefined>>
}

function AssetSelect({ address, assetId, label, onChange, setAssetId, style }: Props) {
function AssetSelect ({ address, assetId, label, onChange, setAssetId, style }: Props) {
const tokens = useTokens(address);
const assets = useAssetHubAssets(address);
const options = useMemo(() => (tokens || []).concat(assets || []), [assets, tokens]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
/* eslint-disable react/jsx-max-props-per-line */

import type { Balance } from '@polkadot/types/interfaces';
import type { BN } from '@polkadot/util';

import { ArrowForwardIosRounded as ArrowForwardIosRoundedIcon } from '@mui/icons-material';
import { Divider, Grid, IconButton, Typography, useTheme } from '@mui/material';
import React from 'react';

import { BN } from '@polkadot/util';

import { FormatPrice, ShowBalance } from '../../../components';

interface Props {
Expand All @@ -24,7 +23,7 @@ interface Props {
openCollapse?: boolean;
}

export default function DisplayBalance({ amount, decimal, disabled, onClick, price, openCollapse, title, token }: Props): React.ReactElement {
export default function DisplayBalance ({ amount, decimal, disabled, onClick, openCollapse, price, title, token }: Props): React.ReactElement {
const theme = useTheme();

return (
Expand All @@ -43,14 +42,14 @@ export default function DisplayBalance({ amount, decimal, disabled, onClick, pri
/>
</Grid>
<Divider orientation='vertical' sx={{ backgroundColor: 'text.primary', height: '35px', mx: '10px', my: 'auto' }} />
<Grid item sx={{ '> div span': { display: 'block' }, fontSize: '22px', fontWeight: 400 }}>
<FormatPrice
amount={amount}
decimals={decimal}
price={price}
skeletonHeight={20}
/>
</Grid>
<FormatPrice
amount={amount}
decimals={decimal}
fontSize= '22px'
fontWeight= {400}
price={price}
skeletonHeight={20}
/>
{onClick &&
<Grid item m='auto' pl='8px'>
<IconButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ export default function LockedInReferendaFS ({ address, price, refreshNeeded, se
/>
</Grid>
<Divider orientation='vertical' sx={{ backgroundColor: 'text.primary', height: '35px', mx: '10px', my: 'auto' }} />
<Grid item sx={{ '> div span': { display: 'block' }, fontSize: '22px', fontWeight: 400 }}>
<FormatPrice
amount={totalLocked}
decimals={decimal}
price={price}
skeletonHeight={20}
/>
</Grid>
<FormatPrice
amount={totalLocked}
decimals={decimal}
fontSize= '22px'
fontWeight={ 400}
price={price}
skeletonHeight={20}
/>
</Grid>
<Typography fontSize='12px' fontWeight={500} textAlign='right'>
{api && unlockableAmount && !unlockableAmount.isZero()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,11 @@ const TreasuryBalanceStat = ({ address, balance, noDivider, rowDisplay, style, t
<Grid alignItems='center' container item sx={{ fontSize: '18px', fontWeight: 500, height: '36px', letterSpacing: '-0.015em', pt: '10px' }} width='fit-content'>
<ShowBalance api={api} balance={balance} decimal={decimal} decimalPoint={2} token={token} />
</Grid>
<Grid container item sx={{ fontSize: '16px', letterSpacing: '-0.015em' }} width='fit-content'>
<Grid container item width='fit-content'>
<FormatPrice
amount={balance}
decimals={decimal}
fontSize= '16px'
price={tokenPrice}
/>
</Grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,12 @@ export default function ReferendumDescription ({ address, currentTreasuryApprova
/>
</Grid>
<Divider flexItem orientation='vertical' sx={{ bgcolor: theme.palette.mode === 'light' ? 'inherit' : 'text.disabled', mx: '7px', my: '8px' }} />
<Grid item sx={{ color: theme.palette.mode === 'light' ? 'text.disabled' : undefined, opacity: theme.palette.mode === 'dark' ? 0.6 : 1 }}>
<Grid item sx={{ opacity: theme.palette.mode === 'dark' ? 0.6 : 1 }}>
<FormatPrice
decimalPoint={2}
num={requestedInUSD || 0}
sign='$'
textColor={ theme.palette.mode === 'light' ? 'text.disabled' : undefined}
/>
</Grid>
</Grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,14 @@ export default function DisplayBalance ({ actions, address, amount, icons, isUns
/>
</Grid>
<Divider orientation='vertical' sx={{ backgroundColor: 'text.primary', height: '35px', mx: '10px', my: 'auto' }} />
<Grid item sx={{ '> div span': { display: 'block' }, fontSize: '22px', fontWeight: 400 }}>
<FormatPrice
amount={amount}
decimals={decimal}
price={price}
skeletonHeight={20}
/>
</Grid>
<FormatPrice
amount={amount}
decimals={decimal}
fontSize= '22px'
fontWeight= {400}
price={price}
skeletonHeight={20}
/>
</Grid>
<Grid container item justifyContent='flex-end' width='38%'>
{isUnstaking &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,12 @@ export default function LabelBalancePrice ({ address, balances, label, onClick,
withCurrency={false}
/>
</Grid>
<Grid item pt='6px' sx={{ fontSize: label === 'Total' ? '20px' : '16px', fontWeight: label === 'Total' ? 400 : 300, letterSpacing: '-0.015em', lineHeight: '15px' }} textAlign='right'>
<Grid item pt='6px' sx={{ lineHeight: '15px' }} textAlign='right'>
<FormatPrice
amount={value}
decimals={balances?.decimal}
fontSize= {label === 'Total' ? '20px' : '16px'}
fontWeight= {label === 'Total' ? 400 : 300}
price={price}
/>
</Grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,12 @@ export default function ReservedReasons ({ address, assetId, identity, setShow,
balance={value}
/>
</Grid>
<Grid item pt='6px' sx={{ fontSize: '16px', fontWeight: 300, letterSpacing: '-0.015em', lineHeight: '15px' }} textAlign='right'>
<Grid item pt='6px' sx={{ letterSpacing: '-0.015em', lineHeight: '15px' }} textAlign='right'>
<FormatPrice
amount={value}
decimals={decimal}
fontSize= '16px'
fontWeight= {300}
price={price}
/>
</Grid>
Expand Down
15 changes: 8 additions & 7 deletions packages/extension-polkagate/src/popup/home/AccountDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,14 @@ export default function AccountDetail ({ address, chain, goToAccount, hideNumber
<>
{priceChainName === undefined || !balanceToShow || balanceToShow?.chainName?.toLowerCase() !== priceChainName
? <Skeleton animation='wave' height={22} sx={{ my: '2.5px', transform: 'none' }} variant='text' width={80} />
: <Grid item sx={{ color: isPriceOutdated ? 'primary.light' : 'text.primary', fontWeight: 300 }}>
<FormatPrice
amount={getValue('total', balanceToShow)}
decimals={balanceToShow.decimal}
price={price}
/>
</Grid>
: <FormatPrice
amount={getValue('total', balanceToShow)}
decimals={balanceToShow.decimal}
fontSize= '18px'
fontWeight= { 300}
price={price}
textColor= {isPriceOutdated ? 'primary.light' : 'text.primary'}
/>
}
</>
);
Expand Down

0 comments on commit 89a17bc

Please sign in to comment.