2022-09-20 22:31:54 -07:00
|
|
|
import { ModalProps } from '../../types/modal'
|
|
|
|
import Modal from '../shared/Modal'
|
|
|
|
import { useTranslation } from 'next-i18next'
|
2022-09-23 03:57:19 -07:00
|
|
|
import { useState } from 'react'
|
2022-09-24 05:07:10 -07:00
|
|
|
import EditNftProfilePic from '@components/profile/EditNftProfilePic'
|
2022-09-20 22:31:54 -07:00
|
|
|
import { EnterBottomExitBottom } from '@components/shared/Transitions'
|
2022-09-23 03:57:19 -07:00
|
|
|
import EditProfileForm from '@components/profile/EditProfileForm'
|
2022-09-20 22:31:54 -07:00
|
|
|
|
|
|
|
const EditProfileModal = ({ isOpen, onClose }: ModalProps) => {
|
|
|
|
const { t } = useTranslation(['common', 'profile'])
|
|
|
|
const [showEditProfilePic, setShowEditProfilePic] = useState(false)
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Modal isOpen={isOpen} onClose={onClose}>
|
|
|
|
<>
|
|
|
|
<h2 className="text-center">{t('profile:edit-profile')}</h2>
|
2022-09-23 03:57:19 -07:00
|
|
|
<EditProfileForm
|
|
|
|
onFinish={onClose}
|
|
|
|
onEditProfileImage={() => setShowEditProfilePic(true)}
|
|
|
|
/>
|
2022-09-20 22:31:54 -07:00
|
|
|
<EnterBottomExitBottom
|
2022-11-02 09:16:25 -07:00
|
|
|
className="absolute bottom-0 left-0 z-20 h-full w-full overflow-auto rounded-lg bg-th-bkg-1 p-6"
|
2022-09-20 22:31:54 -07:00
|
|
|
show={showEditProfilePic}
|
|
|
|
>
|
|
|
|
<EditNftProfilePic onClose={() => setShowEditProfilePic(false)} />
|
|
|
|
</EnterBottomExitBottom>
|
|
|
|
</>
|
|
|
|
</Modal>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default EditProfileModal
|