From 0ce8806dee4d2c1215086e4aa6a3aca9adf10336 Mon Sep 17 00:00:00 2001 From: Anton Tranelis Date: Fri, 10 Oct 2025 18:58:47 +0200 Subject: [PATCH] layout improvments --- .../ItemPopupComponents/HeaderView/ActionButtons.tsx | 8 ++++++-- .../ItemPopupComponents/HeaderView/ItemAvatar.tsx | 12 ++++++++---- .../ItemPopupComponents/HeaderView/ItemTitle.tsx | 2 +- .../ItemPopupComponents/HeaderView/QRModal.tsx | 12 ++++++++---- .../ItemPopupComponents/HeaderView/index.tsx | 2 +- lib/src/Components/Profile/ProfileView.tsx | 2 +- 6 files changed, 25 insertions(+), 13 deletions(-) diff --git a/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView/ActionButtons.tsx b/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView/ActionButtons.tsx index ab6f7981..e36e70fe 100644 --- a/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView/ActionButtons.tsx +++ b/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView/ActionButtons.tsx @@ -17,9 +17,13 @@ export function ActionButtons({ item }: ActionButtonsProps) { item.position?.coordinates as [number, number] | undefined, ) + const showNavigationButton = item.layer?.itemType.show_navigation_button ?? true + const showShareButton = item.layer?.itemType.show_share_button ?? true + const isOtherProfile = myProfile.myProfile?.id !== item.id + return ( <> - {item.position?.coordinates && myProfile.myProfile?.id !== item.id && ( + {item.position?.coordinates && isOtherProfile && showNavigationButton && ( )} - {myProfile.myProfile?.id !== item.id && } + {isOtherProfile && showShareButton && } ) } diff --git a/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView/ItemAvatar.tsx b/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView/ItemAvatar.tsx index d5ba0b20..881e7a75 100644 --- a/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView/ItemAvatar.tsx +++ b/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView/ItemAvatar.tsx @@ -8,6 +8,7 @@ import type { Item } from '#types/Item' interface ItemAvatarProps { item: Item big?: boolean + extraLarge?: boolean showQrButton?: boolean onQrClick?: () => void } @@ -15,14 +16,17 @@ interface ItemAvatarProps { export function ItemAvatar({ item, big = false, + extraLarge = false, showQrButton = false, onQrClick, }: ItemAvatarProps) { const appState = useAppState() const [imageLoaded, setImageLoaded] = useState(false) + const imageSize = extraLarge ? 320 : 160 const avatar = - (item.image && appState.assetsApi.url + item.image + '?width=160&heigth=160') ?? + (item.image && + appState.assetsApi.url + item.image + `?width=${imageSize}&heigth=${imageSize}`) ?? item.image_external const hasAvatar = !!avatar @@ -38,12 +42,12 @@ export function ItemAvatar({ if (!hasAvatar) return null + const avatarSize = extraLarge ? 'tw:w-32' : big ? 'tw:w-16' : 'tw:w-10' + return (
diff --git a/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView/QRModal.tsx b/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView/QRModal.tsx index 6702bd3e..436b3a10 100644 --- a/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView/QRModal.tsx +++ b/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView/QRModal.tsx @@ -3,6 +3,7 @@ import QRCode from 'react-qr-code' import DialogModal from '#components/Templates/DialogModal' import { useShareLogic } from './hooks' +import { ItemAvatar } from './ItemAvatar' import { ShareButton } from './ShareButton' import type { Item } from '#types/Item' @@ -21,16 +22,19 @@ export function QRModal({ item, isOpen, onClose }: QRModalProps) { isOpened={isOpen} showCloseButton={true} onClose={onClose} - className='tw:w-[calc(100vw-2rem)] tw:max-w-96' + className='tw:w-[calc(100vw-2rem)] tw:!max-w-96' >
e.stopPropagation()} className='tw:text-center tw:p-4'>

Share your Profile to expand your Network!

-
- +
+ +
+ +
-
+
{inviteLink}
diff --git a/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView/index.tsx b/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView/index.tsx index 12d236ed..5a4828d0 100644 --- a/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView/index.tsx +++ b/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView/index.tsx @@ -32,7 +32,7 @@ export function HeaderView({ const hasAvatar = !!(item.image ?? item.image_external) const isMyProfile = myProfile.myProfile?.id === item.id - const showQrButton = big && isMyProfile + const showQrButton = big && isMyProfile && (item.layer?.itemType.show_qr_button ?? true) return ( <> diff --git a/lib/src/Components/Profile/ProfileView.tsx b/lib/src/Components/Profile/ProfileView.tsx index 0135dd1b..fba3319c 100644 --- a/lib/src/Components/Profile/ProfileView.tsx +++ b/lib/src/Components/Profile/ProfileView.tsx @@ -174,7 +174,7 @@ export function ProfileView({ attestationApi }: { attestationApi?: ItemsApi <>