forked from alibaba/ice
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathEntryCard.jsx
More file actions
86 lines (82 loc) · 1.91 KB
/
EntryCard.jsx
File metadata and controls
86 lines (82 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import React, { Component } from 'react';
import IceContainer from '@icedesign/container';
const list = [
{
title: '帖子',
img: '//gw.alicdn.com/tfscom/TB1OyT.RVXXXXcpXXXXXXXXXXXX.png',
url: '//www.taobao.com',
},
{
title: '宝贝清单',
img: '//img.alicdn.com/tfs/TB1g6cGRFXXXXa9XXXXXXXXXXXX-140-140.png',
url: '//www.taobao.com',
},
{
title: '图片',
img: '//img.alicdn.com/tfs/TB1hJ7dRFXXXXcgXFXXXXXXXXXX-140-140.png',
url: '//www.taobao.com',
},
{
title: '上新',
img: '//img.alicdn.com/tfs/TB196v1RFXXXXb6aXXXXXXXXXXX-140-140.png',
url: '//www.taobao.com',
},
{
title: '短视频',
img: '//gw.alicdn.com/tfscom/TB1toY.RVXXXXcuXXXXXXXXXXXX.png',
url: '//www.taobao.com',
},
{
title: '短视频',
img: '//gw.alicdn.com/tfscom/TB1toY.RVXXXXcuXXXXXXXXXXXX.png',
url: '//www.taobao.com',
},
];
export default class EntryCard extends Component {
static displayName = 'EntryCard';
render() {
return (
<IceContainer
className="entry-card"
style={{
display: 'flex',
flexDirection: 'row',
flexWrap: 'wrap',
}}
>
{list.map((item, index) => {
return (
<div key={index} style={styles.item}>
<a href={item.url} style={styles.link} target="_blank">
<img src={item.img} style={styles.cover} alt={item.title} />
<div style={styles.title}>{item.title}</div>
</a>
</div>
);
})}
</IceContainer>
);
}
}
const styles = {
item: {
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
width: '70px',
margin: '10px 40px',
},
link: {
textDecoration: 'none',
color: '#333',
},
cover: {
width: '70px',
height: '70px',
},
title: {
marginTop: '12px',
fontSize: '14px',
textAlign: 'center',
},
};