From 5105ea9045ef45b01d0b7f6aea60f236955df477 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 16 Jul 2022 18:18:41 +0200 Subject: [PATCH] Add something to the event page --- pages/events/[slug].tsx | 43 +++++++++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/pages/events/[slug].tsx b/pages/events/[slug].tsx index 810e135..4637f02 100644 --- a/pages/events/[slug].tsx +++ b/pages/events/[slug].tsx @@ -7,6 +7,13 @@ import { Postcard } from '../../components/postcard/changer' import { ViewEvent } from '../../components/events/views/event' import useSWR from 'swr' import { Event } from '@prisma/client' +import { EditableText } from '../../components/generic/editable/inputs' +import { EditingContext, EditingMode } from '../../components/generic/editable/base' +import { useState } from 'react' +import { ToolBar } from '../../components/generic/toolbar/bar' +import { ToolToggleEditing } from '../../components/events/toolbar/toolToggleEditing' +import { ToolToggleVisibility } from '../../components/postcard/toolbar/toolToggleVisibility' +import { WIPBanner } from '../../components/generic/wip/banner' export async function getServerSideProps(context: NextPageContext) { @@ -28,20 +35,40 @@ const PageEvent: NextPage = ({ slug }) => { const { t } = useTranslation() const { data, error } = useSWR(`/api/events/${slug}`) + const displayTitle = data?.name ?? slug + const displayPostcard = data?.postcard ?? defaultPostcard + const displayDescription = data?.description ?? "" + + return <> - eventName - {t("siteTitle")} + {displayTitle} - {t("siteTitle")} - {data?.name ?? slug}} - postcard={<>} - description={<>{data?.description}} - daterange={<>} + src={displayPostcard} /> + + (EditingMode.VIEW)}> + + + } + postcard={<>} + description={<> + + } + daterange={<>} + /> + + + + + }