forked from codesandbox/codesandbox-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathButton.js
More file actions
53 lines (46 loc) · 1.06 KB
/
Button.js
File metadata and controls
53 lines (46 loc) · 1.06 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
import React from 'react';
import styled, { css } from 'styled-components';
const styles = css`
background: ${props => props.theme.homepage.primary};
border-radius: 0.25rem;
border: none;
font-family: ${props => props.theme.homepage.appleFont};
font-size: 0.8125em;
line-height: 19px;
text-align: center;
padding: 2px 21px;
font-weight: 500;
text-decoration: none;
color: ${props => props.theme.homepage.white} !important;
transition: all 200ms ease;
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
display: inline-block;
${props =>
props.big &&
css`
padding: 8px 21px;
`}
&:disabled {
opacity: 0.4;
}
&:hover {
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.24);
transform: scale(1.05);
}
&:focus {
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.24);
transform: scale(1);
}
`;
const Button = styled.button`
${styles}
`;
const Link = styled.a`
${styles}
`;
export default ({ children, ...props }) =>
props.href ? (
<Link {...props}>{children}</Link>
) : (
<Button {...props}>{children}</Button>
);