overleaf/services/web/frontend/stories/git-bridge-modal.stories.js
Alf Eaton d91ee50762 Standardise scope/context usage in Storybook stories (#7842)
GitOrigin-RevId: 109a4357fc3b083ffbd3af5b8c98acf0f655f297
2022-05-17 08:04:12 +00:00

42 lines
932 B
JavaScript

import importOverleafModules from '../macros/import-overleaf-module.macro'
import { ScopeDecorator } from './decorators/scope'
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 => {
// TODO: mock navigator.sendBeacon?
// 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: [ScopeDecorator],
}