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
+1
-7
@@ -3,15 +3,12 @@ import { App } from 'src/components/App'
|
||||
import { Meta } from 'src/components/Meta'
|
||||
import { ArticleGrid } from 'src/components/ArticleGrid'
|
||||
import { HudozkaTitle } from 'src/components/HudozkaTitle'
|
||||
import menuModel from 'src/models/menu'
|
||||
import { meta } from 'src/lib/meta'
|
||||
import { buildMenu } from 'src/lib/menu'
|
||||
import { createApiUrl, requestGet, IResponseItems } from 'src/next-lib'
|
||||
import { NextPage } from 'next'
|
||||
import { IArticle } from 'src/types'
|
||||
|
||||
interface IProps {
|
||||
pageUrl: string
|
||||
title: string
|
||||
meta: any
|
||||
prevPage: number
|
||||
@@ -21,7 +18,6 @@ interface IProps {
|
||||
|
||||
const Page: NextPage<IProps> = props => (
|
||||
<App
|
||||
menu={buildMenu(props.pageUrl, menuModel)}
|
||||
showAuthor={true}
|
||||
wide={true}
|
||||
>
|
||||
@@ -45,7 +41,6 @@ const Page: NextPage<IProps> = props => (
|
||||
)
|
||||
|
||||
export const unstable_getStaticProps = async () => {
|
||||
const pageUrl = '/'
|
||||
const page = 1
|
||||
const pageSize = process.env.APP_ARTICLES_PAGE_SIZE
|
||||
const res = await requestGet<IResponseItems<IArticle>>(createApiUrl(`/api/articles?page=${page}&pageSize=${pageSize}`), null)
|
||||
@@ -63,11 +58,10 @@ export const unstable_getStaticProps = async () => {
|
||||
articles,
|
||||
nextPage,
|
||||
prevPage,
|
||||
pageUrl,
|
||||
title,
|
||||
meta: meta({
|
||||
title,
|
||||
url: pageUrl,
|
||||
url: '/',
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user