-
Notifications
You must be signed in to change notification settings - Fork 37
[김승석] Sprint11 #319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[김승석] Sprint11 #319
The head ref may contain hidden characters: "Next-\uAE40\uC2B9\uC11D-sprint11"
Conversation
conflict 해결해주세요! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import React from "react";
type InputProps = React.InputHTMLAttributes<HTMLInputElement>;
const CustomInput: React.FC<InputProps> = (props) => {
return <input {...props} />;
};
export default CustomInput;
이렇게props를 넘긴다면 보다 확장성 있겠죠?
src/pages/login/index.tsx
Outdated
<img src="/assets/img/logo.svg" alt="로고" /> | ||
</Link> | ||
</div> | ||
<form action=""> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
action이 비어있네요
src/pages/login/index.tsx
Outdated
</div> | ||
</li> | ||
<li> | ||
<button className="btn round block large" disabled={true}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
button의 type을 명시해주세요!
if (result) { | ||
localStorage.removeItem("accessToken"); | ||
localStorage.removeItem("refreshToken"); | ||
localStorage.removeItem("user"); | ||
setIsLoggedIn(false); | ||
} else { | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if(!result) return;
localStorage.removeItem("accessToken");
localStorage.removeItem("refreshToken");
localStorage.removeItem("user");
setIsLoggedIn(false);
이런식으로 early return기법을 사용해보는건 어떨까요
import axios from "axios"; | ||
|
||
const Instance = axios.create({ | ||
baseURL: "https://panda-market-api.vercel.app", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
baseURL같은건 env로 관리하는게 더 좋아보이네요
if (!email || !password) { | ||
alert("모든 필드를 채워주세요."); | ||
return; | ||
} | ||
if (!/\S+@\S+\.\S+/.test(email)) { | ||
alert("유효한 이메일 주소를 입력해주세요."); | ||
return; | ||
} | ||
if (password.length < 8) { | ||
alert("비밀번호는 최소 8자 이상이어야 합니다."); | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
validation로직은 submit함수에서 따로 추출하는게 더 좋아보이네요
요구사항
기본
회원가입
로그인
헤더
심화
멘토에게