Skip to content

Commit

Permalink
馃拕 MaturityPool: move totals to tooltip and rearrange columns
Browse files Browse the repository at this point in the history
  • Loading branch information
sebipap committed May 21, 2024
1 parent f722000 commit fb4b36c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 16 deletions.
37 changes: 23 additions & 14 deletions components/asset/MaturityPool/MaturityPoolsTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,11 @@ const MaturityPoolsTable: FC<MaturityPoolsTableProps> = ({ symbol }) => {
title={t('Maturity')}
tooltipTitle={t('All fixed pools are due at {{hour}}.', { hour: getHourUTC2Local() })}
/>
<HeadCell title={t('Deposits')} />
<HeadCell title={t('Borrows')} />
<HeadCell
title={t('Deposit APR')}
tooltipTitle={t('The fixed interest APR for a deposit up to the optimal deposit size.')}
/>
<TableCell />
<HeadCell
title={t('Borrow APR')}
tooltipTitle={t('The fixed borrowing interest APR at current utilization level.')}
Expand All @@ -75,19 +74,17 @@ const MaturityPoolsTable: FC<MaturityPoolsTableProps> = ({ symbol }) => {
<TableCell component="th" scope="row" width={120} sx={{ pl: 1.5 }}>
{parseTimestamp(maturity, "MMM DD, 'YY")}
</TableCell>
<TableCell align="left" width={80}>
${totalDeposited}
</TableCell>
<TableCell align="left" width={75}>
${totalBorrowed}
</TableCell>
<TableCell align="left" width={65}>
{toPercentage(depositAPR > minAPRValue ? depositAPR : undefined)}
</TableCell>
<TableCell align="left" width={50}>
{toPercentage(borrowAPR > minAPRValue ? borrowAPR : undefined)}
<TableCell>
<Tooltip
title={`${t('Total deposited: ')}${totalDeposited}`}
sx={{ display: 'flex', flexDirection: 'row', gap: 1 }}
placement="top"
arrow
>
<Typography>{toPercentage(depositAPR > minAPRValue ? depositAPR : undefined)}</Typography>
</Tooltip>
</TableCell>
<TableCell align="right" size="small" sx={{ cursor: 'default' }}>
<TableCell>
<Button
data-testid={`fixed-${maturity}-deposit-${symbol}`}
disabled={depositAPR < minAPRValue}
Expand All @@ -105,6 +102,18 @@ const MaturityPoolsTable: FC<MaturityPoolsTableProps> = ({ symbol }) => {
>
{t('Deposit')}
</Button>
</TableCell>
<TableCell>
<Tooltip
title={`${t('Total borrowed: ')}${totalBorrowed}`}
sx={{ display: 'flex', flexDirection: 'row', gap: 1 }}
placement="top"
arrow
>
<Typography>{toPercentage(borrowAPR > minAPRValue ? borrowAPR : undefined)}</Typography>
</Tooltip>
</TableCell>
<TableCell size="small" sx={{ cursor: 'default' }}>
<Button
data-testid={`fixed-${maturity}-borrow-${symbol}`}
disabled={borrowAPR < minAPRValue}
Expand Down
5 changes: 3 additions & 2 deletions i18n/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
"Amount of tokens {{action}} in the pool": "Monto de tokens {{action}} en el pool",
"Value": "Valor",
"Collateral": "Colateral",
"You are connected to a different network": "Est谩s conectado a una red diferente",
"You can't disable collateral on this asset because you have an active borrow": "No puedes deshabilitar el colateral en este activo porque tienes un pr茅stamo pendiente",
"Disabling this collateral will make your health factor less than 1": "Desactivar este colateral hara que su factor de salud sea menor a 1",
"Disabling this asset as collateral affects your borrowing power and Health Factor": "Desactivar este activo como colateral afectar谩 su poder de prestamo y factor de salud",
Expand Down Expand Up @@ -633,5 +632,7 @@
"Repay Amount": "Monto a Pagar",
"Join the waitlist": "脷nete a la lista de espera",
"The first onchain debit & credit card.": "La primer tarjeta de d茅bito y cr茅dito onchain.",
"Please set this asset as collateral in your dashboard": "Por favor, establece este activo como colateral en tu panel de control"
"Please set this asset as collateral in your dashboard": "Por favor, establece este activo como colateral en tu panel de control",
"Total deposited: ": "Total depositado",
"Total borrowed: ": "Total prestado"
}

0 comments on commit fb4b36c

Please sign in to comment.