overleaf/services/web/frontend/js/features/file-tree/components/modals/file-tree-modal-create-file.jsx
Rebeka Dekany abb59e4603 Merge pull request #20298 from overleaf/rd-ide-filetree
[web] Migrate the file tree on the editor page to Bootstrap 5

GitOrigin-RevId: e2efec26242c8cdab37a54bc182b83bfb0f1eb3c
2024-09-26 08:05:43 +00:00

39 lines
1.2 KiB
JavaScript

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 OLModal, {
OLModalBody,
OLModalFooter,
OLModalHeader,
OLModalTitle,
} from '@/features/ui/components/ol/ol-modal'
export default function FileTreeModalCreateFile() {
const { t } = useTranslation()
const { isCreatingFile, cancel } = useFileTreeActionable()
if (!isCreatingFile) {
return null
}
return (
<FileTreeCreateFormProvider>
<OLModal size="lg" onHide={cancel} show>
<OLModalHeader closeButton>
<OLModalTitle>{t('add_files')}</OLModalTitle>
</OLModalHeader>
<OLModalBody className="modal-new-file">
<FileTreeModalCreateFileBody />
</OLModalBody>
<OLModalFooter>
<FileTreeModalCreateFileFooter />
</OLModalFooter>
</OLModal>
</FileTreeCreateFormProvider>
)
}