Enable React add files modal for all users (#3941)

GitOrigin-RevId: 923bf41a8c5e9f0932a1711530446dfd5c8d0d7f
This commit is contained in:
Alf Eaton 2021-04-22 10:52:18 +01:00 committed by Copybot
parent 5cec4420dc
commit ff62a7e63c
2 changed files with 2 additions and 14 deletions

View file

@ -864,8 +864,7 @@ const ProjectController = {
req.query && req.query.new_navigation_ui === 'true',
showReactFileTree: !wantsOldFileTreeUI,
showReactShareModal: !wantsOldShareModalUI,
showReactAddFilesModal:
user.betaProgram && !wantsOldAddFilesModalUI,
showReactAddFilesModal: !wantsOldAddFilesModalUI,
showReactGithubSync: !wantsOldGithubSyncUI && user.alphaProgram
})
timer.done()

View file

@ -1,34 +1,23 @@
import React from 'react'
import { useTranslation } from 'react-i18next'
import { Modal } from 'react-bootstrap'
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'
import BetaBadge from '../../../../shared/components/beta-badge'
export default function FileTreeModalCreateFile() {
const { isCreatingFile, cancel } = useFileTreeActionable()
const { t } = useTranslation()
if (!isCreatingFile) {
return null
}
const tooltip = {
id: 'create-file-beta-tooltip',
text: t('beta_badge_tooltip', { feature: 'adding files' })
}
return (
<FileTreeCreateFormProvider>
<AccessibleModal bsSize="large" onHide={cancel} show>
<Modal.Header closeButton>
<Modal.Title>
Add Files &nbsp;
<BetaBadge tooltip={tooltip} />
</Modal.Title>
<Modal.Title>Add Files</Modal.Title>
</Modal.Header>
<Modal.Body className="modal-new-file">