-
Notifications
You must be signed in to change notification settings - Fork 567
/
Example.tsx
71 lines (64 loc) 路 2.5 KB
/
Example.tsx
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
import { Block } from './Block'
import React from 'react'
import { styled } from '../styled'
const Container = styled('div', {})
const Grid = styled('div', {
display: 'grid',
gridTemplateColumns: 'repeat(5, 1fr)',
columnGap: 32,
rowGap: 32,
'@mobile': {
gridTemplateColumns: '1fr',
}
})
const ShowCaseContainer = styled('a', {
boxShadow: `1px 1px 5px #ccc`,
borderRadius: 4,
display: 'inline-block',
height: 125,
cursor: 'pointer',
':root[data-theme="dark"] &': {
boxShadow: 'none',
}
})
const ShowCase = styled('img', {
height: 125,
})
type Case = {
image: string
link: string
}
const cases = [
{ image: '//gw.alicdn.com/imgextra/i4/19999999999999/O1CN01PEPPo02NjasvUe8cc_!!19999999999999-2-tps.png' }, // react
{ image: '//gw.alicdn.com/tfs/TB1Cdu2UYr1gK0jSZFDXXb9yVXa-1200-669.png' }, // vue
{ image: '//gw.alicdn.com/tfs/TB18DKdjCR26e4jSZFEXXbwuXXa-1200-669.png' }, // rax
{ image: '//gw.alicdn.com/tfs/TB11mzgg0Tfau8jSZFwXXX1mVXa-1200-669.png' }, // tablestore
{ image: '//gw.alicdn.com/imgextra/i3/19999999999999/O1CN01HLo3Pi2NjasqFIZbi_!!19999999999999-2-tps.png' }, // koa
{ image: '//gw.alicdn.com/imgextra/i2/19999999999999/O1CN01LggSYp2NjassPrZeZ_!!19999999999999-2-tps.png' }, // ice
{ image: '//gw.alicdn.com/tfs/TB1l2LaU1L2gK0jSZFmXXc7iXXa-1200-669.png' }, // hexo
{ image: '//gw.alicdn.com/tfs/TB12AhMjcVl614jSZKPXXaGjpXa-1200-669.png' }, // express
{ image: '//gw.alicdn.com/tfs/TB1NtHPh5pE_u4jSZKbXXbCUVXa-1200-669.png' }, // egg
{ image: '//gw.alicdn.com/tfs/TB1bonEgsieb18jSZFvXXaI3FXa-1200-669.png' }, // dingtalk
{ image: '//gw.alicdn.com/tfs/TB1Fh51U.Y1gK0jSZFMXXaWcVXa-1200-669.png' }, // antd
{ image: '//gw.alicdn.com/tfs/TB1Ro.miMgP7K4jSZFqXXamhVXa-1200-669.png' }, // typeorm
{ image: '//gw.alicdn.com/imgextra/i1/19999999999999/O1CN01FDOJdG2NjasvEbjxX_!!19999999999999-2-tps.png' }, // sequelize
{ image: '//gw.alicdn.com/tfs/TB1MM_aU8r0gK0jSZFnXXbRRXXa-1200-669.png' }, // img
{ image: '//gw.alicdn.com/tfs/TB1Fuy3UYr1gK0jSZFDXXb9yVXa-1200-669.png' }, // ssr
] as Case[]
export function Example() {
return (
<Block title="Examples" subtitle="Learn the usage of Midway.js" background="dark">
<Container>
<Grid>
{cases.map((cas) => {
return (
<ShowCaseContainer key={cas.image} href={cas.link || 'http://demo.midwayjs.org/'} target="_blank">
<ShowCase src={cas.image} />
</ShowCaseContainer>
)
})}
</Grid>
</Container>
</Block>
)
}