From 49f2bb62b5ecf0551afd0d86f4be3604a156a8e7 Mon Sep 17 00:00:00 2001 From: Thomas Ruoff Date: Wed, 24 Nov 2021 23:29:32 +0100 Subject: [PATCH] giphy api changed heavily --- components/header.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/header.jsx b/components/header.jsx index abf86a7..9eb07bb 100644 --- a/components/header.jsx +++ b/components/header.jsx @@ -5,11 +5,11 @@ const Header = () => { useEffect(() => { async function getGif() { const response = await fetch( - "//api.giphy.com/v1/gifs/random?tag=christmas&api_key=3ziHSa4ptYJdv2dOuawgzpBhhiW09Ss1" + "https://api.giphy.com/v1/gifs/random?tag=christmas&api_key=3ziHSa4ptYJdv2dOuawgzpBhhiW09Ss1" ); const { data } = await response.json(); - console.log(data) - setGifUrl(data.image_webp_url); + const gifUrl = data?.images?.fixed_height_small?.webp; + setGifUrl(gifUrl); } getGif();