Mp 3443 sage feedback pre mars v 2 credit manager (#522)

This commit is contained in:
Linkie Link 2023-10-03 15:54:11 +02:00 committed by GitHub
parent 7056e8240e
commit 7864b579cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 7 deletions

View File

@ -9,7 +9,7 @@ export default function Skeleton() {
<div className='flex flex-wrap justify-center w-full py-4'>
<HealthGauge health={0} />
<Text size='2xs' className='mb-0.5 mt-1 w-full text-center text-white/50'>
Account Health
Health
</Text>
</div>
<div className='flex flex-wrap justify-center w-full py-4 border-t border-white/20'>

View File

@ -85,7 +85,8 @@ function AccountDetails(props: Props) {
[lendingAvailableAssets, accountLentAssets],
)
const apr = useMemo(
() => calculateAccountApr(account, borrowAssetsData, lendingAssetsData, prices),
() =>
calculateAccountApr(updatedAccount ?? account, borrowAssetsData, lendingAssetsData, prices),
[account, borrowAssetsData, lendingAssetsData, prices],
)
@ -124,7 +125,7 @@ function AccountDetails(props: Props) {
<div className='flex flex-wrap justify-center w-full py-4'>
<HealthGauge health={health} updatedHealth={updatedHealth} />
<Text size='2xs' className='mb-0.5 mt-1 w-full text-center text-white/50'>
Account Health
Health
</Text>
</div>
<div className='w-full py-4 border-t border-white/20'>

View File

@ -6,7 +6,7 @@ export default function BorrowIntro() {
text={
<>
<span className='text-white'>Borrow</span> assets, against your collateral. But always
have an eye on your Account Health. Once it reaches zero, you&apos;ll be liquidated.
have an eye on your Health. Once it reaches zero, you&apos;ll be liquidated.
</>
}
bg='borrow'

View File

@ -1,6 +1,6 @@
export default function useHealthColorAndLabel(health: number, colorPrefix: 'fill' | 'text') {
if (health > 30) return [`${colorPrefix}-violet-500`, 'Healthy']
if (health > 10) return [`${colorPrefix}-yellow-300`, 'Attention']
if (health > 30) return [`${colorPrefix}-violet-500`, `${health}% (Healthy)`]
if (health > 10) return [`${colorPrefix}-yellow-300`, `${health}% (Attention)`]
return [`${colorPrefix}-martian-red`, 'Liquidation risk']
return [`${colorPrefix}-martian-red`, `${health}% (Liquidation risk)`]
}