article, person cards removed; use common component
This commit is contained in:
1 parent
13c7d473b1
commit
5730505fca
12 files changed
+92
-295
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import Head from 'next/head'
|
||||
import { range } from 'lodash'
|
||||
import { App } from 'src/components/App'
|
||||
import { ArticleCardList } from 'src/components/ArticleCardList'
|
||||
import { ArticleGrid } from 'src/components/ArticleGrid'
|
||||
import menuModel from 'src/models/menu'
|
||||
import { buildMenu } from 'src/lib/menu'
|
||||
import { meta } from 'src/lib/meta'
|
||||
@@ -39,7 +39,7 @@ const Page: NextPage<Props> = props => {
|
||||
<title>{props.title}</title>
|
||||
<Meta meta={props.meta} />
|
||||
</Head>
|
||||
<ArticleCardList
|
||||
<ArticleGrid
|
||||
articles={props.data}
|
||||
prevPage={props.prevPage}
|
||||
nextPage={props.nextPage}
|
||||
|
||||
+19
-7
@@ -3,7 +3,6 @@ import { get } from 'lodash'
|
||||
import { App } from 'src/components/App'
|
||||
import { Meta } from 'src/components/Meta'
|
||||
import { CollectiveImage } from 'src/components/CollectiveImage'
|
||||
import { PersonCard } from 'src/components/PersonCard'
|
||||
import menuModel from 'src/models/menu'
|
||||
import { buildMenu } from 'src/lib/menu'
|
||||
import { meta } from 'src/lib/meta'
|
||||
@@ -11,10 +10,12 @@ import { IMeta, IImage } from 'src/types'
|
||||
import { createApiUrl, requestGet, IResponseItems } from 'src/next-lib'
|
||||
import { NextPage, NextPageContext } from 'next'
|
||||
import { CardGrid } from 'src/components/CardGrid'
|
||||
import { Card } from 'src/components/Card'
|
||||
|
||||
interface IPerson {
|
||||
url: string
|
||||
name: string
|
||||
position: string
|
||||
picture: IImage
|
||||
}
|
||||
|
||||
@@ -59,13 +60,24 @@ const Page: NextPage<Props> = props => {
|
||||
marginBottom: 'var(--size-xl)',
|
||||
}}>
|
||||
{props.data.map((item, index) => (
|
||||
<PersonCard
|
||||
<Card
|
||||
key={index}
|
||||
profile={item}
|
||||
picture={item.picture}
|
||||
url={item.url}
|
||||
name={item.name}
|
||||
/>
|
||||
layout={'featured'}
|
||||
img={{
|
||||
src: item.picture.src,
|
||||
alt: item.name,
|
||||
srcSet: '',//item.name.sr,
|
||||
}}
|
||||
href={item.url}
|
||||
>
|
||||
<h2 style={{
|
||||
margin: '0 0 var(--size-s)',
|
||||
fontSize: '14pt',
|
||||
}}>
|
||||
{item.name[0]} {item.name[1]} {item.name[2]}
|
||||
</h2>
|
||||
{item.position}
|
||||
</Card>
|
||||
))}
|
||||
</CardGrid>
|
||||
</App>
|
||||
|
||||
+6
-2
@@ -1,7 +1,7 @@
|
||||
import Head from 'next/head'
|
||||
import { App } from 'src/components/App'
|
||||
import { Meta } from 'src/components/Meta'
|
||||
import { ArticleCardList } from 'src/components/ArticleCardList'
|
||||
import { ArticleGrid } from 'src/components/ArticleGrid'
|
||||
import { HudozkaTitle } from 'src/components/HudozkaTitle'
|
||||
import menuModel from 'src/models/menu'
|
||||
import { meta } from 'src/lib/meta'
|
||||
@@ -39,7 +39,7 @@ const Page: NextPage<IProps> = props => (
|
||||
}}
|
||||
/>
|
||||
|
||||
<ArticleCardList
|
||||
<ArticleGrid
|
||||
articles={props.articles}
|
||||
prevPage={props.prevPage}
|
||||
nextPage={props.nextPage}
|
||||
@@ -53,6 +53,10 @@ export const unstable_getStaticProps = async () => {
|
||||
const pageSize = process.env.APP_ARTICLES_PAGE_SIZE
|
||||
const res = await requestGet<IResponseItems<IArticle>>(createApiUrl(`/api/articles?page=${page}&pageSize=${pageSize}`), null)
|
||||
const articles = (res.items || [])
|
||||
.map(x => ({
|
||||
...x,
|
||||
featured: ['2019-kotiki', 'veloparking'].includes(x.id)
|
||||
}))
|
||||
const nextPage = res.nextPage
|
||||
const prevPage = res.prevPage
|
||||
const title = 'Шлиссельбургская ДХШ'
|
||||
|
||||
Reference in new issue
Block a user