-
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.
Merge pull request #47 from simonyiszk/dev
v2
- Loading branch information
Showing
18 changed files
with
387 additions
and
32 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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,51 @@ | ||
import { Metadata, ResolvingMetadata } from 'next'; | ||
import { notFound } from 'next/navigation'; | ||
|
||
import Presentation from '@/components/presentation/Presentation'; | ||
import { getIndexData } from '@/models/get-index-data'; | ||
import slugify from '@/utils/slugify'; | ||
|
||
export async function generateStaticParams() { | ||
const data = await getIndexData(); | ||
|
||
return ( | ||
data?.presentations?.map((p) => ({ | ||
slug: slugify(p.title), | ||
})) ?? [] | ||
); | ||
} | ||
|
||
type Props = { | ||
params: { slug: string }; | ||
}; | ||
|
||
export async function generateMetadata({ params: { slug } }: Props, parent: ResolvingMetadata): Promise<Metadata> { | ||
const data = await getIndexData(); | ||
const presentation = data?.presentations.find((p) => slugify(p.title) === slug); | ||
|
||
return { | ||
title: presentation?.title, | ||
description: `${presentation?.presenter.name} "${presentation?.title}" című előadása a XXI. Simonyi Konferencián`, | ||
keywords: `${(await parent).keywords}, ${presentation?.presenter.name}${presentation?.title | ||
.split(' ') | ||
.reduce((prev, curr) => `${prev}, ${curr}`, '')}`, | ||
}; | ||
} | ||
|
||
const getPresentationBySlug = async (slug: string) => { | ||
const data = await getIndexData(); | ||
return data?.presentations.find((p) => slugify(p.title) === slug); | ||
}; | ||
|
||
export default async function PresentationBySlug({ params }: { params: { slug: string } }) { | ||
const presentation = await getPresentationBySlug(params.slug); | ||
if (!presentation) { | ||
notFound(); | ||
} | ||
|
||
return ( | ||
<div className='mt-10'> | ||
<Presentation presentation={presentation} /> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import clsx from 'clsx'; | ||
import { Metadata } from 'next'; | ||
import Link from 'next/link'; | ||
import { notFound } from 'next/navigation'; | ||
|
||
import { Tile } from '@/components/tiles/tile'; | ||
import { getIndexData } from '@/models/get-index-data'; | ||
import slugify from '@/utils/slugify'; | ||
|
||
export const metadata: Metadata = { | ||
title: 'Előadások', | ||
description: | ||
'Az előadások listája a XXI. Simonyi Konferencián, Magyarország legnagyobb egyetemi hallgatók által szervezett éves technológiai konferenciáján.', | ||
}; | ||
|
||
export default async function Presentations() { | ||
const data = await getIndexData(); | ||
if (!data || !data.presentations) { | ||
notFound(); | ||
} | ||
const presentations = data.presentations.sort((p1, p2) => p1.title.localeCompare(p2.title)); | ||
|
||
return ( | ||
<div className='flex flex-col max-w-6xl w-full px-6 xl:px-0'> | ||
<h1 className='mb-16 mt-8'>Előadások</h1> | ||
|
||
<div className='grid grid-cols-1 xs:grid-cols-2 lg:grid-cols-3 gap-8'> | ||
{presentations.map((presentation) => ( | ||
<Tile key={presentation.title} clickable> | ||
<Tile.Body lessPadding='[1px]'> | ||
<div className='flex flex-col h-full'> | ||
<Link className='h-full flex flex-col' href={`/presentations/${slugify(presentation.title)}`}> | ||
<div> | ||
<img | ||
src={presentation.presenter.pictureUrl} | ||
className='w-full aspect-square object-cover object-center rounded-[30px]' | ||
alt='Presentation Image' | ||
/> | ||
<div className='z-20 px-5 py-2 absolute text-center left-1/2 -translate-x-[50%] -translate-y-[50%] shadow-md rounded-xl overflow-hidden bg-[#FFE500]'> | ||
{presentation.presenter.name.split(',').map((pName) => ( | ||
<p className='whitespace-nowrap min-w-[200px] sm:min-w-[240px] text-2xl xs:text-xl sm:text-2xl text-black font-bold'> | ||
{pName} | ||
</p> | ||
))} | ||
</div> | ||
</div> | ||
<div | ||
className={clsx( | ||
'p-6 h-full flex items-center justify-center', | ||
presentation.presenter.name.split(',').length > 1 ? 'mt-6' : 'mt-2' | ||
)} | ||
> | ||
<h2 className='text-center text-[24px] font-bold text-white'>{presentation.title}</h2> | ||
</div> | ||
</Link> | ||
</div> | ||
</Tile.Body> | ||
</Tile> | ||
))} | ||
</div> | ||
|
||
<h2 className='mt-20 text-center'>Az előadások listája még bővül!</h2> | ||
</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
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
Oops, something went wrong.