collective page uses card grid

This commit is contained in:
tmshv committed 2020-02-20 17:15:50 +03:00
1 parent 9b8b3d73c5
commit c317d6631f
2 files changed
+16 -17

No files matched your search

+15 -12
View File
@@ -4,16 +4,18 @@ 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 { CardList } from 'src/components/CardList'
import menuModel from 'src/models/menu'
import { buildMenu } from 'src/lib/menu'
import { meta } from 'src/lib/meta'
import { IMeta } from 'src/types'
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'
interface IPerson {
url: string
name: string
picture: IImage
}
type Props = {
@@ -51,18 +53,19 @@ const Page: NextPage<Props> = props => {
/>
)}
<CardList
items={props.data}
renderItem={(person, index) => (
<CardGrid style={{
marginBottom: 'var(--size-xl)',
}}>
{props.data.map((item, index) => (
<PersonCard
key={index}
profile={person}
picture={person.picture}
url={person.url}
name={person.name}
profile={item}
picture={item.picture}
url={item.url}
name={item.name}
/>
)}
/>
))}
</CardGrid>
</App>
)
}
@@ -1,6 +1,5 @@
import React from 'react'
import cx from 'classnames'
import { Image } from './Image'
import { Image } from '../Image'
export const PersonCard = ({ picture, name, url, profile }) => (
<div className="PersonCard">
@@ -12,9 +11,6 @@ export const PersonCard = ({ picture, name, url, profile }) => (
display: flex;
flex-direction: column;
margin-bottom: var(--double-margin);
width: var(--person-card-width);
min-width: 10em;
max-width: 30em;
}