2021-03-31 11:46:43 -04:00
|
|
|
import { ContextRoot } from '../js/shared/context/root-context'
|
|
|
|
import { setupContext } from './fixtures/context'
|
|
|
|
import importOverleafModules from '../macros/import-overleaf-module.macro'
|
2021-05-11 10:25:22 -04:00
|
|
|
import useFetchMock from './hooks/use-fetch-mock'
|
2021-03-31 11:46:43 -04:00
|
|
|
|
|
|
|
const [
|
|
|
|
{
|
2021-04-27 03:52:58 -04:00
|
|
|
import: { default: GitBridgeModal },
|
|
|
|
},
|
2021-03-31 11:46:43 -04:00
|
|
|
] = importOverleafModules('gitBridge')
|
|
|
|
|
|
|
|
setupContext()
|
|
|
|
|
|
|
|
export const GitBridgeUrlModal = args => <GitBridgeModal {...args} />
|
|
|
|
GitBridgeUrlModal.args = {
|
2021-04-27 03:52:58 -04:00
|
|
|
type: 'show_url',
|
2021-03-31 11:46:43 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export const CollaboratorModal = args => <GitBridgeModal {...args} />
|
|
|
|
CollaboratorModal.args = {
|
2021-04-27 03:52:58 -04:00
|
|
|
type: 'collaborator',
|
2021-03-31 11:46:43 -04:00
|
|
|
}
|
|
|
|
|
2021-05-11 10:25:22 -04:00
|
|
|
export const TeaserModal = args => {
|
|
|
|
useFetchMock(fetchMock => fetchMock.post('express:/event/:key', 202))
|
|
|
|
|
|
|
|
return <GitBridgeModal {...args} />
|
|
|
|
}
|
2021-03-31 11:46:43 -04:00
|
|
|
TeaserModal.args = {
|
2021-04-27 03:52:58 -04:00
|
|
|
type: 'teaser',
|
2021-03-31 11:46:43 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
2021-05-04 07:36:45 -04:00
|
|
|
title: 'Modals / Git Bridge',
|
2021-03-31 11:46:43 -04:00
|
|
|
component: GitBridgeModal,
|
|
|
|
args: {
|
2021-04-27 03:52:58 -04:00
|
|
|
show: true,
|
2021-03-31 11:46:43 -04:00
|
|
|
},
|
|
|
|
argTypes: {
|
|
|
|
handleHide: { action: 'handleHide' },
|
|
|
|
},
|
|
|
|
decorators: [
|
|
|
|
Story => (
|
|
|
|
<>
|
|
|
|
<ContextRoot ide={window._ide} settings={{}}>
|
|
|
|
<Story />
|
|
|
|
</ContextRoot>
|
|
|
|
</>
|
2021-04-27 03:52:58 -04:00
|
|
|
),
|
|
|
|
],
|
2021-03-31 11:46:43 -04:00
|
|
|
}
|