-
Notifications
You must be signed in to change notification settings - Fork 35
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-\uC624\uC815\uBBFC-sprint11"
[오정민] sprint11 #319
Conversation
@@ -37,7 +38,7 @@ function AddComment({ id, setCommentList }: AddCommentProps) { | |||
let newComment: IComment; | |||
try { | |||
const response = await axios.post( | |||
`/articles/${id}/comments`, | |||
API_PATH.articleComments(id), |
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.
피드백대로 잘 바꾸어 주셨네요 !!!
@@ -0,0 +1,30 @@ | |||
import Image, { StaticImageData } from "next/image"; | |||
|
|||
interface Data { |
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.
Data
보다 좀 더 구체적인 네이밍이면 좋겠습니다 ! ^^
if (typeof window !== "undefined") { | ||
const isSignedIn = !!localStorage.getItem("user_information"); | ||
useEffect(() => { | ||
setIsLogin(isSignedIn); | ||
}, [isSignedIn]); | ||
} | ||
|
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.
이 코드가 잘 동작하나요... ? useEffect
는 조건문안에서 사용 할 수 없는 걸로 기억이 납니다.
에러가 안났어요?
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 dayjs from "dayjs"; | ||
import "dayjs/locale/ko"; | ||
|
||
dayjs.locale("ko"); |
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.
dayjs
사용 잘 하셨어용 !
Home.getLayout = function getLayout(page: ReactElement) { | ||
return <>{page}</>; | ||
}; |
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.
Layout
이렇게 하신거 잘 하신 것 같아요. 조건부 렌더링도 있지만 Next에서 권장하는 방법대로 잘 하셨네용 !
{errors.email && errors.email.type === "required" && ( | ||
<p>이메일을 입력해주세요</p> | ||
)} | ||
{errors.email && errors.email.type === "pattern" && ( | ||
<p>잘못된 이메일 형식입니다</p> | ||
)} |
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.
꼼곰한 에러 처리 잘 하셨네용. 따로 컴포넌트로 만드는 것도 좋을 것 같아요.
const EmailErros = () => {
return <>
{errors.email && errors.email.type === "required" && (
<p>이메일을 입력해주세요</p>
)}
{errors.email && errors.email.type === "pattern" && (
<p>잘못된 이메일 형식입니다</p>
)}
</>
}
{errors.password && errors.password.type === "required" && ( | ||
<p>비밀번호를 입력해주세요</p> | ||
)} | ||
{errors.password && errors.password.type === "minLength" && ( | ||
<p>비밀번호를 8자 이상 입력해주세요</p> | ||
)} |
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.
여기두 에러 보여주기용 컴포넌트를 따로 만들어서 렌더링하면 좀 더 깔끔 할 것 같아요 !
const isSignedUp = !!localStorage.getItem("user_information"); | ||
if (isSignedUp) { | ||
// TODO: toast 메시지 - 회원가입 내역 존재 | ||
router.push(`/login`); | ||
} |
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.
이 부분은 useEffect
로 컨트롤해야 잘 동작 할 것 같아요.
const isFormCompleted = email && nickname && password && passwordConfirmation; | ||
const isPasswordValid = password === passwordConfirmation; | ||
const isButtonDisabled = !isFormCompleted || !isPasswordValid || isSubmitting; |
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.
ts-patterns
를 사용하면 좀 깔금하게 해결 될 것 같은 부분처럼 보여요 ㅎㅎㅎ
피드백도 잘 적용해주시고 완성까지 해주셨네요 ! 수고하셨습니다. |
요구사항
기본
회원가입
로그인
메인
심화
추가할 것
주요 변경사항
스크린샷
멘토에게