SearchBox.js
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
import React from 'react';
import styled from 'styled-components';
import { AiOutlineSearch } from 'react-icons/ai';
import { searchBoxColorMap } from '../../lib/styles/palette';
const ButtonBlock = styled.div`
text-align: center;
display: table-cell;
vertical-align: middle;
width: ${props => props.size};
height: ${props => props.size};
display: ${props => props.display};
background-color: ${props => searchBoxColorMap[props.color].background};
&:hover {
background-color: ${props =>
searchBoxColorMap[props.color].hoverBackground};
}
color: ${props => searchBoxColorMap[props.color].color};
float: ${props => props.float || ''};
border: 1px ${props => searchBoxColorMap[props.color].background};
cursor: pointer;
`;
const SFaSearch = styled(AiOutlineSearch)`
width: 35px;
height: 35px;
margin-right: 5px;
margin-top: 2px;
`;
const SearchBox = ({ color, float, size = '1px', display = 'none' }) => {
return (
<ButtonBlock color={color} float={float} size={size} display={display}>
<SFaSearch />
</ButtonBlock>
);
};
export default SearchBox;