mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-04 18:54:23 -05:00
69482d9d3c
GitOrigin-RevId: 03f5164d117713efd78c9806bdda6e6d5c90f6dc
44 lines
1.1 KiB
JavaScript
44 lines
1.1 KiB
JavaScript
import React, { useCallback, useState } from 'react'
|
|
import PropTypes from 'prop-types'
|
|
import CloneProjectModalContent from './clone-project-modal-content'
|
|
import AccessibleModal from '../../../shared/components/accessible-modal'
|
|
import withErrorBoundary from '../../../infrastructure/error-boundary'
|
|
|
|
const CloneProjectModal = React.memo(function CloneProjectModal({
|
|
show,
|
|
handleHide,
|
|
openProject,
|
|
}) {
|
|
const [inFlight, setInFlight] = useState(false)
|
|
|
|
const onHide = useCallback(() => {
|
|
if (!inFlight) {
|
|
handleHide()
|
|
}
|
|
}, [handleHide, inFlight])
|
|
|
|
return (
|
|
<AccessibleModal
|
|
animation
|
|
show={show}
|
|
onHide={onHide}
|
|
id="clone-project-modal"
|
|
backdrop="static"
|
|
>
|
|
<CloneProjectModalContent
|
|
handleHide={onHide}
|
|
inFlight={inFlight}
|
|
setInFlight={setInFlight}
|
|
openProject={openProject}
|
|
/>
|
|
</AccessibleModal>
|
|
)
|
|
})
|
|
|
|
CloneProjectModal.propTypes = {
|
|
handleHide: PropTypes.func.isRequired,
|
|
show: PropTypes.bool.isRequired,
|
|
openProject: PropTypes.func.isRequired,
|
|
}
|
|
|
|
export default withErrorBoundary(CloneProjectModal)
|