diff --git a/apps/kvarteret/components/Carousel.js b/apps/kvarteret/components/Carousel.js index e3985a5..b251dc6 100644 --- a/apps/kvarteret/components/Carousel.js +++ b/apps/kvarteret/components/Carousel.js @@ -15,40 +15,42 @@ import { useEffect, useState } from "react"; import Vibrant from "node-vibrant"; const CarouselItem = ({ item }) => { - + // const { data, loading, error } = usePalette(`https://cms.kvarteret.no/assets/${imageId}`) const imageId = item.header.id; const [vibrancy, setVibrancy] = useState(); useEffect(() => { const test = async () => { - if(!Vibrant) return; - Vibrant.from(`https://cms.kvarteret.no/assets/${imageId}?width=5&height=5`).quality(1).getPalette().then( palette => { + if (!Vibrant) return; + Vibrant.from(`https://cms.kvarteret.no/assets/${imageId}?width=5&height=5`).quality(1).getPalette().then(palette => { setVibrancy(palette); }); } test(); - },[setVibrancy, imageId]) + }, [setVibrancy, imageId]) const link = (item?.navigation?.type === "page" ? item?.navigation?.page_2?.slug : item?.navigation?.url) ?? "" + console.debug(link); + return (
- -
- -
-
{item.translations[0]?.title}
-
{item.translations[0]?.description}
-
+ +
+ +
+
{item.translations[0]?.title}
+
{item.translations[0]?.description}
- +
+