From 7a8d2f0c0a7f1b703668617d5f911d6a869769b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1muel=20Fekete?= Date: Sun, 17 Mar 2024 21:25:32 +0100 Subject: [PATCH] 1 --- src/app/questions/page.tsx | 22 ++++++++++++++++ .../presentation/PresentationGrid.tsx | 24 ++++++++++++++--- src/components/tiles/question-tile.tsx | 26 +++++++++++++++++++ src/utils/dateHelper.ts | 5 ++++ 4 files changed, 73 insertions(+), 4 deletions(-) create mode 100644 src/app/questions/page.tsx create mode 100644 src/components/tiles/question-tile.tsx diff --git a/src/app/questions/page.tsx b/src/app/questions/page.tsx new file mode 100644 index 0000000..193c904 --- /dev/null +++ b/src/app/questions/page.tsx @@ -0,0 +1,22 @@ +import { RoomQuestion } from '@/components/tiles/question-tile'; +import { getPresentationData } from '@/models/get-presentation-data'; + +export default async function questionsPage() { + const presentations = await getPresentationData(); + return ( +
+

Kérdezz az elődóktól!

+ +
+
+

IB028

+
+
+

IB025

+
+ + +
+
+ ); +} diff --git a/src/components/presentation/PresentationGrid.tsx b/src/components/presentation/PresentationGrid.tsx index 10e4c79..bc9ca35 100644 --- a/src/components/presentation/PresentationGrid.tsx +++ b/src/components/presentation/PresentationGrid.tsx @@ -2,7 +2,7 @@ import clsx from 'clsx'; import Link from 'next/link'; -import { CSSProperties, useRef } from 'react'; +import { CSSProperties, useRef, useState } from 'react'; import { Tile } from '@/components/tiles/tile'; import { PresentationWithDates, SponsorCategory } from '@/models/models'; @@ -88,9 +88,16 @@ export function PresentationGrid({ ); } -function PresentationTile({ presentation }: { presentation: PresentationWithDates }) { +export function PresentationTile({ + presentation, + preview = false, +}: { + presentation: PresentationWithDates; + preview?: boolean; +}) { + const [question, setQuestion] = useState(''); return ( - + {presentation.room !== 'BOTH' && `${presentation.room} | `} @@ -132,9 +139,18 @@ function PresentationTile({ presentation }: { presentation: PresentationWithDate )} - {presentation.presenter?.company?.category === SponsorCategory.MAIN_SPONSOR && ( + {presentation.presenter?.company?.category === SponsorCategory.MAIN_SPONSOR && !preview && (

{presentation.description.split('\n')[0]}

)} +
+