Skip to content

Commit

Permalink
🚑️ assets: fix 3d chart and alert
Browse files Browse the repository at this point in the history
  • Loading branch information
franm91 committed Apr 17, 2024
1 parent 56affe9 commit 6ef4ead
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 28 deletions.
56 changes: 29 additions & 27 deletions components/asset/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,33 +222,35 @@ const AssetHeaderInfo: FC<Props> = ({ symbol }) => {
))}
</Grid>
</Grid>
{totalUtilization && borrowableUtilization && totalUtilization > borrowableUtilization && (
<Alert sx={{ width: '100%' }} severity="info">
<Typography variant="body2">
{t(
"The Global Utilization is above {{borrowableUtilization}}, and the remaining liquidity is established as a Liquidity Reserve that can't be borrowed and is only available for withdrawals.",
{
borrowableUtilization: toPercentage(borrowableUtilization, 0),
},
)}
</Typography>
<Typography variant="body2">
<Trans
i18nKey="More info here: <1>reserve-factor</1>."
components={{
1: (
<a
target="_blank"
rel="noreferrer noopener"
href="https://docs.exact.ly/guides/parameters#a.-reserve-factor"
style={{ textDecoration: 'underline' }}
></a>
),
}}
/>
</Typography>
</Alert>
)}
{totalUtilization !== undefined &&
borrowableUtilization !== undefined &&
totalUtilization > borrowableUtilization && (
<Alert sx={{ width: '100%' }} severity="info">
<Typography variant="body2">
{t(
"The Global Utilization is above {{borrowableUtilization}}, and the remaining liquidity is established as a Liquidity Reserve that can't be borrowed and is only available for withdrawals.",
{
borrowableUtilization: toPercentage(borrowableUtilization, 0),
},
)}
</Typography>
<Typography variant="body2">
<Trans
i18nKey="More info here: <1>reserve-factor</1>."
components={{
1: (
<a
target="_blank"
rel="noreferrer noopener"
href="https://docs.exact.ly/guides/parameters#a.-reserve-factor"
style={{ textDecoration: 'underline' }}
></a>
),
}}
/>
</Typography>
</Alert>
)}
</>
);
};
Expand Down
3 changes: 2 additions & 1 deletion hooks/useUtilizationRate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export function useCurrentUtilizationRate(type: 'floating' | 'fixed', symbol: st
if (!marketAccount) return undefined;

const { floatingUtilization: utilization, fixedPools } = marketAccount;
if (!utilization || fixedPools === undefined) {

if (utilization === undefined || fixedPools === undefined) {
return undefined;
}

Expand Down

0 comments on commit 6ef4ead

Please sign in to comment.