Skip to content

Commit

Permalink
Merge pull request #14 from danilo-89/storybook
Browse files Browse the repository at this point in the history
Storybook
  • Loading branch information
danilo-89 authored Mar 29, 2024
2 parents ed1795f + ffdfea7 commit df1b67e
Show file tree
Hide file tree
Showing 7 changed files with 169 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const preview: Preview = {
decorators: [
(Story) => (
<main
className={`${poppins.variable} ${yellowtail.variable} bg-champagne text-wenge`}
className={`${poppins.variable} ${yellowtail.variable} text-wenge`}
style={{
fontFamily: 'Verdana, Arial, Helvetica, sans-serif',
}}
Expand Down
28 changes: 28 additions & 0 deletions stories/InfoMessageWrapper.stories.tsx
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 = {}
20 changes: 20 additions & 0 deletions stories/LoaderDots.stories.tsx
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 = {}
20 changes: 20 additions & 0 deletions stories/LoaderSquare.stories.tsx
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 = {}
59 changes: 59 additions & 0 deletions stories/NFTCard.stories.tsx
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,
}}
/>
</>
)
},
],
}
24 changes: 24 additions & 0 deletions stories/Title.stories.tsx
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 = {}
17 changes: 17 additions & 0 deletions stories/sampleData.ts
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',
},
}

0 comments on commit df1b67e

Please sign in to comment.