2021-03-18 05:52:36 -04:00
|
|
|
import { Modal } from 'react-bootstrap'
|
2021-05-07 09:20:55 -04:00
|
|
|
import { useTranslation } from 'react-i18next'
|
2021-03-18 05:52:36 -04:00
|
|
|
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() {
|
2021-05-07 09:20:55 -04:00
|
|
|
const { t } = useTranslation()
|
|
|
|
|
2021-03-18 05:52:36 -04:00
|
|
|
const { isCreatingFile, cancel } = useFileTreeActionable()
|
|
|
|
|
|
|
|
if (!isCreatingFile) {
|
|
|
|
return null
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<FileTreeCreateFormProvider>
|
|
|
|
<AccessibleModal bsSize="large" onHide={cancel} show>
|
|
|
|
<Modal.Header closeButton>
|
2021-05-07 09:20:55 -04:00
|
|
|
<Modal.Title>{t('add_files')}</Modal.Title>
|
2021-03-18 05:52:36 -04:00
|
|
|
</Modal.Header>
|
|
|
|
|
|
|
|
<Modal.Body className="modal-new-file">
|
|
|
|
<FileTreeModalCreateFileBody />
|
|
|
|
</Modal.Body>
|
|
|
|
|
|
|
|
<Modal.Footer>
|
|
|
|
<FileTreeModalCreateFileFooter />
|
|
|
|
</Modal.Footer>
|
|
|
|
</AccessibleModal>
|
|
|
|
</FileTreeCreateFormProvider>
|
|
|
|
)
|
|
|
|
}
|