content style update; style refactoring
This commit is contained in:
1 parent
1bdea85b1b
commit
400a08d1af
11 files changed
+53
-28
No files matched your search
@@ -30,7 +30,10 @@ const Page: NextPage<Props> = props => {
|
|||||||
<App
|
<App
|
||||||
menu={buildMenu(props.pageUrl, menuModel)}
|
menu={buildMenu(props.pageUrl, menuModel)}
|
||||||
showAuthor={true}
|
showAuthor={true}
|
||||||
layout={'wide'}
|
wide={true}
|
||||||
|
contentStyle={{
|
||||||
|
margin: 'var(--size-l) var(--size-xl)'
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<Head>
|
<Head>
|
||||||
<title>{props.title}</title>
|
<title>{props.title}</title>
|
||||||
|
|||||||
@@ -36,7 +36,10 @@ const Page: NextPage<Props> = props => {
|
|||||||
<App
|
<App
|
||||||
menu={buildMenu(props.pageUrl, menuModel)}
|
menu={buildMenu(props.pageUrl, menuModel)}
|
||||||
showAuthor={true}
|
showAuthor={true}
|
||||||
layout={'wide'}
|
wide={true}
|
||||||
|
contentStyle={{
|
||||||
|
margin: 'var(--size-l) var(--size-xl)'
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<Head>
|
<Head>
|
||||||
<title>{props.title}</title>
|
<title>{props.title}</title>
|
||||||
|
|||||||
@@ -28,7 +28,9 @@ const Page: NextPage<Props> = props => {
|
|||||||
<App
|
<App
|
||||||
menu={buildMenu(props.pageUrl, menuModel)}
|
menu={buildMenu(props.pageUrl, menuModel)}
|
||||||
showAuthor={true}
|
showAuthor={true}
|
||||||
layout={'wide'}
|
contentStyle={{
|
||||||
|
marginTop: 'var(--size-l)'
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<Head>
|
<Head>
|
||||||
<title>{props.data.title}</title>
|
<title>{props.data.title}</title>
|
||||||
|
|||||||
+3
-1
@@ -103,7 +103,9 @@ const Page: NextPage<IProps> = props => (
|
|||||||
<App
|
<App
|
||||||
menu={buildMenu(props.pageUrl, menuModel)}
|
menu={buildMenu(props.pageUrl, menuModel)}
|
||||||
showAuthor={true}
|
showAuthor={true}
|
||||||
layout={'wide'}
|
contentStyle={{
|
||||||
|
marginTop: 'var(--size-l)'
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<Head>
|
<Head>
|
||||||
<title>{props.title}</title>
|
<title>{props.title}</title>
|
||||||
|
|||||||
+3
-1
@@ -73,7 +73,9 @@ const Page: NextPage<IProps> = props => (
|
|||||||
<App
|
<App
|
||||||
menu={buildMenu(props.pageUrl, menuModel)}
|
menu={buildMenu(props.pageUrl, menuModel)}
|
||||||
showAuthor={true}
|
showAuthor={true}
|
||||||
layout={'wide'}
|
contentStyle={{
|
||||||
|
marginTop: 'var(--size-l)'
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<Head>
|
<Head>
|
||||||
<title>{props.title}</title>
|
<title>{props.title}</title>
|
||||||
|
|||||||
+17
-5
@@ -6,8 +6,9 @@ import { HudozkaTitle } from 'src/components/HudozkaTitle'
|
|||||||
import menuModel from 'src/models/menu'
|
import menuModel from 'src/models/menu'
|
||||||
import { meta } from 'src/lib/meta'
|
import { meta } from 'src/lib/meta'
|
||||||
import { buildMenu } from 'src/lib/menu'
|
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 { NextPage } from 'next'
|
||||||
|
import { IArticle } from 'src/types'
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
pageUrl: string
|
pageUrl: string
|
||||||
@@ -22,14 +23,21 @@ const Page: NextPage<IProps> = props => (
|
|||||||
<App
|
<App
|
||||||
menu={buildMenu(props.pageUrl, menuModel)}
|
menu={buildMenu(props.pageUrl, menuModel)}
|
||||||
showAuthor={true}
|
showAuthor={true}
|
||||||
layout={'wide'}
|
wide={true}
|
||||||
|
contentStyle={{
|
||||||
|
margin: 'var(--size-l) var(--size-xl)',
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<Head>
|
<Head>
|
||||||
<title>{props.title}</title>
|
<title>{props.title}</title>
|
||||||
<Meta meta={props.meta} />
|
<Meta meta={props.meta} />
|
||||||
</Head>
|
</Head>
|
||||||
|
|
||||||
<HudozkaTitle />
|
<HudozkaTitle
|
||||||
|
style={{
|
||||||
|
marginBottom: 'var(--size-l)'
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
<ArticleCardList
|
<ArticleCardList
|
||||||
articles={props.articles}
|
articles={props.articles}
|
||||||
@@ -43,8 +51,12 @@ export const unstable_getStaticProps = async () => {
|
|||||||
const pageUrl = '/'
|
const pageUrl = '/'
|
||||||
const page = 1
|
const page = 1
|
||||||
const pageSize = process.env.APP_ARTICLES_PAGE_SIZE
|
const pageSize = process.env.APP_ARTICLES_PAGE_SIZE
|
||||||
const res = await requestGet(createApiUrl(`/api/articles?page=${page}&pageSize=${pageSize}`), {}) as any
|
const res = await requestGet<IResponseItems<IArticle>>(createApiUrl(`/api/articles?page=${page}&pageSize=${pageSize}`), null)
|
||||||
const articles = res.items || []
|
const articles = (res.items || [])
|
||||||
|
.map(x => ({
|
||||||
|
...x,
|
||||||
|
featured: x.id === '2019-kotiki'
|
||||||
|
}))
|
||||||
const nextPage = res.nextPage
|
const nextPage = res.nextPage
|
||||||
const prevPage = res.prevPage
|
const prevPage = res.prevPage
|
||||||
const title = 'Шлиссельбургская ДХШ'
|
const title = 'Шлиссельбургская ДХШ'
|
||||||
|
|||||||
+4
-1
@@ -17,7 +17,10 @@ const Page: NextPage<Props> = props => (
|
|||||||
<App
|
<App
|
||||||
menu={buildMenu(props.pageUrl, menuModel)}
|
menu={buildMenu(props.pageUrl, menuModel)}
|
||||||
showAuthor={true}
|
showAuthor={true}
|
||||||
layout={'wide'}
|
wide={true}
|
||||||
|
contentStyle={{
|
||||||
|
marginTop: 'var(--size-l)'
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<Head>
|
<Head>
|
||||||
<title>{props.title}</title>
|
<title>{props.title}</title>
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ const Index: NextPage<IProps> = props => {
|
|||||||
<App
|
<App
|
||||||
menu={buildMenu(props.pageUrl, menuModel)}
|
menu={buildMenu(props.pageUrl, menuModel)}
|
||||||
showAuthor={true}
|
showAuthor={true}
|
||||||
layout={'wide'}
|
|
||||||
>
|
>
|
||||||
<Head>
|
<Head>
|
||||||
<title>{props.title}</title>
|
<title>{props.title}</title>
|
||||||
|
|||||||
@@ -15,10 +15,11 @@ const Navigation = dynamic(() => import('../Navigation').then(mod => mod.Navigat
|
|||||||
export interface IAppProps {
|
export interface IAppProps {
|
||||||
menu: any
|
menu: any
|
||||||
showAuthor: boolean
|
showAuthor: boolean
|
||||||
layout: 'full' | 'wide'
|
wide?: boolean
|
||||||
|
contentStyle?: React.CSSProperties
|
||||||
}
|
}
|
||||||
|
|
||||||
export const App: React.FC<IAppProps> = props => {
|
export const App: React.FC<IAppProps> = ({ wide = false, ...props }) => {
|
||||||
const motionDisabled = useReducedMotion()
|
const motionDisabled = useReducedMotion()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -38,12 +39,11 @@ export const App: React.FC<IAppProps> = props => {
|
|||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className={cx('content', `content_${props.layout}`, {
|
className={cx('content', {
|
||||||
'reduced-motion': motionDisabled,
|
'reduced-motion': motionDisabled,
|
||||||
|
'content_wide': wide,
|
||||||
})}
|
})}
|
||||||
style={{
|
style={props.contentStyle}
|
||||||
paddingTop: 'var(--menu-thickness)'
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
{props.children}
|
{props.children}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
import * as React from 'react'
|
import { memo } from 'react'
|
||||||
|
|
||||||
export const HudozkaTitle: React.FC = React.memo(() => (
|
export type HudozkaTitleProps = {
|
||||||
<div>
|
style?: React.CSSProperties
|
||||||
|
}
|
||||||
|
|
||||||
|
export const HudozkaTitle: React.FC<HudozkaTitleProps> = memo(props => (
|
||||||
|
<div style={props.style}>
|
||||||
<style jsx>{`
|
<style jsx>{`
|
||||||
div {
|
div {
|
||||||
--padding: var(--double-margin) 0;
|
|
||||||
|
|
||||||
padding: var(--padding);
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-4
@@ -12,9 +12,7 @@
|
|||||||
--biggest-font-size: 2.25rem;
|
--biggest-font-size: 2.25rem;
|
||||||
|
|
||||||
/* MENU */
|
/* MENU */
|
||||||
--menu-thickness: 2.5em;
|
|
||||||
--menu-colored-mark-thickness: 4px;
|
--menu-colored-mark-thickness: 4px;
|
||||||
--menu-inactive-item-color: hsl(0, 0%, 50%);
|
|
||||||
|
|
||||||
/* SIZE */
|
/* SIZE */
|
||||||
--mobile-width: 31.25em;
|
--mobile-width: 31.25em;
|
||||||
@@ -24,8 +22,8 @@
|
|||||||
--tablet-max-width: 64em;
|
--tablet-max-width: 64em;
|
||||||
|
|
||||||
/* CONTENT */
|
/* CONTENT */
|
||||||
--content-wide: 60%;
|
--content-wide: 100%;
|
||||||
--content-width: 100%;
|
--content-width: 60%;
|
||||||
|
|
||||||
--embed-video-ratio: 56.25%;
|
--embed-video-ratio: 56.25%;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user