Projects.js 1.34 KB
Newer Older
ddcat1115's avatar
ddcat1115 committed
1 2 3 4
import React from 'react';
import { List, Card } from 'antd';
import moment from 'moment';
import AvatarList from '../../../components/AvatarList';
xiaohu's avatar
xiaohu committed
5
import stylesProjects from '../../List/Search/Projects.less';
ddcat1115's avatar
ddcat1115 committed
6

jim's avatar
jim committed
7
export default props => {
ddcat1115's avatar
ddcat1115 committed
8 9 10 11 12 13 14 15 16 17 18 19 20 21
  const { list } = props;
  return (
    <List
      className={stylesProjects.coverCardList}
      rowKey="id"
      grid={{ gutter: 24, xxl: 3, xl: 2, lg: 2, md: 2, sm: 2, xs: 1 }}
      dataSource={list}
      renderItem={item => (
        <List.Item>
          <Card
            className={stylesProjects.card}
            hoverable
            cover={<img alt={item.title} src={item.cover} />}
          >
jim's avatar
jim committed
22
            <Card.Meta title={<a href="#">{item.title}</a>} description={item.subDescription} />
ddcat1115's avatar
ddcat1115 committed
23 24 25 26
            <div className={stylesProjects.cardItemContent}>
              <span>{moment(item.updatedAt).fromNow()}</span>
              <div className={stylesProjects.avatarList}>
                <AvatarList size="mini">
jim's avatar
jim committed
27 28 29 30 31 32 33
                  {item.members.map(member => (
                    <AvatarList.Item
                      key={`${item.id}-avatar-${member.id}`}
                      src={member.avatar}
                      tips={member.name}
                    />
                  ))}
ddcat1115's avatar
ddcat1115 committed
34 35 36 37 38 39 40 41 42
                </AvatarList>
              </div>
            </div>
          </Card>
        </List.Item>
      )}
    />
  );
};