diff --git a/.DS_Store b/.DS_Store index 88eb7c3..315acef 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/crescendo-web/src/App.js b/crescendo-web/src/App.js index cd215ff..984e6e6 100644 --- a/crescendo-web/src/App.js +++ b/crescendo-web/src/App.js @@ -17,6 +17,12 @@ import Counsel from "./pages/Counsel"; import Board from "./pages/Board"; const App = () => { + const [formData, setFormData] = useState({ + id: "", + password: "", + confirmPassword: "", + }); + const [isMobile, setIsMobile] = useState(window.innerWidth <= 768); const location = useLocation(); @@ -37,7 +43,6 @@ const App = () => { return null; } - // 현재 경로에 따라 콘텐츠를 표시할지 결정. 빈 배열로 설정하면 모든 경로에서 콘텐츠가 표시되지 않음 const showContent = ["/"].includes(location.pathname); return ( @@ -61,9 +66,9 @@ const App = () => { )} - } /> - } /> - } /> + } /> + } /> + } /> } /> }/> }/> diff --git a/crescendo-web/src/Login.js b/crescendo-web/src/Login.js index 28e51ae..db88dcb 100644 --- a/crescendo-web/src/Login.js +++ b/crescendo-web/src/Login.js @@ -1,47 +1,71 @@ -import React from "react"; +import React, { useState } from "react"; import { useNavigate } from "react-router-dom"; import "./SignUp1.css"; +import axios from "axios"; -function Header() { - return ( -
-
-
-

- 로그인을 위해 -
- 아이디와 비밀번호를 -
- 정확하게 입력해주세요! -

-
+function Login() { + const navigate = useNavigate(); + const [loginData, setLoginData] = useState({ + id: "", + password: "", + }); - -
- -
- ); -} + const handleInputChange = (e) => { + setLoginData({ ...loginData, [e.target.name]: e.target.value }); + }; -function Button() { - const navigate = useNavigate(); + const handleLogin = async () => { + try { + const response = await axios.post("20.41.66.225", loginData); - return ( -
- navigate(-1)} /> - - -
- ); -} + if (response.status === 200) { + navigate("/Main"); + } else { + console.error("Login failed"); + } + } catch (error) { + console.error("There was an error during the login process:", error); + } + }; -function SignUp2() { return (
-
- +
); } -export default SignUp2; +export default Login; diff --git a/crescendo-web/src/SignUp1.js b/crescendo-web/src/SignUp1.js index 1b13486..67eeb70 100644 --- a/crescendo-web/src/SignUp1.js +++ b/crescendo-web/src/SignUp1.js @@ -2,45 +2,42 @@ import React from "react"; import { useNavigate } from "react-router-dom"; import "./SignUp1.css"; -function Header() { - return ( -
-
-
-

- 환영합니다! -
- 당신의 이름을 알려주세요 -

-
로그인시 사용할 아이디에요
-
- - -
- ); -} - -function Button() { +function SignUp1({ formData, setFormData }) { const navigate = useNavigate(); - return ( -
-
- ); -} + const handleInputChange = (e) => { + setFormData({ ...formData, id: e.target.value }); + }; -function SignUp1() { return (
-
-
); } diff --git a/crescendo-web/src/SignUp2.js b/crescendo-web/src/SignUp2.js index fbb7154..537a1f0 100644 --- a/crescendo-web/src/SignUp2.js +++ b/crescendo-web/src/SignUp2.js @@ -2,43 +2,52 @@ import React from "react"; import { useNavigate } from "react-router-dom"; import "./SignUp1.css"; -function Header() { - return ( -
-
-
-

- 회원가입을 위해 -
- 비밀번호를 작성해주세요 -

-
정확한 확인을 위해 인증도 진행해 주세요
-
- - -
- -
- ); -} - -function Button() { +function SignUp2({ formData, setFormData }) { const navigate = useNavigate(); - return ( -
- navigate(-1)} /> - navigate("/signup3")} /> - -
- ); -} + const handleInputChange = (e) => { + setFormData({ ...formData, [e.target.name]: e.target.value }); + }; -function SignUp2() { return (
-
-
); } diff --git a/crescendo-web/src/SignUp3.js b/crescendo-web/src/SignUp3.js index 9e6b9ee..8ff9b9d 100644 --- a/crescendo-web/src/SignUp3.js +++ b/crescendo-web/src/SignUp3.js @@ -1,42 +1,40 @@ import React from "react"; import { useNavigate } from "react-router-dom"; import "./SignUp1.css"; +import axios from "axios"; -function Header() { - return ( -
-
- check -
-

flower님, 반가워요!

-

해바라기를 시작해볼까요?

-
-
- ); -} - -function Button() { +function SignUp3({ formData }) { const navigate = useNavigate(); - return ( -
- navigate(-1)} /> - navigate("/app")} - /> - -
- ); -} + const handleSubmit = async () => { + try { + const response = await axios.post("20.41.66.225", formData); + + if (response.status === 200) { + navigate("/login"); + } else { + console.error("Signup failed"); + } + } catch (error) { + console.error("There was an error during the signup process:", error); + } + }; -function SignUp3() { return (
-
- +
); } diff --git a/crescendo-web/src/image/.DS_Store b/crescendo-web/src/image/.DS_Store index 830fe13..b2ca7f7 100644 Binary files a/crescendo-web/src/image/.DS_Store and b/crescendo-web/src/image/.DS_Store differ