-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add delete workspace modal storybook
- Loading branch information
1 parent
1b43b53
commit 39d124c
Showing
2 changed files
with
39 additions
and
11 deletions.
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
38 changes: 38 additions & 0 deletions
38
frontend/src/features/workspace/components/WorkspaceModals/DeleteWorkspaceModal.stories.tsx
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,38 @@ | ||
import { useDisclosure } from '@chakra-ui/react' | ||
import { Meta, Story } from '@storybook/react' | ||
|
||
import { userHandlers } from '~/mocks/msw/handlers/user' | ||
|
||
import { getMobileViewParameters } from '~utils/storybook' | ||
|
||
import { | ||
DeleteWorkspaceModal, | ||
DeleteWorkspaceModalProps, | ||
} from '../WorkspaceModals/DeleteWorkspaceModal' | ||
|
||
export default { | ||
title: 'Pages/WorkspacePage/DeleteWorkspaceModal', | ||
component: DeleteWorkspaceModal, | ||
parameters: { | ||
layout: 'fullscreen', | ||
// Prevent flaky tests due to modal animating in. | ||
chromatic: { pauseAnimationAtEnd: true }, | ||
msw: userHandlers({ delay: 0 }), | ||
}, | ||
} as Meta | ||
|
||
const Template: Story<DeleteWorkspaceModalProps> = (args) => { | ||
const modalProps = useDisclosure({ defaultIsOpen: true }) | ||
|
||
return ( | ||
<DeleteWorkspaceModal | ||
{...args} | ||
{...modalProps} | ||
onClose={() => console.log('close modal')} | ||
/> | ||
) | ||
} | ||
export const DeleteWorkspace = Template.bind({}) | ||
|
||
export const DeleteWorkspaceMobile = Template.bind({}) | ||
DeleteWorkspaceMobile.parameters = getMobileViewParameters() |