From ba761becfd4a89d37d70eb67c75d95602a534e1c Mon Sep 17 00:00:00 2001 From: "Kalle (Sendou)" <38327916+Sendouc@users.noreply.github.com> Date: Sun, 25 Oct 2020 22:37:43 +0200 Subject: [PATCH] unmount profile modal after update --- scenes/Profile/components/ProfileModal.tsx | 14 ++------------ scenes/Profile/index.tsx | 11 ++++++----- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/scenes/Profile/components/ProfileModal.tsx b/scenes/Profile/components/ProfileModal.tsx index 8d11af224..d9cca4005 100644 --- a/scenes/Profile/components/ProfileModal.tsx +++ b/scenes/Profile/components/ProfileModal.tsx @@ -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; -const ProfileModal: React.FC = ({ - isOpen, - onClose, - existingProfile, -}) => { +const ProfileModal: React.FC = ({ onClose, existingProfile }) => { const { t } = useTranslation(); const { handleSubmit, errors, register, watch, control } = useForm({ @@ -154,12 +149,7 @@ const ProfileModal: React.FC = ({ }; return ( - + {t("users;Editing profile")} diff --git a/scenes/Profile/index.tsx b/scenes/Profile/index.tsx index b3e1163ea..b2cf852b4 100644 --- a/scenes/Profile/index.tsx +++ b/scenes/Profile/index.tsx @@ -25,11 +25,12 @@ const Profile: React.FC = ({ user }) => { {t("users;Edit profile")} )} - setShowModal(false)} - existingProfile={user.profile} - /> + {showModal && ( + setShowModal(false)} + existingProfile={user.profile} + /> + )} {user.profile?.bio && (