|
2 | 2 | 화면 : 메인 > 헤더
|
3 | 3 | */
|
4 | 4 |
|
| 5 | +import React from "react"; |
| 6 | +import { useState } from "react"; |
| 7 | +import { Link } from "react-router-dom"; |
5 | 8 |
|
6 |
| -import React from 'react' |
7 |
| -import { useState } from 'react'; |
8 |
| -import { Link } from 'react-router-dom'; |
| 9 | +import LoginPop from "../main/popup/Login"; |
| 10 | +import "./header.css"; |
9 | 11 |
|
10 |
| -import LoginPop from '../main/popup/Login'; |
11 |
| -import './header.css' |
12 |
| - |
13 |
| - |
14 |
| -export default function Header({isLogin}) { |
| 12 | +export default function Header({ isLogin }) { |
15 | 13 | /* 로그인 팝업 */
|
16 | 14 | const [LoginPopOpen, setLoginPopOpen] = useState(false);
|
17 |
| - const openLoginPopFn = ()=> setLoginPopOpen(true); |
18 |
| - const closeLoginPopFn = ()=> setLoginPopOpen(false); |
| 15 | + const openLoginPopFn = () => setLoginPopOpen(true); |
| 16 | + const closeLoginPopFn = () => setLoginPopOpen(false); |
19 | 17 |
|
20 | 18 | /* 로그아웃 */
|
21 |
| - const logoutFn = ()=> { |
| 19 | + const logoutFn = () => { |
22 | 20 | // 로그인 세션 삭제
|
23 |
| - sessionStorage.removeItem('user_id'); |
24 |
| - document.location.replace('/'); |
| 21 | + sessionStorage.removeItem("user_id"); |
| 22 | + document.location.replace("/"); |
25 | 23 | };
|
26 | 24 |
|
27 | 25 | return (
|
28 | 26 | <>
|
29 |
| - <header className="header-wrapper"> |
30 |
| - |
31 |
| - <div className="header-top"> |
32 |
| - <div className="inner-box header-inner"> |
33 |
| - <h1 className="top-logo"><a href ="/">엑스퍼트아카데미</a></h1> |
| 27 | + <header className="header-wrapper"> |
| 28 | + <div className="header-top"> |
| 29 | + <div className="inner-box header-inner"> |
| 30 | + <h1 className="top-logo"> |
| 31 | + <a href="/">엑스퍼트아카데미</a> |
| 32 | + </h1> |
34 | 33 | <div className="top-search">
|
35 |
| - <input type="text" className="top-search-input" placeholder="빅테이터" /> |
| 34 | + <input |
| 35 | + type="text" |
| 36 | + className="top-search-input" |
| 37 | + placeholder="빅테이터" |
| 38 | + /> |
36 | 39 | <a className="top-search-btn">
|
37 |
| - <img src="/images/search.png" alt="search"/> |
| 40 | + <img src="/images/search.png" alt="search" /> |
38 | 41 | </a>
|
39 | 42 | </div>
|
40 | 43 | <div className="top-btn">
|
41 |
| - { |
42 |
| - !isLogin ? |
| 44 | + {!isLogin ? ( |
43 | 45 | <>
|
44 |
| - <a href="#" onClick={openLoginPopFn}>로그인</a> |
| 46 | + <a href="#" onClick={openLoginPopFn}> |
| 47 | + 로그인 |
| 48 | + </a> |
45 | 49 | <Link to="/join">회원가입</Link>
|
46 | 50 | </>
|
47 |
| - : |
| 51 | + ) : ( |
48 | 52 | <>
|
49 | 53 | <Link to="/mypage">마이페이지</Link>
|
50 |
| - <a href="#" onClick={logoutFn}>로그아웃</a> |
| 54 | + <a href="#" onClick={logoutFn}> |
| 55 | + 로그아웃 |
| 56 | + </a> |
51 | 57 | </>
|
52 |
| - } |
| 58 | + )} |
53 | 59 | <button className="sitemap">+sitemap</button>
|
54 | 60 | </div>
|
| 61 | + </div> |
55 | 62 | </div>
|
56 |
| - </div>{/* 헤더 top */} |
57 |
| - |
58 |
| - <nav className="header-bottom"> |
| 63 | + {/* 헤더 top */} |
| 64 | + |
| 65 | + <nav className="header-bottom"> |
59 | 66 | <ul className="inner-box gnb">
|
60 | 67 | <li className="depth1">
|
61 |
| - <Link to ="/sample1">공개과정</Link> |
| 68 | + <Link to="/sample1">공개과정</Link> |
62 | 69 | <ul class="depth2">
|
63 |
| - <li><Link to ="/sample1">월간교육일정</Link></li> |
64 |
| - <li><Link to ="/sample1">계층교육</Link></li> |
65 |
| - <li><Link to ="/sample1">직무역량</Link></li> |
66 |
| - <li><Link to ="/sample1">DX교육</Link></li> |
67 |
| - <li><Link to ="/sample1">진단</Link></li> |
68 |
| - <li><Link to ="/sample1">일반</Link></li> |
| 70 | + <li> |
| 71 | + <Link to="/sample1">월간교육일정</Link> |
| 72 | + </li> |
| 73 | + <li> |
| 74 | + <Link to="/sample1">계층교육</Link> |
| 75 | + </li> |
| 76 | + <li> |
| 77 | + <Link to="/sample1">직무역량</Link> |
| 78 | + </li> |
| 79 | + <li> |
| 80 | + <Link to="/sample1">DX교육</Link> |
| 81 | + </li> |
| 82 | + <li> |
| 83 | + <Link to="/sample1">진단</Link> |
| 84 | + </li> |
| 85 | + <li> |
| 86 | + <Link to="/sample1">일반</Link> |
| 87 | + </li> |
69 | 88 | </ul>
|
70 | 89 | </li>
|
71 | 90 | <li className="depth1">
|
72 |
| - <Link to ="/sample2">취업과정</Link> |
| 91 | + <Link to="/sample2">취업과정</Link> |
73 | 92 | <ul class="depth2">
|
74 |
| - <li><Link to ="/sample2">소개</Link></li> |
75 |
| - <li><Link to ="/sample2">모집중인 과정</Link></li> |
| 93 | + <li> |
| 94 | + <Link to="/sample2">소개</Link> |
| 95 | + </li> |
| 96 | + <li> |
| 97 | + <Link to="/sample2">모집중인 과정</Link> |
| 98 | + </li> |
76 | 99 | </ul>
|
77 | 100 | </li>
|
78 | 101 | <li className="depth1">
|
79 |
| - <Link to ="/">Ex콘텐츠</Link> |
| 102 | + <Link to="/">Ex콘텐츠</Link> |
80 | 103 | <ul class="depth2">
|
81 |
| - <li><Link to ="/">이벤트</Link></li> |
82 |
| - <li><Link to ="/test">과정후기</Link></li> |
83 |
| - <li><Link to ="/">EXC뷰</Link></li> |
| 104 | + <li> |
| 105 | + <Link to="/">이벤트</Link> |
| 106 | + </li> |
| 107 | + <li> |
| 108 | + <Link to="/test">과정후기</Link> |
| 109 | + </li> |
| 110 | + <li> |
| 111 | + <Link to="/">EXC뷰</Link> |
| 112 | + </li> |
84 | 113 | </ul>
|
85 | 114 | </li>
|
86 | 115 | <li className="depth1">
|
87 |
| - <Link to ="/">고객센터</Link> |
| 116 | + <Link to="/">고객센터</Link> |
88 | 117 | <ul class="depth2">
|
89 |
| - <li><Link to ="/">공지사항</Link></li> |
90 |
| - <li><Link to ="/test">문의하기</Link></li> |
91 |
| - <li><Link to ="/">자주묻는 질문</Link></li> |
92 |
| - <li><Link to ="/">오시는 길</Link></li> |
| 118 | + <li> |
| 119 | + <Link to="/">공지사항</Link> |
| 120 | + </li> |
| 121 | + <li> |
| 122 | + <Link to="/test">문의하기</Link> |
| 123 | + </li> |
| 124 | + <li> |
| 125 | + <Link to="/">자주묻는 질문</Link> |
| 126 | + </li> |
| 127 | + <li> |
| 128 | + <Link to="/">오시는 길</Link> |
| 129 | + </li> |
93 | 130 | </ul>
|
94 | 131 | </li>
|
95 | 132 | <li className="depth1">
|
96 |
| - <Link to ="/">아카데미</Link> |
| 133 | + <Link to="/">아카데미</Link> |
97 | 134 | <ul class="depth2">
|
98 |
| - <li><Link to ="/">아카데미 소개</Link></li> |
99 |
| - <li><Link to ="/test">강사소개</Link></li> |
100 |
| - <li><Link to ="/">HR샵</Link></li> |
101 |
| - <li><Link to ="/">제휴제안</Link></li> |
102 |
| - <li><Link to ="/">인재채용</Link></li> |
| 135 | + <li> |
| 136 | + <Link to="/">아카데미 소개</Link> |
| 137 | + </li> |
| 138 | + <li> |
| 139 | + <Link to="/test">강사소개</Link> |
| 140 | + </li> |
| 141 | + <li> |
| 142 | + <Link to="/myclass">내역</Link> |
| 143 | + </li> |
| 144 | + <li> |
| 145 | + <Link to="/confirm">확인취소</Link> |
| 146 | + </li> |
| 147 | + <li> |
| 148 | + <Link to="/change">비번변경</Link> |
| 149 | + </li> |
103 | 150 | </ul>
|
104 | 151 | </li>
|
105 | 152 | </ul>
|
106 |
| - </nav>{/* 헤더 bottom */} |
107 |
| - </header> |
108 |
| - |
| 153 | + </nav> |
| 154 | + {/* 헤더 bottom */} |
| 155 | + </header> |
109 | 156 |
|
110 |
| - <LoginPop open={LoginPopOpen} close={closeLoginPopFn} /> |
111 |
| - </> |
112 |
| - ) |
| 157 | + <LoginPop open={LoginPopOpen} close={closeLoginPopFn} /> |
| 158 | + </> |
| 159 | + ); |
113 | 160 | }
|
0 commit comments