mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-30 07:45:26 -05:00
199ab985a0
Reorganise Storybook Stories GitOrigin-RevId: 91014f49f84c645f87091724f03a007b731a8ad5
35 lines
955 B
JavaScript
35 lines
955 B
JavaScript
import { useState } from 'react'
|
|
import useFetchMock from './hooks/use-fetch-mock'
|
|
import ContactUsModal from '../../modules/support/frontend/js/components/contact-us-modal'
|
|
import { withContextRoot } from './utils/with-context-root'
|
|
|
|
export const Generic = () => {
|
|
const [show, setShow] = useState(true)
|
|
const handleHide = () => setShow(false)
|
|
|
|
useFetchMock(fetchMock => {
|
|
fetchMock.post('express:/support', { status: 200 }, { delay: 1000 })
|
|
})
|
|
|
|
return withContextRoot(<ContactUsModal show={show} handleHide={handleHide} />)
|
|
}
|
|
|
|
export const RequestError = args => {
|
|
useFetchMock(fetchMock => {
|
|
fetchMock.post('express:/support', { status: 404 }, { delay: 250 })
|
|
})
|
|
|
|
return withContextRoot(<ContactUsModal {...args} />)
|
|
}
|
|
|
|
export default {
|
|
title: 'Shared / Modals / Contact Us',
|
|
component: ContactUsModal,
|
|
args: {
|
|
show: true,
|
|
handleHide: () => {},
|
|
},
|
|
argTypes: {
|
|
handleHide: { action: 'close modal' },
|
|
},
|
|
}
|