diff --git a/src/components/MasonryGallery.tsx b/src/components/MasonryGallery.tsx index 2ae73a8..66bb787 100644 --- a/src/components/MasonryGallery.tsx +++ b/src/components/MasonryGallery.tsx @@ -8,7 +8,8 @@ import useBreakpoint from "use-breakpoint"; // @ts-ignore import themeBreakpoints from "../breakpoints"; import classNames from "classnames"; -import { GalleryImage } from "../pages/photogallery"; +import useDimensions from "react-cool-dimensions"; +import { GalleryImage } from "../pages"; interface Row { aspect: number; @@ -17,10 +18,10 @@ interface Row { } interface MasonryGalleryProps { - images: (GalleryImage)[]; + images: GalleryImage[]; aspectsByBreakpoint: { [breakpoint: string]: number; - } + }; debugHue?: boolean; debugRating?: boolean; linkState?: object; @@ -37,8 +38,25 @@ const MasonryGallery = ({ () => R.pick(R.keys(aspectTargetsByBreakpoint), themeBreakpoints), [aspectTargetsByBreakpoint] ); + console.log( + "🚀 ~ file: MasonryGallery.tsx ~ line 41 ~ breakpoints", + breakpoints + ); - const { breakpoint } = useBreakpoint(breakpoints, "sm"); + const { + observe, + width: containerWidth, + currentBreakpoint: breakpoint, + } = useDimensions({ + breakpoints, + }); + // console.log( + // "🚀 ~ file: MasonryGallery.tsx ~ line 47 ~ currentBreakpoint", + // currentBreakpoint + // ); + + // const { breakpoint } = useBreakpoint(breakpoints, "sm"); + console.log("🚀 ~ file: MasonryGallery.tsx ~ line 46 ~ breakpoint", breakpoint) const aspectRatios = React.useMemo( () => R.map(getAspectRatio, images).filter(Boolean), @@ -93,7 +111,8 @@ const MasonryGallery = ({ return ( <>
hsl( {image.fields?.imageMeta?.dominantHue?.[0]},{" "} - {(image.fields?.imageMeta?.dominantHue?.[1] ?? 0 * 100).toFixed(2)}%,{" "} - {(image.fields?.imageMeta?.dominantHue?.[2] ?? 0 * 100).toFixed(2)}% ) + {( + image.fields?.imageMeta?.dominantHue?.[1] ?? 0 * 100 + ).toFixed(2)} + %,{" "} + {( + image.fields?.imageMeta?.dominantHue?.[2] ?? 0 * 100 + ).toFixed(2)} + % ) )} {debugRating && ( diff --git a/src/pages/index.tsx b/src/pages/index.tsx index afd7427..c796452 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -186,7 +186,7 @@ const GalleryPage = ({ data }: PageProps) => {

Full Stack Software Engineer & Photographer

-
+
) => { md: 4, lg: 4, xl: 5, - "2xl": 6.1, + "2xl": 5.1, "3xl": 7.5, }} debugHue={sortKey === "hue_debug"}