menu moved to config and context
This commit is contained in:
1 parent
e8fb2e817b
commit
1dbbe04d59
20 files changed
+62
-249
No files matched your search
@@ -2,20 +2,16 @@ import Head from 'next/head'
|
||||
import { App } from 'src/components/App'
|
||||
import { Schedule } from 'src/components/Schedule'
|
||||
import { Share } from 'src/components/Share'
|
||||
import menuModel from 'src/models/menu'
|
||||
import { buildMenu } from 'src/lib/menu'
|
||||
import { createApiUrl, requestGet } from 'src/next-lib'
|
||||
import { NextPage } from 'next'
|
||||
|
||||
type Props = {
|
||||
pageUrl: string
|
||||
title: string
|
||||
data: any //(schedule)
|
||||
}
|
||||
|
||||
const Page: NextPage<Props> = props => (
|
||||
<App
|
||||
menu={buildMenu(props.pageUrl, menuModel)}
|
||||
showAuthor={true}
|
||||
wide={true}
|
||||
>
|
||||
@@ -30,8 +26,6 @@ const Page: NextPage<Props> = props => (
|
||||
)
|
||||
|
||||
export const unstable_getStaticProps = async (ctx: any) => {
|
||||
// const pageUrl = ctx.req.url
|
||||
const pageUrl = '/schedule'
|
||||
const period = '2016-2017'
|
||||
const semester = 'spring'
|
||||
const data = await requestGet(createApiUrl(`/api/schedule?period=${period}&semester=${semester}`), null)
|
||||
@@ -42,7 +36,6 @@ export const unstable_getStaticProps = async (ctx: any) => {
|
||||
return {
|
||||
props: {
|
||||
data,
|
||||
pageUrl,
|
||||
title: 'Расписание',
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user