mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-31 21:21:03 -04:00
9cde88a9e8
[web] Add wrapper for copy modal GitOrigin-RevId: 8291f953e418815797e8474a69de8f15c39af7b5
34 lines
1 KiB
JavaScript
34 lines
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 } = useProjectContext()
|
|
|
|
if (!projectName) {
|
|
// wait for useProjectContext
|
|
return null
|
|
} else {
|
|
return (
|
|
<CloneProjectModal
|
|
handleHide={handleHide}
|
|
show={show}
|
|
handleAfterCloned={openProject}
|
|
projectId={projectId}
|
|
projectName={projectName}
|
|
/>
|
|
)
|
|
}
|
|
}
|
|
)
|
|
|
|
EditorCloneProjectModalWrapper.propTypes = {
|
|
handleHide: PropTypes.func.isRequired,
|
|
show: PropTypes.bool.isRequired,
|
|
openProject: PropTypes.func.isRequired,
|
|
}
|
|
|
|
export default withErrorBoundary(EditorCloneProjectModalWrapper)
|