-
Notifications
You must be signed in to change notification settings - Fork 0
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
장식초를 구매할 수 있고, 편지를 작성하면 포인트를 얻는다. #47
Conversation
}} | ||
> | ||
{candle.point === 0 && <CandleBadge>free</CandleBadge>} | ||
{candle.point !== 0 && <CandleBadge>{candle.point}p</CandleBadge>} |
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.
여기는 이렇게 바꿔야겠습니닷 다음 PR때 반영할게요오!
<CandleBadge>{candle.point === 0 ? free :
${candle.point}P}</CandleBadge>
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.
수고하셨습니다~~ zod 타입 이름 유형이 서로 달라서 이 부분도 얘기하고 통일해가면 좋을 것 같아요~~~✨👍
<ColorContainer> | ||
{colors.map((color, index) => ( | ||
<ColorOption | ||
key={index} |
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.
key
를 index
로 지정하는 것은 최후의 수단입니다.
color도 유니크한 데이터 아닌가요?
const letter = LetterResponseType.parse( | ||
await createLetter({ | ||
senderId, | ||
recipientId, | ||
candleId, | ||
nickname, | ||
contents, | ||
keyword, | ||
year, | ||
}), | ||
); |
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.
최대한 한줄로 처리하려는 사람을 one-liner
라고 해요 가독성에 좋지 않은 안티패턴입니다.
const { point } = req.body; | ||
|
||
try { | ||
const user = UserType.parse(await subtractPoint(userId, Number(point))); |
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.
one-liner readability
} | ||
} | ||
|
||
// letter/create/ownerId?candleId=123 |
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.
의미를 파악하기 어려운 주석은 제거하세요.
return res.data; | ||
} | ||
} catch (error) { | ||
console.log(error); |
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.
console.log는 로컬에만 존재하는 코드입니다.
fetchUserInfo().then((data) => { | ||
if (data) { | ||
setSenderId(data.userId); | ||
setNickname(data.nickname); | ||
} | ||
}); |
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.
(스타일) 즉시 실행함수로 async await을 사용할 수도 있습니다.
<input | ||
type="text" | ||
value={nickname} | ||
style={{ marginBottom: '10px', width: '50%', height: '2rem' }} |
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.
inline 스타일은 지양하세요
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.
이런 svg는 차라리 외부리소스로 따로 분리하시고 lazy하게 가져오세요 inline svg로 넣기엔 너무 커요.
if (error.response?.status === 401) { | ||
return null; | ||
} else { | ||
throw new Error(`${error}`); |
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를 사용할때 이러한 암시적 형변환은 일반적으로 사용하지 않습니다. 명시적으로 형변환 하세요.
<Button | ||
type="default" | ||
label="로그인하러 가기" | ||
onClick={() => { | ||
navigate('/'); | ||
}} | ||
/> |
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
이 많이 반복되고 있는데, Link
컴포넌트를 만드는 것은 어떨까요?
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.
styled-component를 사용하는데 인라인 스타일은 왜 사용하시나요?
PR 유형 선택
✨ 기능 추가
🐛 버그 수정
🖼️ UI 변경
🫧 코드 리팩토링
✅ 테스트 코드 추가
📦 기타 (문서, CI/CD, 되돌리기, 포맷팅 …)
작업 내용
관련 문서
7월 16일 스크럼
리뷰 요구사항 (선택)