forked from wizeline/react-certification-2020
-
Notifications
You must be signed in to change notification settings - Fork 73
Expand file tree
/
Copy pathInputTextIcon.jsx
More file actions
57 lines (51 loc) · 1.05 KB
/
InputTextIcon.jsx
File metadata and controls
57 lines (51 loc) · 1.05 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
54
55
56
57
import React from 'react';
import styled from 'styled-components';
import SvgMagnifier from '../svg/SvgMagnifier';
const Wrapper = styled.div`
position: relative;
background-color: #bebebe;
margin: 0% 3%;
border-radius: 25px;
@media screen and (max-width: 280px) {
width: 65%;
}
`;
const SvgWrapper = styled.div`
height: 100%;
display: flex;
padding: 0px 8px;
position: absolute;
align-items: center;
pointer-events: none;
justify-content: center;
`;
const InputWrapper = styled.div`
display: inline-flex;
position: relative;
align-items: center;
`;
const StyledInputText = styled.input`
width: 95%;
padding: 8px 5px;
font-size: 1em;
padding-left: calc(1em + 25px);
border: none;
background-color: transparent;
color: #424242;
&:focus {
outline: none;
}
`;
const InputTextIcon = () => {
return (
<Wrapper role="search">
<SvgWrapper>
<SvgMagnifier />
</SvgWrapper>
<InputWrapper>
<StyledInputText />
</InputWrapper>
</Wrapper>
);
};
export default InputTextIcon;