diff --git a/pages/[...slug].tsx b/pages/[...slug].tsx index 1290896e..2598de86 100644 --- a/pages/[...slug].tsx +++ b/pages/[...slug].tsx @@ -18,8 +18,9 @@ const Index = props => ( {props.title} diff --git a/pages/_app.tsx b/pages/_app.tsx index aa65d576..eaf8462d 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -1,4 +1,5 @@ import 'src/style.css' +import 'src/style/content.css' import 'src/style/kazimir/image.css' import 'src/style/kazimir/video.css' import 'src/style/style.scss' diff --git a/pages/album/[slug].tsx b/pages/album/[slug].tsx index 216cd1b9..323b7a7a 100644 --- a/pages/album/[slug].tsx +++ b/pages/album/[slug].tsx @@ -23,8 +23,6 @@ const Page: NextPage = props => { {props.data.title} diff --git a/pages/article/[slug].tsx b/pages/article/[slug].tsx index 81bc1e11..b835acb6 100644 --- a/pages/article/[slug].tsx +++ b/pages/article/[slug].tsx @@ -27,8 +27,6 @@ const Page: NextPage = props => { {props.data.title} diff --git a/pages/articles/[slug].tsx b/pages/articles/[slug].tsx index 16993f65..729510d9 100644 --- a/pages/articles/[slug].tsx +++ b/pages/articles/[slug].tsx @@ -30,8 +30,10 @@ const Page: NextPage = props => { {props.title} diff --git a/pages/collective.tsx b/pages/collective.tsx index 4b93652d..7a975ad6 100644 --- a/pages/collective.tsx +++ b/pages/collective.tsx @@ -36,8 +36,10 @@ const Page: NextPage = props => { {props.title} diff --git a/pages/document/[slug].tsx b/pages/document/[slug].tsx index dc57b44d..a70c2792 100644 --- a/pages/document/[slug].tsx +++ b/pages/document/[slug].tsx @@ -28,8 +28,9 @@ const Page: NextPage = props => { {props.data.title} diff --git a/pages/documents.tsx b/pages/documents.tsx index fc92f0c0..deed0f7b 100644 --- a/pages/documents.tsx +++ b/pages/documents.tsx @@ -103,8 +103,9 @@ const Page: NextPage = props => ( {props.title} @@ -125,7 +126,7 @@ const Page: NextPage = props => ( export const unstable_getStaticProps = async (ctx) => { const pageUrl = '/documents' - const res = await requestGet>(createApiUrl('/api/files'), { items: [] }) + const res = await requestGet>(createApiUrl('/api/files'), null) const files = res.items const title = 'Документы' const collections = getSorted(files) diff --git a/pages/gallery.tsx b/pages/gallery.tsx index 53f95899..5d41dfbc 100644 --- a/pages/gallery.tsx +++ b/pages/gallery.tsx @@ -73,8 +73,10 @@ const Page: NextPage = props => ( {props.title} diff --git a/pages/index.tsx b/pages/index.tsx index 1d653c35..f3203ce9 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -6,8 +6,9 @@ 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 } from 'src/next-lib' +import { createApiUrl, requestGet, IResponseItems } from 'src/next-lib' import { NextPage } from 'next' +import { IArticle } from 'src/types' interface IProps { pageUrl: string @@ -22,15 +23,21 @@ const Page: NextPage = props => ( {props.title} - + { const pageUrl = '/' const page = 1 const pageSize = process.env.APP_ARTICLES_PAGE_SIZE - const res = await requestGet(createApiUrl(`/api/articles?page=${page}&pageSize=${pageSize}`), {}) as any - const articles = res.items || [] + const res = await requestGet>(createApiUrl(`/api/articles?page=${page}&pageSize=${pageSize}`), null) + const articles = (res.items || []) const nextPage = res.nextPage const prevPage = res.prevPage const title = 'Шлиссельбургская ДХШ' diff --git a/pages/schedule.tsx b/pages/schedule.tsx index ce371cc8..667945db 100644 --- a/pages/schedule.tsx +++ b/pages/schedule.tsx @@ -17,8 +17,10 @@ const Page: NextPage = props => ( {props.title} diff --git a/pages/teacher/[person].tsx b/pages/teacher/[person].tsx index 5ae2e39c..b46f2f9d 100644 --- a/pages/teacher/[person].tsx +++ b/pages/teacher/[person].tsx @@ -28,8 +28,6 @@ const Index: NextPage = props => { {props.title} diff --git a/src/components/App/index.tsx b/src/components/App/index.tsx index d337d2e3..977afe91 100644 --- a/src/components/App/index.tsx +++ b/src/components/App/index.tsx @@ -15,11 +15,11 @@ const Navigation = dynamic(() => import('../Navigation').then(mod => mod.Navigat export interface IAppProps { menu: any showAuthor: boolean - menuPadding: boolean - layout: 'full' | 'wide' | 'thin' + wide?: boolean + contentStyle?: React.CSSProperties } -export const App: React.FC = props => { +export const App: React.FC = ({ wide = false, ...props }) => { const motionDisabled = useReducedMotion() return ( @@ -38,10 +38,13 @@ export const App: React.FC = props => { /> )} > -
+
{props.children}
diff --git a/src/components/HudozkaTitle/index.tsx b/src/components/HudozkaTitle/index.tsx index 7ac27527..e0f1efcc 100644 --- a/src/components/HudozkaTitle/index.tsx +++ b/src/components/HudozkaTitle/index.tsx @@ -1,12 +1,13 @@ -import * as React from 'react' +import { memo } from 'react' -export const HudozkaTitle: React.FC = React.memo(() => ( -
+export type HudozkaTitleProps = { + style?: React.CSSProperties +} + +export const HudozkaTitle: React.FC = memo(props => ( +