Browse Source
* extract ListContent as a component * rename ListContent to ArticleListContentpull/2499/head
committed by
陈帅
6 changed files with 69 additions and 72 deletions
@ -0,0 +1,17 @@ |
|||
import React from 'react'; |
|||
import moment from 'moment'; |
|||
import { Avatar } from 'antd'; |
|||
import styles from './index.less'; |
|||
|
|||
const ArticleListContent = ({ data: { content, updatedAt, avatar, owner, href } }) => ( |
|||
<div className={styles.listContent}> |
|||
<div className={styles.description}>{content}</div> |
|||
<div className={styles.extra}> |
|||
<Avatar src={avatar} size="small" /> |
|||
<a href={href}>{owner}</a> 发布在 <a href={href}>{href}</a> |
|||
<em>{moment(updatedAt).format('YYYY-MM-DD HH:mm')}</em> |
|||
</div> |
|||
</div> |
|||
); |
|||
|
|||
export default ArticleListContent; |
|||
@ -0,0 +1,38 @@ |
|||
@import '~antd/lib/style/themes/default.less'; |
|||
|
|||
.listContent { |
|||
.description { |
|||
line-height: 22px; |
|||
max-width: 720px; |
|||
} |
|||
.extra { |
|||
color: @text-color-secondary; |
|||
margin-top: 16px; |
|||
line-height: 22px; |
|||
& > :global(.ant-avatar) { |
|||
vertical-align: top; |
|||
margin-right: 8px; |
|||
width: 20px; |
|||
height: 20px; |
|||
position: relative; |
|||
top: 1px; |
|||
} |
|||
& > em { |
|||
color: @disabled-color; |
|||
font-style: normal; |
|||
margin-left: 16px; |
|||
} |
|||
} |
|||
} |
|||
|
|||
@media screen and (max-width: @screen-xs) { |
|||
.listContent { |
|||
.extra { |
|||
& > em { |
|||
display: block; |
|||
margin-left: 0; |
|||
margin-top: 8px; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue