Skip to content

Commit

Permalink
test: add new stories
Browse files Browse the repository at this point in the history
  • Loading branch information
sgomez committed Jan 14, 2024
1 parent e5d3cf3 commit a422c05
Show file tree
Hide file tree
Showing 5 changed files with 123 additions and 0 deletions.
Binary file added public/images/avatar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/images/book.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions stories/components/auth-modal.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { Kbd } from '@nextui-org/react'
import { Meta, StoryObj } from '@storybook/react'
import React from 'react'

import AuthModal from '@/components/auth-modal/auth-modal'
import AuthModalFooter from '@/components/auth-modal/auth-modal-footer'
import AuthModalHeader from '@/components/auth-modal/auth-modal-header'

const meta = {
component: AuthModal,
title: 'Components/AuthModal',
} satisfies Meta<typeof AuthModal>

export default meta
type Story = StoryObj<typeof meta>

export const Basic: Story = {
args: {
children: (
<>
<AuthModalHeader title="Iniciar sesión en">
Lorem ipsum...
</AuthModalHeader>
<AuthModalFooter>
Esta plataforma es exclusiva para miembros de la Universidad de
Córdoba. Inicia sesión con tu correo corporativo <Kbd>@uco.es</Kbd>{' '}
para tener acceso.
</AuthModalFooter>
</>
),
},
}
22 changes: 22 additions & 0 deletions stories/components/book-breadcrumbs.stories.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Meta, StoryObj } from '@storybook/react'

import BookBreadcrumbs from '@/components/book-breadcrumbs/book-breadcrumbs'

const meta = {
component: BookBreadcrumbs,
title: 'Components/BookBreadcrumbs',
} satisfies Meta<typeof BookBreadcrumbs>

export default meta
type Story = StoryObj<typeof meta>

export const Basic: Story = {
args: {
title: 'Children',
},
parameters: {
nextjs: {
appDirectory: true,
},
},
}
69 changes: 69 additions & 0 deletions stories/components/book-card.stories.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import { Meta, StoryObj } from '@storybook/react'

import BookCard from '@/components/book-card/book-card'

const meta = {
component: BookCard,
title: 'Components/BookCard',
} satisfies Meta<typeof BookCard>

export default meta
type Story = StoryObj<typeof meta>

export const Available: Story = {
args: {
book: {
authors: ['Jane Doe'],
id: 'book',
image: '/images/book.jpeg',
title: 'A book',
},
},
}

export const Unavailable: Story = {
args: {
book: {
authors: ['Jane Doe'],
id: 'book',
image: '/images/book.jpeg',
loan: {
id: 'load',
startsAt: new Date(),
user: {
id: 'user',
image: '/images/avatar.png',
name: 'Jane Doe',
},
},
title: 'A book',
},
},
}

export const Loaned: Story = {
args: {
book: {
authors: ['Jane Doe'],
id: 'book',
image: '/images/book.jpeg',
loan: {
id: 'load',
startsAt: new Date(),
user: {
id: 'user',
image: '/images/avatar.png',
name: 'Jane Doe',
},
},
title: 'A book',
},
me: {
email: '[email protected]',
id: 'user',
image: '/images/avatar.png',
name: 'Jane Doe',
roles: ['ROLE_USER'],
},
},
}

0 comments on commit a422c05

Please sign in to comment.