From d4874168e0ca4a3f35cfe11beec3dfb1d0160d96 Mon Sep 17 00:00:00 2001 From: Hristo Nedelkov Date: Thu, 21 Sep 2023 10:31:43 +0300 Subject: [PATCH] fix: clear code --- .../SyncStatusCards/ConsensusClientCard.tsx | 14 ++++---------- .../SyncStatusCards/ExecutionClientCard.tsx | 12 +++--------- .../Dashboard/SyncStatusCards/SyncStatusCard.tsx | 4 ++-- 3 files changed, 9 insertions(+), 21 deletions(-) diff --git a/src/pages/Dashboard/SyncStatusCards/ConsensusClientCard.tsx b/src/pages/Dashboard/SyncStatusCards/ConsensusClientCard.tsx index 857f571f..9fc140d6 100644 --- a/src/pages/Dashboard/SyncStatusCards/ConsensusClientCard.tsx +++ b/src/pages/Dashboard/SyncStatusCards/ConsensusClientCard.tsx @@ -11,16 +11,16 @@ import StandardGauge from '../../../components/Charts/StandardGauge' type ConsensusCardProps = { value: number total: number - isTop?: boolean + } -const ConsensusCard = ({ value, total, isTop }: ConsensusCardProps) => { +const ConsensusCard = ({ value, total }: ConsensusCardProps) => { const style: CSSProperties = {} const data = [ { id: 'storage', label: 'Used', - value:value, + value: value, color: '#ff6161', }, { @@ -30,13 +30,7 @@ const ConsensusCard = ({ value, total, isTop }: ConsensusCardProps) => { color: '#E7EAEE', }, ] - if (isTop === true) { - style.borderTopLeftRadius = '16px' - style.borderTopRightRadius = '16px' - } else if (isTop === false) { - style.borderBottomLeftRadius = '16px' - style.borderBottomRightRadius = '16px' - } + return ( diff --git a/src/pages/Dashboard/SyncStatusCards/ExecutionClientCard.tsx b/src/pages/Dashboard/SyncStatusCards/ExecutionClientCard.tsx index 75dbbcb3..5fc02387 100644 --- a/src/pages/Dashboard/SyncStatusCards/ExecutionClientCard.tsx +++ b/src/pages/Dashboard/SyncStatusCards/ExecutionClientCard.tsx @@ -11,10 +11,10 @@ import StandardGauge from '../../../components/Charts/StandardGauge' type ExecutionClientCardProps = { value: number total: number - isTop?: boolean + } -const ExecutionClientCard = ({ value, total, isTop }: ExecutionClientCardProps) => { +const ExecutionClientCard = ({ value, total }: ExecutionClientCardProps) => { const data = [ { id: 'storage', @@ -31,13 +31,7 @@ const ExecutionClientCard = ({ value, total, isTop }: ExecutionClientCardProps) ] const style: CSSProperties = {} - if (isTop === true) { - style.borderTopLeftRadius = '16px' - style.borderTopRightRadius = '16px' - } else if (isTop === false) { - style.borderBottomLeftRadius = '16px' - style.borderBottomRightRadius = '16px' - } + return ( diff --git a/src/pages/Dashboard/SyncStatusCards/SyncStatusCard.tsx b/src/pages/Dashboard/SyncStatusCards/SyncStatusCard.tsx index d25b6b94..1e83a2fa 100644 --- a/src/pages/Dashboard/SyncStatusCards/SyncStatusCard.tsx +++ b/src/pages/Dashboard/SyncStatusCards/SyncStatusCard.tsx @@ -15,9 +15,9 @@ const SyncStatusCard = () => { - + - +