forked from devsonket/devsonket.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCard.js
More file actions
54 lines (52 loc) · 1.09 KB
/
Copy pathCard.js
File metadata and controls
54 lines (52 loc) · 1.09 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
import React from "react"
import { Link } from "gatsby"
import styled from "@emotion/styled"
const CardContainer = styled.div`
position: relative;
margin-bottom: 15px;
h4 {
font-size: 20px;
margin-bottom: 0;
line-height: 24px;
}
p {
margin-bottom: 0;
opacity: 0.85;
}
span {
position: absolute;
top: 25px;
right: 20px;
height: 10px;
width: 10px;
border-radius: 100%;
}
a {
text-decoration: none;
display: block;
padding: 20px 25px;
line-height: 24px;
background: #fff;
color: var(--sub-headline);
border-radius: 8px;
box-shadow: rgba(0, 0, 0, 0.03) 0px 6px 8px, rgba(0, 0, 0, 0.3) 0px 1px 2px;
}
`
export const Card = ({ id, title, description, colorPref }) => (
<CardContainer key={id}>
<Link to={`/${id}`}>
<h4>{title}</h4>
{description && (
<>
<p>
{String(description)
.substring(0, 33)
.trim()}
...
</p>
<span style={{ backgroundColor: colorPref }} />
</>
)}
</Link>
</CardContainer>
)