From 0eebbff4bf4dbb74d65a10e9d4e0950b682ed002 Mon Sep 17 00:00:00 2001 From: Hristo Nedelkov Date: Thu, 21 Sep 2023 09:35:41 +0300 Subject: [PATCH] Fix file structure and style SyncStatus Cards --- .../SyncStatusCards/ConsensusClientCard.tsx | 19 +++++-- .../SyncStatusCards/ExecutionClientCard.tsx | 5 +- .../SyncCardContent.stories.ts | 51 ------------------- .../SyncStatusCards/SyncStatusCard.stories.ts | 19 ------- .../SyncStatusCards/SyncStatusCard.tsx | 4 +- 5 files changed, 18 insertions(+), 80 deletions(-) delete mode 100644 src/pages/Dashboard/SyncStatusCards/SyncCardContent.stories.ts delete mode 100644 src/pages/Dashboard/SyncStatusCards/SyncStatusCard.stories.ts diff --git a/src/pages/Dashboard/SyncStatusCards/ConsensusClientCard.tsx b/src/pages/Dashboard/SyncStatusCards/ConsensusClientCard.tsx index e61968e2..94ce1605 100644 --- a/src/pages/Dashboard/SyncStatusCards/ConsensusClientCard.tsx +++ b/src/pages/Dashboard/SyncStatusCards/ConsensusClientCard.tsx @@ -9,7 +9,6 @@ import Icon from '../../../components/General/Icon' import StandardGauge from '../../../components/Charts/StandardGauge' type ConsensusCardProps = { - title: string value: number total: number isTop?: boolean @@ -25,10 +24,10 @@ const data = [ id: 'storage', label: 'Free', value: 200000, - color: '#E7EAEE', + color: '#E7EAEE', }, ] -const ConsensusCard = ({ title, value, total, isTop }: ConsensusCardProps) => { +const ConsensusCard = ({ value, total, isTop }: ConsensusCardProps) => { const style: CSSProperties = {} if (isTop === true) { @@ -44,9 +43,19 @@ const ConsensusCard = ({ title, value, total, isTop }: ConsensusCardProps) => { - {title} + Consensus Client - + + + + + + diff --git a/src/pages/Dashboard/SyncStatusCards/ExecutionClientCard.tsx b/src/pages/Dashboard/SyncStatusCards/ExecutionClientCard.tsx index b2819e99..3f9dc6e6 100644 --- a/src/pages/Dashboard/SyncStatusCards/ExecutionClientCard.tsx +++ b/src/pages/Dashboard/SyncStatusCards/ExecutionClientCard.tsx @@ -9,7 +9,6 @@ import Icon from '../../../components/General/Icon' import StandardGauge from '../../../components/Charts/StandardGauge' type ExecutionClientCardProps = { - title: string value: number total: number isTop?: boolean @@ -28,7 +27,7 @@ const data = [ color: '#E7EAEE', }, ] -const ExecutionClientCard = ({ title, value, total, isTop }: ExecutionClientCardProps) => { +const ExecutionClientCard = ({ value, total, isTop }: ExecutionClientCardProps) => { const style: CSSProperties = {} if (isTop === true) { @@ -44,7 +43,7 @@ const ExecutionClientCard = ({ title, value, total, isTop }: ExecutionClientCard - {title} + Execution Client diff --git a/src/pages/Dashboard/SyncStatusCards/SyncCardContent.stories.ts b/src/pages/Dashboard/SyncStatusCards/SyncCardContent.stories.ts deleted file mode 100644 index 045d2054..00000000 --- a/src/pages/Dashboard/SyncStatusCards/SyncCardContent.stories.ts +++ /dev/null @@ -1,51 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/react' - -import SyncCardContent from './ExecutionClientCard' - -const meta = { - title: 'Dashboard/SyncCardContent', - component: SyncCardContent, - parameters: { - layout: 'centered', - }, - tags: ['autodocs'], -} satisfies Meta - -export default meta -type Story = StoryObj - -export const ExecutionClient: Story = { - args: { title: 'Execution Client', value: 123.424, total: 170, isTop: true }, -} - -export const ConsensusClient: Story = { - args: { title: 'Consensus Client', value: 123.424, total: 170, isTop: false }, -} - -export const WithoutTitle: Story = { - args: { title: '', value: 123.424, total: 170 }, -} - -export const WithZeroValue: Story = { - args: { title: 'Consensus Client', value: 0, total: 170 }, -} - -export const WithZeroTotal: Story = { - args: { title: 'Consensus Client', value: 123.424, total: 0 }, -} - -export const WithZeroValueAndTotal: Story = { - args: { title: 'Consensus Client', value: 0, total: 0 }, -} - -export const WithoutValues: Story = { - args: { title: '', value: 0, total: 0 }, -} - -export const WithTopBorders: Story = { - args: { title: '', value: 0, total: 0, isTop: true }, -} - -export const WithBottomBorders: Story = { - args: { title: '', value: 0, total: 0, isTop: false }, -} diff --git a/src/pages/Dashboard/SyncStatusCards/SyncStatusCard.stories.ts b/src/pages/Dashboard/SyncStatusCards/SyncStatusCard.stories.ts deleted file mode 100644 index 874c40c2..00000000 --- a/src/pages/Dashboard/SyncStatusCards/SyncStatusCard.stories.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/react' - -import SyncStatusCard from './SyncStatusCard' - -const meta = { - title: 'Dashboard/SyncStatusCard', - component: SyncStatusCard, - parameters: { - layout: 'centered', - }, - tags: ['autodocs'], -} satisfies Meta - -export default meta -type Story = StoryObj - -export const Default: Story = { - args: {}, -} diff --git a/src/pages/Dashboard/SyncStatusCards/SyncStatusCard.tsx b/src/pages/Dashboard/SyncStatusCards/SyncStatusCard.tsx index 72db87da..6fe7a4b4 100644 --- a/src/pages/Dashboard/SyncStatusCards/SyncStatusCard.tsx +++ b/src/pages/Dashboard/SyncStatusCards/SyncStatusCard.tsx @@ -15,9 +15,9 @@ const SyncStatusCard = () => { - + - +