-
Notifications
You must be signed in to change notification settings - Fork 213
/
Copy pathSelectionBox.tsx
48 lines (45 loc) · 1.31 KB
/
SelectionBox.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
import React from 'react';
import styled from 'styled-components';
const LogoContainerBox = styled.button`
width: 196px;
background: white;
height: 100%;
border: ${(p: { theme: any; isActive: boolean }) =>
`2px solid ${p.isActive ? p.theme.gray.dark : p.theme.gray.medium}`};
box-shadow: ${(p: { theme: any; isActive: boolean }) =>
p.isActive && `0 0 10px rgba(0, 0, 0, 0.5)`};
border-radius: ${p => p.theme.borderRadius};
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
margin: 1rem;
cursor: pointer;
-webkit-transition: border 500ms ease-out, box-shadow 500ms ease-out;
-moz-transition: border 500ms ease-out, box-shadow 500ms ease-out;
-o-transition: border 500ms ease-out, box-shadow 500ms ease-out;
transition: border 500ms ease-out, box-shadow 500ms ease-out;
padding: 0;
@media only screen and (max-width: 770px) {
width: 100%;
}
`;
interface SelectionBoxProps {
isActive: boolean;
onClick: any;
children?: React.ReactElement | React.ReactElement[];
fullWidth?: boolean;
style?: any;
}
export const SelectionBox = ({
isActive,
onClick,
style,
children,
}: SelectionBoxProps) => {
return (
<LogoContainerBox onClick={onClick} isActive={isActive} style={style}>
{children}
</LogoContainerBox>
);
};