forked from zonayedpca/devsonket.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcard.js
More file actions
42 lines (40 loc) · 950 Bytes
/
Copy pathcard.js
File metadata and controls
42 lines (40 loc) · 950 Bytes
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
import React from "react"
import { Link } from "gatsby"
import styled from "@emotion/styled"
const CardContainer = styled.div`
background: ${props =>
props.bg.backgroundColor ? props.bg.backgroundColor : "#fff"};
margin: 8px;
h4 {
font-size: 20px;
margin-bottom: 0;
${props => props.contentCard && `font-size: 18px;`}
}
p {
margin-bottom: 0;
}
a {
text-decoration: none;
display: block;
padding: 12px 20px;
color: #fff;
${props =>
props.contentCard &&
`
color: rgba(0, 0, 0, 0.75);
border: 1px solid #dfe1e5;
transition: 0.1s all ease;
border-radius: 24px;
&:hover {
background: #f7f7f7;
}
`}
}
`
export const Card = ({ id, title, style = {}, contentCard = false }) => (
<CardContainer contentCard={contentCard} key={id} bg={style}>
<Link to={`/${id}`}>
<h4>{title}</h4>
</Link>
</CardContainer>
)