Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
feat :: Guide
Browse files Browse the repository at this point in the history
  • Loading branch information
jiyun0220 committed Aug 26, 2024
1 parent 73ee88b commit 6f904d8
Show file tree
Hide file tree
Showing 19 changed files with 333 additions and 162 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file modified crescendo-web/.DS_Store
Binary file not shown.
Binary file modified crescendo-web/src/.DS_Store
Binary file not shown.
21 changes: 13 additions & 8 deletions crescendo-web/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -37,7 +43,6 @@ const App = () => {
return null;
}

// 현재 경로에 따라 콘텐츠를 표시할지 결정. 빈 배열로 설정하면 모든 경로에서 콘텐츠가 표시되지 않음
const showContent = ["/"].includes(location.pathname);

return (
Expand All @@ -61,14 +66,14 @@ const App = () => {
)}

<Routes>
<Route path="/signup1" element={<SignUp1 />} />
<Route path="/signup2" element={<SignUp2 />} />
<Route path="/signup3" element={<SignUp3 />} />
<Route path="/signup1" element={<SignUp1 formData={formData} setFormData={setFormData} />} />
<Route path="/signup2" element={<SignUp2 formData={formData} setFormData={setFormData} />} />
<Route path="/signup3" element={<SignUp3 formData={formData} />} />
<Route path="/login" element={<Login />} />
<Route path="/main" element={<Main />} />
<Route path="/Guide" element={<Guide />} />
<Route path="/Counsel" element={<Counsel />} />
<Route path="/Board" element={<Board />} />
<Route path="/Main" element={<Main/>}/>
<Route path="/Guide" element={<Guide/>}/>
<Route path="/Counsel" element={<Counsel/>}/>
<Route path="/Board" element={<Board/>}/>
</Routes>
</>
);
Expand Down
97 changes: 58 additions & 39 deletions crescendo-web/src/Login.js
Original file line number Diff line number Diff line change
@@ -1,52 +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 (
<header>
<div className="line"></div>
<div id="idBox">
<h1>
로그인을 위해
<br />
아이디와 비밀번호를
<br />
정확하게 입력해주세요!
</h1>
</div>
function Login() {
const navigate = useNavigate();
const [loginData, setLoginData] = useState({
id: "",
password: "",
});

<input id="inputId" type="text" placeholder="아이디 입력" />
<br />
<input id="inputPwd" type="text" placeholder="비밀번호 확인 입력" />
</header>
);
}
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("http://20.41.66.225/auth/login", loginData);

return (
<div className="btns">
<input id="prevBtn" type="button" onClick={() => navigate(-1)} />
<input
id="login"
type="button"
value="로그인"
onClick={() => navigate("/main")}
/>
<input id="helpBtn" type="button" />
</div>
);
}
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 (
<div>
<Header />
<Button />
<header>
<div className="line"></div>
<div id="idBox">
<h1>
로그인을 위해
<br />
아이디와 비밀번호를
<br />
정확하게 입력해주세요!
</h1>
</div>
<input
id="inputId"
type="text"
name="id"
placeholder="아이디 입력"
value={loginData.id}
onChange={handleInputChange}
/>
<br />
<input
id="inputPwd"
type="password"
name="password"
placeholder="비밀번호 입력"
value={loginData.password}
onChange={handleInputChange}
/>
</header>
<div className="btns">
<button id="prevBtn" onClick={() => navigate(-1)} aria-label="Previous" />
<button id="login" onClick={handleLogin} aria-label="Login">로그인</button>
<button id="helpBtn" aria-label="Help" />
</div>
</div>
);
}

export default SignUp2;
export default Login;
65 changes: 31 additions & 34 deletions crescendo-web/src/SignUp1.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,42 @@ import React from "react";
import { useNavigate } from "react-router-dom";
import "./SignUp1.css";

function Header() {
return (
<header>
<div className="line"></div>
<div id="idBox">
<h1>
환영합니다!
<br />
당신의 이름을 알려주세요
</h1>
<div>로그인시 사용할 아이디에요</div>
</div>

<input id="inputId" type="text" placeholder="아이디 입력" />
</header>
);
}

function Button() {
function SignUp1({ formData, setFormData }) {
const navigate = useNavigate();

return (
<div>
<button id="prevBtn" onClick={() => navigate(-1)} aria-label="Previous" />
<button
id="nextBtn"
onClick={() => navigate("/signup2")}
aria-label="Next"
/>
<button id="helpBtn" aria-label="Help" />
</div>
);
}
const handleInputChange = (e) => {
setFormData({ ...formData, id: e.target.value });
};

function SignUp1() {
return (
<div>
<Header />
<Button />
<header>
<div className="line"></div>
<div id="idBox">
<h1>
환영합니다!
<br />
당신의 이름을 알려주세요
</h1>
<div>로그인 시 사용할 아이디에요</div>
</div>
<input
id="inputId"
type="text"
placeholder="아이디 입력"
value={formData.id}
onChange={handleInputChange}
/>
</header>
<div>
<button id="prevBtn" onClick={() => navigate(-1)} aria-label="Previous" />
<button
id="nextBtn"
onClick={() => navigate("/signup2")}
aria-label="Next"
/>
<button id="helpBtn" aria-label="Help" />
</div>
</div>
);
}
Expand Down
73 changes: 41 additions & 32 deletions crescendo-web/src/SignUp2.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,52 @@ import React from "react";
import { useNavigate } from "react-router-dom";
import "./SignUp1.css";

function Header() {
return (
<header>
<div className="line"></div>
<div id="idBox">
<h1>
회원가입을 위해
<br />
비밀번호를 작성해주세요
</h1>
<div>정확한 확인을 위해 인증도 진행해 주세요</div>
</div>

<input id="inputPwd" type="text" placeholder="비밀번호 입력" />
<br />
<input id="inputRePwd" type="text" placeholder="비밀번호 확인 입력" />
</header>
);
}

function Button() {
function SignUp2({ formData, setFormData }) {
const navigate = useNavigate();

return (
<div>
<input id="prevBtn" type="button" onClick={() => navigate(-1)} />
<input id="nextBtn" type="button" onClick={() => navigate("/signup3")} />
<input id="helpBtn" type="button" />
</div>
);
}
const handleInputChange = (e) => {
setFormData({ ...formData, [e.target.name]: e.target.value });
};

function SignUp2() {
return (
<div>
<Header />
<Button />
<header>
<div className="line"></div>
<div id="idBox">
<h1>
회원가입을 위해
<br />
비밀번호를 작성해주세요
</h1>
<div>정확한 확인을 위해 인증도 진행해 주세요</div>
</div>
<input
id="inputPwd"
type="password"
name="password"
placeholder="비밀번호 입력"
value={formData.password}
onChange={handleInputChange}
/>
<br />
<input
id="inputRePwd"
type="password"
name="confirmPassword"
placeholder="비밀번호 확인 입력"
value={formData.confirmPassword}
onChange={handleInputChange}
/>
</header>
<div>
<button id="prevBtn" onClick={() => navigate(-1)} aria-label="Previous" />
<button
id="nextBtn"
onClick={() => navigate("/signup3")}
aria-label="Next"
/>
<button id="helpBtn" aria-label="Help" />
</div>
</div>
);
}
Expand Down
58 changes: 28 additions & 30 deletions crescendo-web/src/SignUp3.js
Original file line number Diff line number Diff line change
@@ -1,42 +1,40 @@
import React from "react";
import { useNavigate } from "react-router-dom";
import "./SignUp1.css";
import axios from "axios";

function Header() {
return (
<header className="checkSet">
<div className="line"></div>
<img src={require("./image/check.png")} className="check" alt="check" />
<div id="inBox">
<h1 id="signUp3">flower님, 반가워요!</h1>
<h2>해바라기를 시작해볼까요?</h2>
</div>
</header>
);
}

function Button() {
function SignUp3({ formData }) {
const navigate = useNavigate();

return (
<div>
<input id="prevBtn" type="button" onClick={() => navigate(-1)} />
<input
id="startBtn"
type="button"
value="시작하기"
onClick={() => navigate("/")}
/>
<input id="helpBtn" type="button" />
</div>
);
}
const handleSubmit = async () => {
try {
const response = await axios.post("http://20.41.66.225/auth/signup", 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 (
<div>
<Header />
<Button />
<header>
<div className="line"></div>
<img src={require("./image/check.png")} className="check" alt="check" />
<div id="inBox">
<h1>{formData.id}님, 반가워요!</h1>
<h2>해바라기를 시작해볼까요?</h2>
</div>
</header>
<div>
<button id="prevBtn" onClick={() => navigate(-1)} aria-label="Previous" />
<button id="startBtn" onClick={handleSubmit} aria-label="Start">시작하기</button>
<button id="helpBtn" aria-label="Help" />
</div>
</div>
);
}
Expand Down
Binary file modified crescendo-web/src/image/.DS_Store
Binary file not shown.
Binary file added crescendo-web/src/image/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added crescendo-web/src/image/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added crescendo-web/src/image/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added crescendo-web/src/image/4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added crescendo-web/src/image/5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added crescendo-web/src/image/6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 6f904d8

Please sign in to comment.