diff --git a/pages/articles/[slug].tsx b/pages/articles/[slug].tsx index cd796896..729510d9 100644 --- a/pages/articles/[slug].tsx +++ b/pages/articles/[slug].tsx @@ -30,7 +30,10 @@ const Page: NextPage = props => { {props.title} diff --git a/pages/collective.tsx b/pages/collective.tsx index 1bf4ee16..7a975ad6 100644 --- a/pages/collective.tsx +++ b/pages/collective.tsx @@ -36,7 +36,10 @@ const Page: NextPage = props => { {props.title} diff --git a/pages/document/[slug].tsx b/pages/document/[slug].tsx index c50a68c7..a70c2792 100644 --- a/pages/document/[slug].tsx +++ b/pages/document/[slug].tsx @@ -28,7 +28,9 @@ const Page: NextPage = props => { {props.data.title} diff --git a/pages/documents.tsx b/pages/documents.tsx index 78874c58..93e542a9 100644 --- a/pages/documents.tsx +++ b/pages/documents.tsx @@ -103,7 +103,9 @@ const Page: NextPage = props => ( {props.title} diff --git a/pages/gallery.tsx b/pages/gallery.tsx index 39c68de3..19c3c546 100644 --- a/pages/gallery.tsx +++ b/pages/gallery.tsx @@ -73,7 +73,9 @@ const Page: NextPage = props => ( {props.title} diff --git a/pages/index.tsx b/pages/index.tsx index aad3fa08..6f93be76 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,14 +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 || []) + .map(x => ({ + ...x, + featured: x.id === '2019-kotiki' + })) const nextPage = res.nextPage const prevPage = res.prevPage const title = 'Шлиссельбургская ДХШ' diff --git a/pages/schedule.tsx b/pages/schedule.tsx index 12e96161..667945db 100644 --- a/pages/schedule.tsx +++ b/pages/schedule.tsx @@ -17,7 +17,10 @@ const Page: NextPage = props => ( {props.title} diff --git a/pages/teacher/[person].tsx b/pages/teacher/[person].tsx index e37cf4f2..b46f2f9d 100644 --- a/pages/teacher/[person].tsx +++ b/pages/teacher/[person].tsx @@ -28,7 +28,6 @@ const Index: NextPage = props => { {props.title} diff --git a/src/components/App/index.tsx b/src/components/App/index.tsx index eda7e4cc..977afe91 100644 --- a/src/components/App/index.tsx +++ b/src/components/App/index.tsx @@ -15,10 +15,11 @@ const Navigation = dynamic(() => import('../Navigation').then(mod => mod.Navigat export interface IAppProps { menu: any showAuthor: boolean - layout: 'full' | 'wide' + wide?: boolean + contentStyle?: React.CSSProperties } -export const App: React.FC = props => { +export const App: React.FC = ({ wide = false, ...props }) => { const motionDisabled = useReducedMotion() return ( @@ -38,12 +39,11 @@ 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 => ( +