From eb18a76ee4fc94d4c9ab0252c8326775735384c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Sverre=20Lien=20Sell=C3=A6g?= Date: Fri, 8 May 2020 08:03:54 +0200 Subject: [PATCH] add links --- src/Events.js | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/src/Events.js b/src/Events.js index 9bacb7f..7c467af 100644 --- a/src/Events.js +++ b/src/Events.js @@ -3,9 +3,21 @@ import { useEffect, useState } from 'preact/hooks' const endpoint = 'https://kultar.sout.no/events/' const fetch_options = {} -function Tickets({ ticket_link }) { - console.log(ticket_link) - return Biletter +function Facebook({ event_id }) { + const facebook_event_url = `https://facebook.com/events/${event_id}/` + return ( + + Facebook + + ) +} + +function Tickets({ ticket_url }) { + return ( + + Kjøp billett + + ) } function Time({ date }) { @@ -44,15 +56,28 @@ function Location({ location }) { return '' } +function Links({ event_id, ticket_url }) { + if (ticket_url !== null) { + return ( + <> + +  –  + + + ) + } + + return +} function EventCard({ event }) { - const { event_id, name, location, date, ticket_link } = event + const { name, location, date, ticket_url, event_id } = event return (

{name}

)