From bef8b40c8bbad0510e0b477452322f6828f95a4b Mon Sep 17 00:00:00 2001 From: Martti Malmi Date: Thu, 5 Oct 2023 15:52:11 +0300 Subject: [PATCH] open also profile banner in modal --- packages/app/src/Pages/ProfilePage.tsx | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/packages/app/src/Pages/ProfilePage.tsx b/packages/app/src/Pages/ProfilePage.tsx index fbc4736b..d1c8d066 100644 --- a/packages/app/src/Pages/ProfilePage.tsx +++ b/packages/app/src/Pages/ProfilePage.tsx @@ -121,7 +121,7 @@ export default function ProfilePage() { const isMe = loginPubKey === id; const [showLnQr, setShowLnQr] = useState(false); const [showProfileQr, setShowProfileQr] = useState(false); - const [showAvatarModal, setShowAvatarModal] = useState(false); + const [modalImage, setModalImage] = useState(""); const aboutText = user?.about || ""; const npub = !id?.startsWith(NostrPrefix.PublicKey) ? hexToBech32(NostrPrefix.PublicKey, id || undefined) : id; @@ -430,12 +430,7 @@ export default function ProfilePage() { function avatar() { return (
- user?.picture && setShowAvatarModal(true)} - className="pointer" - /> + setModalImage(user?.picture || "")} className="pointer" />
{renderIcons()} {!isMe && id && } @@ -513,7 +508,15 @@ export default function ProfilePage() { return ( <>
- {user?.banner && } + {user?.banner && ( + setModalImage(user.banner || "")} + /> + )}
{avatar()} {userDetails()} @@ -527,9 +530,7 @@ export default function ProfilePage() {
{tabContent()}
- {user?.picture && showAvatarModal && ( - setShowAvatarModal(false)} images={[user.picture]} idx={0} /> - )} + {modalImage && setModalImage("")} images={[modalImage]} idx={0} />} ); }