From 6946ceddfc4b054ac06306a0d3d1801b64154761 Mon Sep 17 00:00:00 2001 From: Linkie Link Date: Wed, 14 Feb 2024 14:18:10 +0100 Subject: [PATCH] Portfolio fix (#809) * fix: fixed the portfolio account detail page layout * fix: fixed portfolio cards * tidy: refactor --- src/components/account/Health/HealthBar.tsx | 14 ++++++++++---- src/components/account/Health/HealthIcon.tsx | 8 ++++---- src/components/common/Tooltip/index.tsx | 4 ++-- src/components/portfolio/Account/BreadCrumbs.tsx | 4 +++- src/components/portfolio/Card/Skeleton.tsx | 4 ++-- src/components/portfolio/SummarySkeleton.tsx | 10 ++++++---- 6 files changed, 27 insertions(+), 17 deletions(-) diff --git a/src/components/account/Health/HealthBar.tsx b/src/components/account/Health/HealthBar.tsx index 60baafba..ecb19f10 100644 --- a/src/components/account/Health/HealthBar.tsx +++ b/src/components/account/Health/HealthBar.tsx @@ -63,16 +63,22 @@ export default function HealthBar({ health={isUpdated ? updatedHealth : health} healthFactor={isUpdated ? updatedHealthFactor : healthFactor} > - <> +
{showIcon && ( )} -
+
- +
) } diff --git a/src/components/account/Health/HealthIcon.tsx b/src/components/account/Health/HealthIcon.tsx index 858cb0bf..43891b01 100644 --- a/src/components/account/Health/HealthIcon.tsx +++ b/src/components/account/Health/HealthIcon.tsx @@ -5,7 +5,7 @@ import { ExclamationMarkCircled, Heart } from 'components/common/Icons' interface Props { isLoading: boolean health: number - className: string + className?: string colorClass?: string } @@ -14,9 +14,9 @@ export default function HealthIcon(props: Props) { const color = colorClass ?? 'text-white' return ( - <> +
{!isLoading && health === 0 ? ( - + ) : ( )} - +
) } diff --git a/src/components/common/Tooltip/index.tsx b/src/components/common/Tooltip/index.tsx index 85a47f22..1c94c7c1 100644 --- a/src/components/common/Tooltip/index.tsx +++ b/src/components/common/Tooltip/index.tsx @@ -48,7 +48,7 @@ export const Tooltip = (props: Props) => { visible={props.visible} > {props.children ? ( - { )} > {props.children} - +
) : ( Portfolio - +
+ +
Credit Account {props.accountId} ) diff --git a/src/components/portfolio/Card/Skeleton.tsx b/src/components/portfolio/Card/Skeleton.tsx index 3fb0e2e6..838cda79 100644 --- a/src/components/portfolio/Card/Skeleton.tsx +++ b/src/components/portfolio/Card/Skeleton.tsx @@ -2,9 +2,9 @@ import React from 'react' import HealthBar from 'components/account/Health/HealthBar' import Card from 'components/common/Card' -import HLSTag from 'components/hls/HLSTag' import Text from 'components/common/Text' import TitleAndSubCell from 'components/common/TitleAndSubCell' +import HLSTag from 'components/hls/HLSTag' interface Props { stats: { title: React.ReactNode; sub: string }[] @@ -33,7 +33,7 @@ export default function Skeleton(props: Props) { ))} -
+
diff --git a/src/components/portfolio/SummarySkeleton.tsx b/src/components/portfolio/SummarySkeleton.tsx index a8aa1adc..0c665e9d 100644 --- a/src/components/portfolio/SummarySkeleton.tsx +++ b/src/components/portfolio/SummarySkeleton.tsx @@ -3,10 +3,10 @@ import React from 'react' import HealthBar from 'components/account/Health/HealthBar' import HealthIcon from 'components/account/Health/HealthIcon' import Card from 'components/common/Card' -import HLSTag from 'components/hls/HLSTag' import Loading from 'components/common/Loading' import Text from 'components/common/Text' import TitleAndSubCell from 'components/common/TitleAndSubCell' +import HLSTag from 'components/hls/HLSTag' import useAccount from 'hooks/accounts/useAccount' import { DEFAULT_PORTFOLIO_STATS } from 'utils/constants' @@ -31,9 +31,11 @@ export default function SummarySkeleton(props: Props) { {account?.kind === 'high_levered_strategy' && }
{health !== undefined && healthFactor !== undefined && ( -
- - +
+ +
+ +
)}