mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 17:23:48 -05:00
9daa8f5d98
[web] rename all the JSX files to .jsx/.tsx GitOrigin-RevId: 82056ae47e017523722cf258dcc83c8a925a28f7
39 lines
1.1 KiB
JavaScript
39 lines
1.1 KiB
JavaScript
import React from 'react'
|
|
import PropTypes from 'prop-types'
|
|
import { useProjectContext } from '../../../shared/context/project-context'
|
|
import withErrorBoundary from '../../../infrastructure/error-boundary'
|
|
import CloneProjectModal from './clone-project-modal'
|
|
|
|
const EditorCloneProjectModalWrapper = React.memo(
|
|
function EditorCloneProjectModalWrapper({ show, handleHide, openProject }) {
|
|
const {
|
|
_id: projectId,
|
|
name: projectName,
|
|
tags: projectTags,
|
|
} = useProjectContext()
|
|
|
|
if (!projectName) {
|
|
// wait for useProjectContext
|
|
return null
|
|
} else {
|
|
return (
|
|
<CloneProjectModal
|
|
handleHide={handleHide}
|
|
show={show}
|
|
handleAfterCloned={openProject}
|
|
projectId={projectId}
|
|
projectName={projectName}
|
|
projectTags={projectTags}
|
|
/>
|
|
)
|
|
}
|
|
}
|
|
)
|
|
|
|
EditorCloneProjectModalWrapper.propTypes = {
|
|
handleHide: PropTypes.func.isRequired,
|
|
show: PropTypes.bool.isRequired,
|
|
openProject: PropTypes.func.isRequired,
|
|
}
|
|
|
|
export default withErrorBoundary(EditorCloneProjectModalWrapper)
|