overleaf/services/web/frontend/stories/git-bridge-modal.stories.js
Alf Eaton 7c97f8ab6e Switch to new JSX runtime (#4225)
* Use new JSX runtime and update Babel Node target
* Update .eslintrc
* Remove React imports

GitOrigin-RevId: 559de0267f8f2934c56a860ea8701bb522aa861a
2021-06-24 02:06:59 +00:00

51 lines
1.1 KiB
JavaScript

import { ContextRoot } from '../js/shared/context/root-context'
import { setupContext } from './fixtures/context'
import importOverleafModules from '../macros/import-overleaf-module.macro'
import useFetchMock from './hooks/use-fetch-mock'
const [
{
import: { default: GitBridgeModal },
},
] = importOverleafModules('gitBridge')
setupContext()
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: 'Modals / Git Bridge',
component: GitBridgeModal,
args: {
show: true,
},
argTypes: {
handleHide: { action: 'handleHide' },
},
decorators: [
Story => (
<>
<ContextRoot ide={window._ide} settings={{}}>
<Story />
</ContextRoot>
</>
),
],
}