Added navbar

This commit is contained in:
VityaSchel
2023-10-01 21:56:32 +04:00
parent a4667f57c7
commit 6653796e87
13 changed files with 508 additions and 26 deletions

View File

@@ -1,27 +1,12 @@
import { Schedule } from '@/widgets/schedule'
import { Day } from '@/shared/model/day'
import { GetServerSidePropsResult } from 'next'
import { getSchedule } from '@/app/agregator/schedule'
import { NextSerialized, nextDeserializer, nextSerialized } from '@/app/utils/date-serializer'
type PageProps = NextSerialized<{
schedule: Day[]
}>
export default function HomePage(props: PageProps) {
const { schedule } = nextDeserializer(props)
return (
<Schedule days={schedule} />
)
}
export async function getServerSideProps(): Promise<GetServerSidePropsResult<PageProps>> {
const schedule = await getSchedule(146)
export default function HomePage() { }
export async function getServerSideProps(): Promise<GetServerSidePropsResult<Record<string, never>>> {
return {
props: {
schedule: nextSerialized(schedule)
redirect: {
destination: '/ps7',
permanent: false
}
}
}