overleaf/services/web/frontend/stories/git-bridge-modal.stories.js
Timothée Alby 6e704d2919 Merge pull request #7837 from overleaf/ta-storybook-context-fix
Storybook Fixes

GitOrigin-RevId: b2f80cec162d3d78d41a8864f9021f58370db37e
2022-05-17 08:03:16 +00:00

48 lines
1 KiB
JavaScript

import { ContextRoot } from '../js/shared/context/root-context'
import importOverleafModules from '../macros/import-overleaf-module.macro'
import useFetchMock from './hooks/use-fetch-mock'
const [
{
import: { default: GitBridgeModal },
},
] = importOverleafModules('gitBridge')
export const GitBridgeUrlModal = args => <GitBridgeModal {...args} />
GitBridgeUrlModal.args = {
type: 'show_url',
}
export const CollaboratorModal = args => <GitBridgeModal {...args} />
CollaboratorModal.args = {
type: 'collaborator',
}
export const TeaserModal = args => {
useFetchMock(fetchMock => fetchMock.post('express:/event/:key', 202))
return <GitBridgeModal {...args} />
}
TeaserModal.args = {
type: 'teaser',
}
export default {
title: 'Editor / Modals / Git Bridge',
component: GitBridgeModal,
args: {
show: true,
},
argTypes: {
handleHide: { action: 'handleHide' },
},
decorators: [
Story => (
<>
<ContextRoot ide={window._ide} settings={{}}>
<Story />
</ContextRoot>
</>
),
],
}