Skip to content

Commit

Permalink
💄 headers: update align in mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
franm91 committed Mar 26, 2024
1 parent b06f989 commit 9e4ff9b
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 10 deletions.
27 changes: 21 additions & 6 deletions components/asset/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { Address, formatEther, formatUnits } from 'viem';
import useStETHNativeAPR from 'hooks/useStETHNativeAPR';
import { toPercentage } from 'utils/utils';
import { track } from 'utils/mixpanel';
import { Typography } from '@mui/material';
import { Box, Typography } from '@mui/material';
import getSymbolDescription from 'utils/getSymbolDescription';
import useContractAddress from 'hooks/useContractAddress';
import { useWeb3 } from 'hooks/useWeb3';
Expand Down Expand Up @@ -92,7 +92,7 @@ const AssetHeaderInfo: FC<Props> = ({ symbol }) => {
: undefined,
},
{
label: t('Available for Withdrawal'),
label: t('Available'),
value:
floatingBorrows !== undefined &&
fixedBorrows !== undefined &&
Expand All @@ -103,7 +103,22 @@ const AssetHeaderInfo: FC<Props> = ({ symbol }) => {
formatUnits(floatingDeposits + fixedDeposits - (floatingBorrows + fixedBorrows), decimals),
)}`
: undefined,
sx: { textAlign: 'center' },
tooltipTitle: (
<Box display="flex" flexDirection="column" gap={0.5}>
<Typography fontSize={12} fontWeight={500}>
{t('Available for Withdrawal')}
</Typography>
<Typography fontSize={12} color="blue" sx={{ textDecoration: 'underline' }}>
<a
target="_blank"
rel="noreferrer noopener"
href="https://docs.exact.ly/guides/parameters#a.-reserve-factor"
>
{t('Learn more about reserve factor.')}
</a>
</Typography>
</Box>
),
},
{
label: t('Global Utilization'),
Expand All @@ -128,12 +143,12 @@ const AssetHeaderInfo: FC<Props> = ({ symbol }) => {
return { itemsInfo: items, totalUtilization: totalUti };
}, [
marketAccount,
t,
backupBorrows,
floatingBorrows,
floatingDeposits,
fixedDeposits,
floatingBorrows,
t,
fixedBorrows,
backupBorrows,
symbol,
nativeAPR,
]);
Expand Down
2 changes: 1 addition & 1 deletion components/common/ItemInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type ItemInfoProps = {
label: string;
value?: string | React.ReactNode;
underLabel?: string;
tooltipTitle?: string;
tooltipTitle?: string | React.ReactNode;
xs?: number;
sx?: BoxProps['sx'];
};
Expand Down
20 changes: 18 additions & 2 deletions components/markets/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { ItemInfoProps } from 'components/common/ItemInfo';
import formatNumber from 'utils/formatNumber';
import useAccountData from 'hooks/useAccountData';
import { toPercentage } from 'utils/utils';
import { Box, Typography } from '@mui/material';

const MarketsHeader: FC = () => {
const { t } = useTranslation();
Expand Down Expand Up @@ -73,9 +74,24 @@ const MarketsHeader: FC = () => {
value: totalBorrowed ? `$${formatNumber(formatUnits(totalBorrowed, 18))}` : undefined,
},
{
label: t('Available for Withdrawal'),
label: t('Available'),
value: totalAvailable ? `$${formatNumber(formatUnits(totalAvailable, 18))}` : undefined,
sx: { textAlign: 'center' },
tooltipTitle: (
<Box display="flex" flexDirection="column" gap={0.5}>
<Typography fontSize={12} fontWeight={500}>
{t('Available for Withdrawal')}
</Typography>
<Typography fontSize={12} color="blue" sx={{ textDecoration: 'underline' }}>
<a
target="_blank"
rel="noreferrer noopener"
href="https://docs.exact.ly/guides/parameters#a.-reserve-factor"
>
{t('Learn more about reserve factor.')}
</a>
</Typography>
</Box>
),
},
{
label: t('Global Utilization'),
Expand Down
3 changes: 2 additions & 1 deletion i18n/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -617,5 +617,6 @@
"Term Structure of Interest Rates": "Estructura de Plazos de Tasas de Interés",
"Rate": "Tasa",
"Min": "Mín",
"Variable APR, Utilization and Global Utilization": "TNA Variable, Utilización y Utilización Global"
"Variable APR, Utilization and Global Utilization": "TNA Variable, Utilización y Utilización Global",
"Learn more about reserve factor.": "Aprende más sobre el factor de reserva."
}

0 comments on commit 9e4ff9b

Please sign in to comment.