-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from danilo-89/storybook
Storybook
- Loading branch information
Showing
7 changed files
with
169 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import type { Meta, StoryObj } from '@storybook/react' | ||
|
||
// Components | ||
import InfoMessageWrapper from '@/components/sections/SectionMint/InfoMessageWrapper' | ||
|
||
const meta = { | ||
title: 'InfoMessageWrapper', | ||
component: InfoMessageWrapper, | ||
parameters: { | ||
layout: 'centered', | ||
}, | ||
tags: ['autodocs'], | ||
argTypes: {}, | ||
args: { | ||
isActionRequired: true, | ||
isError: false, | ||
isLoading: false, | ||
isMetadataLoading: false, | ||
isSuccess: false, | ||
children: | ||
'Lorem ipsum dolor sit amet consectetur adipisicing elit. Sunt magni repellendus blanditiis iusto. Fugiat, quos.', | ||
}, | ||
} satisfies Meta<typeof InfoMessageWrapper> | ||
|
||
export default meta | ||
type Story = StoryObj<typeof meta> | ||
|
||
export const Default: Story = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import type { Meta, StoryObj } from '@storybook/react' | ||
|
||
// Components | ||
import LoaderDots from '../components/common/LoaderDots' | ||
|
||
const meta = { | ||
title: 'Loaders/LoaderDots', | ||
component: LoaderDots, | ||
parameters: { | ||
layout: 'centered', | ||
}, | ||
tags: ['autodocs'], | ||
argTypes: {}, | ||
args: {}, | ||
} satisfies Meta<typeof LoaderDots> | ||
|
||
export default meta | ||
type Story = StoryObj<typeof meta> | ||
|
||
export const Default: Story = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import type { Meta, StoryObj } from '@storybook/react' | ||
|
||
// Components | ||
import LoaderSquare from '../components/common/LoaderSquare' | ||
|
||
const meta = { | ||
title: 'Loaders/LoaderSquare', | ||
component: LoaderSquare, | ||
parameters: { | ||
layout: 'centered', | ||
}, | ||
tags: ['autodocs'], | ||
argTypes: {}, | ||
args: {}, | ||
} satisfies Meta<typeof LoaderSquare> | ||
|
||
export default meta | ||
type Story = StoryObj<typeof meta> | ||
|
||
export const Default: Story = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import type { Meta, StoryObj } from '@storybook/react' | ||
import { useArgs } from '@storybook/preview-api' | ||
|
||
// Components | ||
import NftCard from '@/components/NftCard' | ||
import Button from '@/components/common/Button' | ||
|
||
// Sample data | ||
import { nftCardData } from './sampleData' | ||
|
||
const meta = { | ||
title: 'NftCard', | ||
component: NftCard, | ||
parameters: { | ||
layout: 'centered', | ||
}, | ||
tags: ['autodocs'], | ||
argTypes: {}, | ||
args: { | ||
data: nftCardData, | ||
}, | ||
} satisfies Meta<typeof NftCard> | ||
|
||
export default meta | ||
type Story = StoryObj<typeof meta> | ||
|
||
export const Default: Story = {} | ||
|
||
export const TestFlip: Story = { | ||
args: {}, | ||
decorators: [ | ||
(Story) => { | ||
const [args, updateArgs] = useArgs() | ||
|
||
return ( | ||
<> | ||
<div className="flex justify-center py-5"> | ||
<Button | ||
type="button" | ||
variation="transparent" | ||
onClick={() => | ||
updateArgs({ | ||
data: { ...nftCardData }, | ||
}) | ||
} | ||
> | ||
flip it | ||
</Button> | ||
</div> | ||
<Story | ||
args={{ | ||
...args, | ||
}} | ||
/> | ||
</> | ||
) | ||
}, | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import type { Meta, StoryObj } from '@storybook/react' | ||
|
||
// Components | ||
import Title from '../components/common/Title' | ||
|
||
const meta = { | ||
title: 'Title', | ||
component: Title, | ||
parameters: { | ||
layout: 'centered', | ||
}, | ||
tags: ['autodocs'], | ||
argTypes: {}, | ||
args: { | ||
title: 'Lorem Ipsum', | ||
children: | ||
'Lorem ipsum dolor sit amet consectetur adipisicing elit. Sunt magni repellendus blanditiis iusto. Fugiat, quos.', | ||
}, | ||
} satisfies Meta<typeof Title> | ||
|
||
export default meta | ||
type Story = StoryObj<typeof meta> | ||
|
||
export const Default: Story = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export const nftCardData = { | ||
id: { | ||
tokenId: '9', | ||
}, | ||
title: 'lorem ipsum', | ||
metadata: { | ||
external_url: '', | ||
|
||
customImage: '', | ||
customAnimationUrl: '', | ||
name: 'Jasper', | ||
description: | ||
'A calm presence with eyes that reflect ancient wisdom, always watching and pondering.', | ||
image: 'ipfs://QmYEtAwV7PawgJGaLWh2L33qeMWkg6wtQMqkZN5qEApTYv', | ||
background_color: 'E2E3C6', | ||
}, | ||
} |