fix SSR gallery

This commit is contained in:
Chuck Dries 2022-11-17 19:34:07 -08:00
parent 65f793dde4
commit d28ee00866
No known key found for this signature in database
GPG Key ID: A00B7AEAE1DC5BE6

View File

@ -51,9 +51,7 @@ const MasonryGallery = ({
// const breakpoint = currentBreakpoint.length ? currentBreakpoint : "xs"; // const breakpoint = currentBreakpoint.length ? currentBreakpoint : "xs";
console.log("🚀 ~ file: MasonryGallery.tsx ~ line 51 ~ breakpoint", breakpoint) console.log("🚀 ~ file: MasonryGallery.tsx ~ line 51 ~ breakpoint", breakpoint)
const galleryWidth = `calc(100vw - ${ const galleryWidth = `calc(100vw - ${ breakpoint === "xs" || breakpoint === "sm" ? "32" : "160" }px)`;
breakpoint === "xs" || breakpoint === "sm" ? "32" : "160"
}px)`;
console.log("🚀 ~ file: MasonryGallery.tsx ~ line 55 ~ galleryWidth", galleryWidth) console.log("🚀 ~ file: MasonryGallery.tsx ~ line 55 ~ galleryWidth", galleryWidth)
const aspectRatios = React.useMemo( const aspectRatios = React.useMemo(
@ -110,7 +108,7 @@ const MasonryGallery = ({
<div <div
className={classNames( className={classNames(
"flex items-center flex-wrap mx-auto px-4 md:px-8", "flex items-center flex-wrap mx-auto px-4 md:px-8",
isClient ? "" : "max-w-[320px]" isClient ? "" : ""
)} )}
// ref={observe} // ref={observe}
style={{ style={{