forked from devsonket/devsonket.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbutton.js
More file actions
51 lines (46 loc) · 1.08 KB
/
Copy pathbutton.js
File metadata and controls
51 lines (46 loc) · 1.08 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
import React from "react"
import PropTypes from "prop-types"
import styled from "@emotion/styled"
const ButtonContainer = styled.span``
const ButtonAnchor = styled.a`
text-decoration: none;
display: inline-block;
padding: 8px 18px;
border-radius: 4px;
cursor: pointer;
font-weight: 600;
line-height: 1;
transition: 0.2s all ease;
background: #02b3e4;
box-shadow: 8px 10px 20px 0 rgba(46, 61, 73, 0.15);
color: white;
text-shadow: 0 1px 3px #86888e;
@media print {
display: none;
}
&:hover {
box-shadow: 2px 4px 8px 0 rgba(46, 61, 73, 0.2);
background-color: #02b7e9;
}
`
export const Button = ({ text, bgColor, href, onClick, target, rel }) => (
<ButtonContainer>
<ButtonAnchor
target={target ? "_blank" : "self"}
rel={rel ? rel : ""}
onClick={onClick && onClick}
style={{ backgroundColor: bgColor }}
href={href}
>
{text}
</ButtonAnchor>
</ButtonContainer>
)
Button.defaultProps = {
text: `button`,
bgColor: "#333",
}
Button.propTypes = {
text: PropTypes.string,
bgColor: PropTypes.string,
}