From c25007982aadffe0661b94015ec84355f30e4b41 Mon Sep 17 00:00:00 2001 From: "Christian K. Engelsen" <78857869+Cengelsen@users.noreply.github.com> Date: Tue, 5 Sep 2023 15:22:52 +0200 Subject: [PATCH] working link and removed shadow background --- apps/kvarteret/components/Carousel.js | 50 ++++++++++++++------------- 1 file changed, 26 insertions(+), 24 deletions(-) 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 (