-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
73 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ( | ||
<div className='flex flex-col px-4 sm:px-6 xl:px-0 max-w-6xl w-full overflow-hidden'> | ||
<h1 className='mb-16 mt-8'>Kérdezz az elődóktól!</h1> | ||
|
||
<div className='grid grid-cols-1 sm:grid-cols-2 gap-6'> | ||
<div className='sm:col-span-2 lg:col-span-1'> | ||
<h2 className='sm:text-3xl md:text-4xl text-center'>IB028</h2> | ||
</div> | ||
<div className='sm:col-span-2 lg:col-span-1'> | ||
<h2 className='sm:text-3xl md:text-4xl text-center'>IB025</h2> | ||
</div> | ||
<RoomQuestion presentations={presentations ?? []} room='IB028' /> | ||
<RoomQuestion presentations={presentations ?? []} room='IB025' /> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
'use client'; | ||
import { PresentationWithDates } from '@/models/models'; | ||
import { getCurrentDate } from '@/utils/dateHelper'; | ||
|
||
import { PresentationTile } from '../presentation/PresentationGrid'; | ||
|
||
type Props = { | ||
presentations: PresentationWithDates[]; | ||
room: 'IB028' | 'IB025'; | ||
}; | ||
|
||
export function RoomQuestion({ presentations, room }: Props) { | ||
const now = getCurrentDate(); | ||
const presentation = presentations.find((p) => p.room === room && p.startDate < now && p.endDate > now); | ||
return ( | ||
<div className='sm:col-span-2 lg:col-span-1'> | ||
{presentation ? ( | ||
<PresentationTile presentation={presentation} preview /> | ||
) : ( | ||
<p className='text-stone-200 text-base sm:text-[20px] text-center'> | ||
Jelenleg nincs előadás ebben a teremben, nézz vissza később! | ||
</p> | ||
)} | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters