Showing
6 changed files
with
18 additions
and
14 deletions
... | @@ -11,7 +11,7 @@ function App() { | ... | @@ -11,7 +11,7 @@ function App() { |
11 | <div> | 11 | <div> |
12 | <Routes> | 12 | <Routes> |
13 | <Route exact path = "/login" element = {<LoginPage/>}/> | 13 | <Route exact path = "/login" element = {<LoginPage/>}/> |
14 | - <Route exact path = "/register" element = {<RegisterPage/>}/> | 14 | + <Route exact path = "/" element = {<RegisterPage/>}/> |
15 | <Route exact path = "/main" element = {<MainPage/>}/> | 15 | <Route exact path = "/main" element = {<MainPage/>}/> |
16 | <Route exact path = "/weather" element = {<WeatherPage/>}/> | 16 | <Route exact path = "/weather" element = {<WeatherPage/>}/> |
17 | <Route exact path = "/recommand" element = {<RecommandPage/>}/> | 17 | <Route exact path = "/recommand" element = {<RecommandPage/>}/> | ... | ... |
... | @@ -132,11 +132,11 @@ function MainPage(props) { | ... | @@ -132,11 +132,11 @@ function MainPage(props) { |
132 | 132 | ||
133 | const onClickLogout = useCallback((event) => { | 133 | const onClickLogout = useCallback((event) => { |
134 | dispatch(logout()); | 134 | dispatch(logout()); |
135 | - navigate('../login'); | 135 | + navigate('/login'); |
136 | }) | 136 | }) |
137 | 137 | ||
138 | const onClickRegister = useCallback((event) => { | 138 | const onClickRegister = useCallback((event) => { |
139 | - navigate('../register'); | 139 | + navigate('/'); |
140 | }) | 140 | }) |
141 | 141 | ||
142 | const onSubmitHandler = useCallback((event) => { //제출 전 오류 확인 함수 | 142 | const onSubmitHandler = useCallback((event) => { //제출 전 오류 확인 함수 |
... | @@ -256,7 +256,7 @@ function MainPage(props) { | ... | @@ -256,7 +256,7 @@ function MainPage(props) { |
256 | <hr/> | 256 | <hr/> |
257 | <div className="main-btn-area" onClick={onSubmitHandler}> | 257 | <div className="main-btn-area" onClick={onSubmitHandler}> |
258 | <button className="submit-btn"> | 258 | <button className="submit-btn"> |
259 | - 양식 제출 | 259 | + 날씨 정보 |
260 | </button> | 260 | </button> |
261 | </div> | 261 | </div> |
262 | <div className="main-check-variable"> | 262 | <div className="main-check-variable"> | ... | ... |
... | @@ -33,11 +33,11 @@ function RecommandPage(props) { | ... | @@ -33,11 +33,11 @@ function RecommandPage(props) { |
33 | 33 | ||
34 | const onClickLogout = useCallback((event) => { | 34 | const onClickLogout = useCallback((event) => { |
35 | dispatch(logout()); | 35 | dispatch(logout()); |
36 | - navigate('../login'); | 36 | + navigate('/login'); |
37 | }) | 37 | }) |
38 | 38 | ||
39 | const onClickRegister = useCallback((event) => { | 39 | const onClickRegister = useCallback((event) => { |
40 | - navigate('../register'); | 40 | + navigate('/'); |
41 | }) | 41 | }) |
42 | 42 | ||
43 | const onClickTitle = useCallback((event) => { | 43 | const onClickTitle = useCallback((event) => { | ... | ... |
... | @@ -86,6 +86,10 @@ function RegisterPage(props) { | ... | @@ -86,6 +86,10 @@ function RegisterPage(props) { |
86 | } | 86 | } |
87 | }, [checkPasswordError]); | 87 | }, [checkPasswordError]); |
88 | 88 | ||
89 | + const onClickLogIn = useCallback((event) => { | ||
90 | + navigate('../login'); | ||
91 | + }) | ||
92 | + | ||
89 | const onPasswordCheckHandler = useCallback((event) => { | 93 | const onPasswordCheckHandler = useCallback((event) => { |
90 | //비밀번호를 입력할때마다 password 를 검증하는 함수 | 94 | //비밀번호를 입력할때마다 password 를 검증하는 함수 |
91 | setPasswordError(event.currentTarget.value !== Password); | 95 | setPasswordError(event.currentTarget.value !== Password); |
... | @@ -131,6 +135,7 @@ function RegisterPage(props) { | ... | @@ -131,6 +135,7 @@ function RegisterPage(props) { |
131 | }, [checkIdError, checkNameError, checkPasswordError, checkRegisterError, checkSexError, Password, PasswordCheck, Sex, dispatch, registerResult, checkRegister]); | 135 | }, [checkIdError, checkNameError, checkPasswordError, checkRegisterError, checkSexError, Password, PasswordCheck, Sex, dispatch, registerResult, checkRegister]); |
132 | 136 | ||
133 | return ( | 137 | return ( |
138 | + <> | ||
134 | <div id="body"> | 139 | <div id="body"> |
135 | <div className="register-box"> | 140 | <div className="register-box"> |
136 | <h2>회원가입</h2> | 141 | <h2>회원가입</h2> |
... | @@ -199,11 +204,10 @@ function RegisterPage(props) { | ... | @@ -199,11 +204,10 @@ function RegisterPage(props) { |
199 | 가입하기 | 204 | 가입하기 |
200 | </button> | 205 | </button> |
201 | </div> | 206 | </div> |
202 | - <div className="check-variable"> | ||
203 | - {checkRegisterError && <div style={{ color: 'red' }}>정보를 제대로 입력해주세요.</div>} | ||
204 | - </div> | ||
205 | </div> | 207 | </div> |
208 | + {checkRegisterError && <div style={{ color: 'red' }}>정보를 제대로 입력해주세요.</div>} | ||
206 | </div> | 209 | </div> |
210 | + </> | ||
207 | ); | 211 | ); |
208 | 212 | ||
209 | } | 213 | } | ... | ... |
... | @@ -4,6 +4,7 @@ import { useNavigate } from "react-router-dom"; | ... | @@ -4,6 +4,7 @@ import { useNavigate } from "react-router-dom"; |
4 | import { recommend } from "../../../modules/clothes"; | 4 | import { recommend } from "../../../modules/clothes"; |
5 | import { logout } from "../../../modules/user"; | 5 | import { logout } from "../../../modules/user"; |
6 | import "../style/WeatherPage.scss" | 6 | import "../style/WeatherPage.scss" |
7 | + | ||
7 | function WeatherPage(props) { | 8 | function WeatherPage(props) { |
8 | const dispatch = useDispatch(); | 9 | const dispatch = useDispatch(); |
9 | const navigate = useNavigate(); | 10 | const navigate = useNavigate(); |
... | @@ -158,7 +159,6 @@ function WeatherPage(props) { | ... | @@ -158,7 +159,6 @@ function WeatherPage(props) { |
158 | useEffect(() => { | 159 | useEffect(() => { |
159 | 160 | ||
160 | user.then((result) => { | 161 | user.then((result) => { |
161 | - console.log(result); | ||
162 | 162 | ||
163 | if (result.logData.gender === '0') { | 163 | if (result.logData.gender === '0') { |
164 | userGender = 0; | 164 | userGender = 0; |
... | @@ -172,11 +172,11 @@ function WeatherPage(props) { | ... | @@ -172,11 +172,11 @@ function WeatherPage(props) { |
172 | 172 | ||
173 | const onClickLogout = useCallback((event) => { | 173 | const onClickLogout = useCallback((event) => { |
174 | dispatch(logout()); | 174 | dispatch(logout()); |
175 | - navigate('../login'); | 175 | + navigate('/login'); |
176 | }) | 176 | }) |
177 | 177 | ||
178 | const onClickRegister = useCallback((event) => { | 178 | const onClickRegister = useCallback((event) => { |
179 | - navigate('../register'); | 179 | + navigate('/'); |
180 | }) | 180 | }) |
181 | 181 | ||
182 | const onClickTitle = useCallback((event) => { | 182 | const onClickTitle = useCallback((event) => { |
... | @@ -198,7 +198,6 @@ function WeatherPage(props) { | ... | @@ -198,7 +198,6 @@ function WeatherPage(props) { |
198 | rain : isRain | 198 | rain : isRain |
199 | } | 199 | } |
200 | 200 | ||
201 | - console.log(sendData); | ||
202 | dispatch(recommend(sendData)); | 201 | dispatch(recommend(sendData)); |
203 | navigate('/recommand'); | 202 | navigate('/recommand'); |
204 | 203 | ||
... | @@ -258,7 +257,7 @@ function WeatherPage(props) { | ... | @@ -258,7 +257,7 @@ function WeatherPage(props) { |
258 | </div> | 257 | </div> |
259 | <div className="weather-btn-area" onClick={onSubmitHandler}> | 258 | <div className="weather-btn-area" onClick={onSubmitHandler}> |
260 | <button className="submit-btn"> | 259 | <button className="submit-btn"> |
261 | - 양식 제출 | 260 | + 옷 추천 |
262 | </button> | 261 | </button> |
263 | </div> | 262 | </div> |
264 | </div> | 263 | </div> | ... | ... |
-
Please register or login to post a comment