diff --git a/client/src/pages/Businesses.jsx b/client/src/pages/Businesses.jsx index 13a3676..acb314d 100644 --- a/client/src/pages/Businesses.jsx +++ b/client/src/pages/Businesses.jsx @@ -156,33 +156,33 @@ function BusinessCreatedModal({ business, onClose }) { const cdnUrls = extractCdnUrls(business?.scrapeArtifacts?.cdnUrls?.length ? { relevantImagePaths: business.scrapeArtifacts.cdnUrls } : business); const links = normalizeScrapeLinks(business?.scrapeArtifacts?.links); const prettyJson = useMemo(() => formatPrettyJson(business?.scrapeArtifacts?.json), [business]); - const [viewportWidth, setViewportWidth] = useState(() => ( - typeof window === 'undefined' ? 1200 : window.innerWidth - )); useEffect(() => { - if (typeof window === 'undefined') return undefined; + const previousBodyOverflow = document.body.style.overflow; + const previousBodyOverscroll = document.body.style.overscrollBehavior; + const previousHtmlOverflow = document.documentElement.style.overflow; + const previousHtmlOverscroll = document.documentElement.style.overscrollBehavior; - const handleResize = () => setViewportWidth(window.innerWidth); - handleResize(); - window.addEventListener('resize', handleResize); - return () => window.removeEventListener('resize', handleResize); + document.body.style.overflow = 'hidden'; + document.body.style.overscrollBehavior = 'none'; + document.documentElement.style.overflow = 'hidden'; + document.documentElement.style.overscrollBehavior = 'none'; + + return () => { + document.body.style.overflow = previousBodyOverflow; + document.body.style.overscrollBehavior = previousBodyOverscroll; + document.documentElement.style.overflow = previousHtmlOverflow; + document.documentElement.style.overscrollBehavior = previousHtmlOverscroll; + }; }, []); - const preferredWidth = prettyJson - ? 1080 - : cdnUrls.length > 0 || links.length > 0 - ? 860 - : 560; - const modalWidth = Math.max(320, Math.min(viewportWidth - 32, preferredWidth)); - return (
-
+

Business created

{name}

@@ -200,83 +200,85 @@ function BusinessCreatedModal({ business, onClose }) {
-
-
-
-
- {image ? ( - {name} - ) : ( - {name?.[0]?.toUpperCase() || 'B'} - )} -
-
-

{name}

- {domain &&

{domain}

} - {tagline &&

{tagline}

} -
- - {cdnUrls.length} image{cdnUrls.length === 1 ? '' : 's'} - - - {links.length} link{links.length === 1 ? '' : 's'} - +
+
+
+
+
+ {image ? ( + {name} + ) : ( + {name?.[0]?.toUpperCase() || 'B'} + )} +
+
+

{name}

+ {domain &&

{domain}

} + {tagline &&

{tagline}

} +
+ + {cdnUrls.length} image{cdnUrls.length === 1 ? '' : 's'} + + + {links.length} link{links.length === 1 ? '' : 's'} + +
-
- {cdnUrls.length > 0 && ( + {cdnUrls.length > 0 && (

Images

Captured storefront images are available below.

- +
)} - {prettyJson && ( -
-
-

Captured Data

+ {prettyJson && ( +
+
+

Captured Data

Raw storefront data captured during onboarding.

-
+                  
                   {prettyJson}
                 
)} - {links.length > 0 && ( -
-
-

Links

+ {links.length > 0 && ( +
+
+

Links

Every discovered storefront link is available below.

-
- {links.map((link, index) => ( - -

{link.label}

-

{link.href}

-
- ))} +
+ {links.map((link, index) => ( + +

{link.label}

+

{link.href}

+
+ ))} +
-
-
- )} +
+ )} +
-
+