mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-30 15:55:09 -05:00
7c97f8ab6e
* Use new JSX runtime and update Babel Node target * Update .eslintrc * Remove React imports GitOrigin-RevId: 559de0267f8f2934c56a860ea8701bb522aa861a
35 lines
1.2 KiB
JavaScript
35 lines
1.2 KiB
JavaScript
import { Modal } from 'react-bootstrap'
|
|
import { useTranslation } from 'react-i18next'
|
|
import { useFileTreeActionable } from '../../contexts/file-tree-actionable'
|
|
import FileTreeCreateFormProvider from '../../contexts/file-tree-create-form'
|
|
import FileTreeModalCreateFileBody from '../file-tree-create/file-tree-modal-create-file-body'
|
|
import FileTreeModalCreateFileFooter from '../file-tree-create/file-tree-modal-create-file-footer'
|
|
import AccessibleModal from '../../../../shared/components/accessible-modal'
|
|
|
|
export default function FileTreeModalCreateFile() {
|
|
const { t } = useTranslation()
|
|
|
|
const { isCreatingFile, cancel } = useFileTreeActionable()
|
|
|
|
if (!isCreatingFile) {
|
|
return null
|
|
}
|
|
|
|
return (
|
|
<FileTreeCreateFormProvider>
|
|
<AccessibleModal bsSize="large" onHide={cancel} show>
|
|
<Modal.Header closeButton>
|
|
<Modal.Title>{t('add_files')}</Modal.Title>
|
|
</Modal.Header>
|
|
|
|
<Modal.Body className="modal-new-file">
|
|
<FileTreeModalCreateFileBody />
|
|
</Modal.Body>
|
|
|
|
<Modal.Footer>
|
|
<FileTreeModalCreateFileFooter />
|
|
</Modal.Footer>
|
|
</AccessibleModal>
|
|
</FileTreeCreateFormProvider>
|
|
)
|
|
}
|