Skip to content

Commit

Permalink
Merge pull request #81 from LikeLionHGU/yeji1-style/#78
Browse files Browse the repository at this point in the history
feat : 로그인, 회원가입 기능 구현
  • Loading branch information
skwldwld authored Feb 22, 2024
2 parents db16f61 + 16d2a1c commit ee36a3a
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 27 deletions.
39 changes: 26 additions & 13 deletions src/account/LogIn.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import logo from "./img/logo.png";
import LoginRect from "./img/loginrect.png";
import emailicon from "./img/emailicon.png";
import pwicon from "./img/pwicon.png";
import warningicon from "./img/warningicon.png";
import kakaologo from "./img/kakaologo.png";

import styles from "./LogIn.module.css";
Expand All @@ -21,6 +22,7 @@ const LogIn = () => {
const [email, setEmailinput] = useState("");
const [password, setPasswordinput] = useState("");
const [isSuccessful, setisSuccessfulinput] = useState("");
const [memberId, setmemberId] = useState("");

const [message, setMessage] = useState("");

Expand All @@ -37,18 +39,26 @@ const LogIn = () => {
email: email,
password: password,
isSuccessful: isSuccessful,
memberId: memberId,
}),
})
.then((response) => response.json)
.then((result) => console.log("결과: ", result))
.then((response) => response.json())
.then((result) => {
if (result.isSuccessful) {
localStorage.setItem("member_id", JSON.stringify(result.memberId));
navigate("/");
} else {
console.log("AAaAAA", result.isSuccessful);
setMessage(
// { warningicon },
"아이디 또는 비밀번호를 잘못 입력했습니다. 입력하신 내용을 다시 확인해주세요."
);
}
})
.catch((error) => {
setMessage(error.response.data.message);
console.log(error);
console.log(">>>>>>", error.response);
});

if (isSuccessful === false) {
return alert("DKFJS");
}
};

const LoginFunc = (e) => {
Expand Down Expand Up @@ -105,17 +115,20 @@ const LogIn = () => {
className={!message ? "inputLogin" : "err_password"}
placeholder="비밀번호"
/>
<p className={styles.err}>{message}</p>
</span>
</div>
<div className={styles.warning}>
{/* <img src="warningicon" /> */}
<p>{message}</p>
</div>
</div>
</div>
<div className={styles.btn}>
<Link to="/">
<button className={styles.buttonlogin} onClick={loginaxios}>
로그인
</button>
</Link>
{/* <Link to="/"> */}
<button className={styles.buttonlogin} onClick={loginaxios}>
로그인
</button>
{/* </Link> */}
</div>
{/* <div className={styles.btn}>
<button className={styles.buttonkakaologin} onClick={loginaxios}>
Expand Down
4 changes: 4 additions & 0 deletions src/account/LogIn.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,7 @@
.buttonkakaologin {
background-color: #ffe812;
}
.warning {
color: red;
font-size: small;
}
Binary file added src/account/img/warningicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 20 additions & 11 deletions src/header/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,21 @@ import Login from "./login/Login";
import BoardList from "./search/BoardList";
import Search from "./search/Search";
import { Link } from "react-router-dom";

import logoimg from "./image/logo.png";
import chatimg from "./image/chat.png";
import bellimg from "./image/bell.png";
import profile from "./image/profile.png";
import logout from "./image/logout.png";

import styles from "./Header.module.css";

export default function Header() {
return (
<div className={styles.header}>
<span className={styles.logo}>
<Link to="/">
{/* <h1>MakeUs</h1> */}
<img src={logoimg} />
</Link>
</span>
Expand All @@ -25,20 +29,25 @@ export default function Header() {
</Link>
</span>
<span className={styles.icon}>
<span id={styles.chat}>
{/* <span id={styles.chat}>
<button>
<img src={chatimg} />
</button>
</span>
<span id={styles.notice}>
<button>
<img src={bellimg} />
</button>
</span>
<span id={styles.profile}>
<Link to="/login">
<img src={profile} />
</Link>
</span> */}
<span id={styles.menuicon}>
<span id={styles.notice}>
<button>
<img src={bellimg} />
</button>
</span>
<span id={styles.profile}>
<Link to="/login">
<img src={profile} />
</Link>
</span>
<span id={styles.logout}>
<img src={logout} />
</span>
</span>
</span>
</div>
Expand Down
36 changes: 34 additions & 2 deletions src/header/Header.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@
justify-content: center;
}

.header .logo h1 {
width: 157px;
height: 46px;
margin-right: 56px;
}

.header .logo img {
width: 157px;
height: 36px;
height: 33px;
margin-right: 50px;
}

Expand All @@ -34,29 +40,55 @@
margin-right: 110px;
}

#menuicon {
height: 30px;
border: 1px solid black;
}

.icon {
display: flex;
}

.icon button {
border: none;
background-color: white;
}

.icon > #chat > button {
margin-right: 10px;
}

.icon > #notice > button {
margin-right: 26px;
margin-right: 16px;
}

.icon > #chat > img {
width: 28px;
height: 28px;
margin-right: 20px;
}

.icon > #notice > img {
width: 16px;
height: 20px;
margin-right: 16px;
}

.icon > #logout > img {
width: 16px;
height: 20px;
margin-right: 36px;
}

#logout {
margin-left: 75px;
}

#profile {
width: 32px;
height: 32px;
}

#profile img {
width: 30px;
height: 30px;
Expand Down
Binary file modified src/header/image/bell.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 src/header/image/logout.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 modified src/header/image/profile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/write/BoardWrite.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const BoardWrite = () => {
};

const saveBoard = () => {
navigate("/calendar");
navigate("/calendarmento");
};

const imageInput = useRef();
Expand Down

0 comments on commit ee36a3a

Please sign in to comment.