mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-24 04:22:10 -05:00
unmount profile modal after update
This commit is contained in:
parent
199eae33d9
commit
ba761becfd
|
|
@ -68,7 +68,6 @@ const sensToString = (sens: number | undefined | null) => {
|
|||
};
|
||||
|
||||
interface Props {
|
||||
isOpen: boolean;
|
||||
onClose: () => void;
|
||||
existingProfile?: NonNullable<
|
||||
GetUserByIdentifierQuery["getUserByIdentifier"]
|
||||
|
|
@ -77,11 +76,7 @@ interface Props {
|
|||
|
||||
type FormData = z.infer<typeof profileSchemaFrontend>;
|
||||
|
||||
const ProfileModal: React.FC<Props> = ({
|
||||
isOpen,
|
||||
onClose,
|
||||
existingProfile,
|
||||
}) => {
|
||||
const ProfileModal: React.FC<Props> = ({ onClose, existingProfile }) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const { handleSubmit, errors, register, watch, control } = useForm<FormData>({
|
||||
|
|
@ -154,12 +149,7 @@ const ProfileModal: React.FC<Props> = ({
|
|||
};
|
||||
|
||||
return (
|
||||
<Modal
|
||||
isOpen={isOpen}
|
||||
onClose={onClose}
|
||||
size="xl"
|
||||
closeOnOverlayClick={false}
|
||||
>
|
||||
<Modal isOpen onClose={onClose} size="xl" closeOnOverlayClick={false}>
|
||||
<ModalOverlay>
|
||||
<ModalContent>
|
||||
<ModalHeader>{t("users;Editing profile")}</ModalHeader>
|
||||
|
|
|
|||
|
|
@ -25,11 +25,12 @@ const Profile: React.FC<Props> = ({ user }) => {
|
|||
{t("users;Edit profile")}
|
||||
</Button>
|
||||
)}
|
||||
<ProfileModal
|
||||
isOpen={showModal}
|
||||
onClose={() => setShowModal(false)}
|
||||
existingProfile={user.profile}
|
||||
/>
|
||||
{showModal && (
|
||||
<ProfileModal
|
||||
onClose={() => setShowModal(false)}
|
||||
existingProfile={user.profile}
|
||||
/>
|
||||
)}
|
||||
{user.profile?.bio && (
|
||||
<Box my="2em">
|
||||
<Markdown value={user.profile.bio} />
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user