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={<>} + /> + + + + + }