From 8ba54273b7d93942319211f78ee8e7d345fd66f2 Mon Sep 17 00:00:00 2001 From: "shakespeare.diy" Date: Wed, 2 Sep 2026 22:16:09 +0700 Subject: [PATCH] ShareProfileDialog: no horizontal scroll + canonical share URL - Dialog now sizes to the viewport (w-[calc(100vw-2rem)] max-w-sm) with overflow-hidden and min-w-0 children so the QR + URL never force lateral scroll - Slightly smaller QR (48/52) to fit comfortably in the narrow dialog - Share links/QRs now always anchor to https://skate-spots.org instead of window.location.origin, which in the editor resolves to the sandbox iframe host (the *.iframe.diy URL you saw) Co-authored-by: shakespeare.diy --- src/components/ShareProfileDialog.tsx | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/components/ShareProfileDialog.tsx b/src/components/ShareProfileDialog.tsx index fb501c6..51709c2 100644 --- a/src/components/ShareProfileDialog.tsx +++ b/src/components/ShareProfileDialog.tsx @@ -25,10 +25,11 @@ export function ShareProfileDialog({ open, onOpenChange, npub, displayName }: Sh const [qr, setQr] = useState(null); const [copied, setCopied] = useState(false); - // Prefer the deployed public URL so the link works anywhere; fall back to the - // current origin (dev / self-hosted). - const origin = typeof window !== 'undefined' ? window.location.origin : 'https://skate-spots.org'; - const shareUrl = `${origin}/${npub}`; + // Always anchor to the canonical public site so shared links/QRs point to the + // real domain — never the preview/sandbox iframe host that window.location + // would give us inside the editor. + const CANONICAL_ORIGIN = 'https://skate-spots.org'; + const shareUrl = `${CANONICAL_ORIGIN}/${npub}`; useEffect(() => { if (!open) return; @@ -71,10 +72,10 @@ export function ShareProfileDialog({ open, onOpenChange, npub, displayName }: Sh return ( - - + + - + Share profile @@ -83,12 +84,12 @@ export function ShareProfileDialog({ open, onOpenChange, npub, displayName }: Sh {/* QR */} -
+
{qr ? ( - Profile QR code + Profile QR code ) : ( -
+
)} @@ -97,7 +98,7 @@ export function ShareProfileDialog({ open, onOpenChange, npub, displayName }: Sh {/* URL + copy */}