Header.js
3.72 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
import React, { useState } from 'react';
import { NavLink, useHistory } from 'react-router-dom';
import styled from 'styled-components';
import InputBlock from './common/Input';
import SearchBox from './common/SearchBox';
import DropDownButton from './common/DropdownButton';
import Button from './common/Button';
import Modal from './SearchOptionModal';
// 헤더 사이즈
const HeaderHeight = '170px';
const HeaderTop = styled.div`
background-color: black;
float: up;
height: 20px;
`;
const MainContainer = styled.div`
height: ${HeaderHeight};
position: fixed;
top: 0;
width: 100%;
z-index: 999;
background-color: #ffffff;
border-bottom: 1px solid #868e96;
`;
const MenuContainer = styled.div`
position: fixed;
top: 100px;
left: 0px;
`;
const LogoContainer = styled.div`
margin-top: 20px;
float: left;
padding: 20px;
img {
width: 100px;
vertical-align: bottom;
}
`;
const SearchContainer = styled.div`
margin-top: 20px;
`;
const SLink = styled(NavLink)`
list-style-type: none;
color: black;
float: left;
line-height: 55px;
vertical-align: middle;
text-align: center;
padding-left: 2em;
padding-right: 2em;
text-decoration: none !important;
&:hover {
background-color: #feebb6;
}
&.active {
font-weight: 600;
background-color: #feebb6;
float: left;
line-height: 55px;
vertical-align: middle;
text-align: center;
padding-left: 2em;
padding-right: 2em;
color: black;
text-decoration: none !important;
}
`;
const SearchOptionContainer = styled.div`
float: left;
`;
const SortOptionContainer = styled.div`
float: left;
`;
const OptionContainer = styled.div`
position: fixed;
top: 130px;
left: 650px;
`;
const UserContainer = styled.div`
position: fixed;
top: 35px;
right: 0;
padding-right: 20px;
`;
const AirContainer = styled.div`
height: ${HeaderHeight};
`;
const Header = () => {
const [showModal, setShowModal] = useState(false);
const openModal = () => {
setShowModal(prev => !prev);
};
const [setQuery] = useState('');
const history = useHistory();
const onMainClick = () => {
setQuery('');
history.push('');
};
return (
<>
<MainContainer>
<HeaderTop />
<LogoContainer onClick={onMainClick}>로고</LogoContainer>
<SearchContainer>
<DropDownButton
color="blue"
float="left"
fontsize="20px"
height="34px"
>
전체
</DropDownButton>
<InputBlock color="blue" size="14px" float="left" width="400px">
<input />
</InputBlock>
<SearchBox color="blue" size="50px" />
</SearchContainer>
<MenuContainer>
<ul>
<SLink activeClassName="active" to="categori0">
전체
</SLink>
<SLink to="/categori1">개인</SLink>
<SLink to="/categori2">부서</SLink>
</ul>
</MenuContainer>
<OptionContainer>
<SearchOptionContainer onClick={openModal}>
<Button color="white">고급 검색</Button>
</SearchOptionContainer>
<Modal showModal={showModal} setShowModal={setShowModal} />
<SortOptionContainer>
<DropDownButton
color="white"
width="80px"
fontsize="15px"
height="28px"
>
정렬
</DropDownButton>
</SortOptionContainer>
</OptionContainer>
<UserContainer>
<Button color="white" width="100px" height="50px" fontsize="20px">
사용자 님
</Button>
</UserContainer>
</MainContainer>
<AirContainer />
</>
);
};
export default Header;