From 000cf5791238951a614f3f7f89beb258ab362b2e Mon Sep 17 00:00:00 2001 From: Theophile Sandoz Date: Sat, 15 Jun 2024 12:25:13 +0200 Subject: [PATCH] Improve account components stories --- .../components/AccountInfo.stories.tsx | 8 ++++--- .../components/AnonymousAccount.stories.tsx | 21 +++++++++++-------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/packages/ui/src/accounts/components/AccountInfo.stories.tsx b/packages/ui/src/accounts/components/AccountInfo.stories.tsx index 6c2be88579..a5c92da0bd 100644 --- a/packages/ui/src/accounts/components/AccountInfo.stories.tsx +++ b/packages/ui/src/accounts/components/AccountInfo.stories.tsx @@ -1,10 +1,10 @@ import { Meta } from '@storybook/react' -import { AccountInfo as Component } from './AccountInfo' +import { AccountInfo } from './AccountInfo' export default { title: 'Accounts/AccountInfo', - component: Component, + component: AccountInfo, args: { account: { name: 'Alice', @@ -14,4 +14,6 @@ export default { }, } as Meta -export const AccountInfo = {} +export const Default = { + name: 'AccountInfo', +} diff --git a/packages/ui/src/accounts/components/AnonymousAccount.stories.tsx b/packages/ui/src/accounts/components/AnonymousAccount.stories.tsx index 3f395aedd1..4d575020d6 100644 --- a/packages/ui/src/accounts/components/AnonymousAccount.stories.tsx +++ b/packages/ui/src/accounts/components/AnonymousAccount.stories.tsx @@ -1,11 +1,11 @@ -import { Meta, StoryFn } from '@storybook/react' +import { Meta, StoryObj } from '@storybook/react' import BN from 'bn.js' import React from 'react' import { Row } from '@/common/components/storybookParts/previewStyles' import { joy } from '@/mocks/helpers' -import { AnonymousAccount as Component } from './AnonymousAccount' +import { AnonymousAccount } from './AnonymousAccount' type Args = { address: string @@ -14,16 +14,19 @@ type Args = { export default { title: 'Accounts/AnonymousAccount', - component: Component, + component: AnonymousAccount, args: { address: 'j4VdDQVdwFYfQ2MvEdLT2EYZx4ALPQQ6yMyZopKoZEQmXcJrT', amount: 10, }, } as Meta -export const AnonymousAccount: StoryFn = ({ address, amount }) => ( - - - - -) +export const Default: StoryObj = { + name: 'AnonymousAccount', + render: ({ address, amount }) => ( + + + + + ), +}