From b5960e07e9c147b53dceba563559a8d78db8cd46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoffer=20Rydest=C3=A5hl?= Date: Thu, 27 Jun 2024 11:33:38 +0200 Subject: [PATCH] hooked up social links. Removed log. --- src/components/Footer.astro | 33 +++++++++++++++++++++++++++++---- src/pages/event/[post].astro | 3 +-- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/components/Footer.astro b/src/components/Footer.astro index c951475..fdbf945 100644 --- a/src/components/Footer.astro +++ b/src/components/Footer.astro @@ -2,32 +2,57 @@ import BtnSecondary from './BtnSecondary.astro' const currentYear = new Date().getFullYear() const heightAndWidth = 63 + +const response = await fetch('https://graphql.datocms.com/', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + Accept: 'application/json', + Authorization: `Bearer ${import.meta.env.DATOCMS_API_KEY}`, + }, + body: JSON.stringify({ + query: `query SocialLinks { + social { + linkedin + instagram + facebook + email + } + } + `, + }), +}) + +const json = await response.json() +const data = json.data.social + + ---