2022-08-01 20:43:17 -07:00
|
|
|
import { ModalProps } from '../../types/modal'
|
|
|
|
import Modal from '../shared/Modal'
|
2022-10-07 04:47:15 -07:00
|
|
|
import CreateAccountForm from '@components/account/CreateAccountForm'
|
2022-11-02 01:58:40 -07:00
|
|
|
import { useRouter } from 'next/router'
|
2022-08-01 20:43:17 -07:00
|
|
|
|
2022-10-07 04:47:15 -07:00
|
|
|
const CreateAccountModal = ({ isOpen, onClose }: ModalProps) => {
|
2022-11-02 01:58:40 -07:00
|
|
|
const router = useRouter()
|
|
|
|
|
|
|
|
const handleClose = () => {
|
2022-11-18 09:09:39 -08:00
|
|
|
if (router.asPath !== '/') {
|
2022-11-02 01:58:40 -07:00
|
|
|
router.push('/')
|
|
|
|
}
|
|
|
|
onClose()
|
|
|
|
}
|
|
|
|
|
2022-08-01 20:43:17 -07:00
|
|
|
return (
|
|
|
|
<Modal isOpen={isOpen} onClose={onClose}>
|
2023-09-12 22:19:10 -07:00
|
|
|
<div className="flex min-h-[338px] flex-col justify-between">
|
2023-09-05 11:50:12 -07:00
|
|
|
<CreateAccountForm customClose={handleClose} />
|
2022-08-01 20:43:17 -07:00
|
|
|
</div>
|
|
|
|
</Modal>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-08-11 21:20:17 -07:00
|
|
|
export default CreateAccountModal
|