-
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
[김주은] sprint10 #305
The head ref may contain hidden characters: "Next-\uAE40\uC8FC\uC740-sprint10"
[김주은] sprint10 #305
Conversation
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.
좋습니다 주은님!
언제나 주은님 코드 보면 놀래요 자신감을 가져도 좋을 거 같아요 ㅎㅎ!
이번 한주도 화이팅이에요 👍
<> | ||
<section className={styles.contentWrapper}> | ||
<p className={styles.content}>{comment.content}</p> | ||
<Image src="/ic_modify.png" alt="수정 아이콘" width={24} height={24} /> |
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.
alt 속성은 습관적으로 사용하기! 👍
@@ -12,7 +12,7 @@ const Dropdown = ({ options, selectedValue, onSelect }: DropdownProps) => { | |||
const [isOpen, setIsOpen] = useState(false); | |||
|
|||
const toggleDropdown = () => { | |||
setIsOpen(!isOpen); | |||
setIsOpen((prev) => !prev); |
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 nextPreviewImg = URL.createObjectURL(value); | ||
setPreviewImg(nextPreviewImg); | ||
setShowPreview(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.
shopPreview 상태는 previewImg 상태로부터 유도될 수 있을 것 같아서 굳이 필요 없는 state 같다 라는 생각이 드는데 한번 고민해보시면 좋을 것 같네요!
}; | ||
|
||
useEffect(() => { | ||
if (!value) 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.
얼리 리턴 굿이에요!
setPreviewImg(nextPreviewImg); | ||
setShowPreview(true); | ||
|
||
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.
클린업까지 굿굿이이에요!!
/> | ||
</div> | ||
<div> | ||
{showPreview ? ( |
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.
조건 결과 하나가 null일 경우에는 &&연산자를 사용해주시는 것이 가독성 면에서도 좋습니다!
]; | ||
|
||
async function getArticles(orderBy: string, keyword: string) { | ||
const nextArticles: Article[] = await fetchAllArticles(orderBy, keyword); |
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.
try catch 로 api 호출하는 함수를 감싸주면 더 안전하고 좋을 것 같아요!
export default instance; | ||
|
||
export const fetchArticles = async () => { | ||
try { |
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.
오! 여기는 에러 핸들링을 아주 잘해주셨어요!
let article = null; | ||
try { | ||
const res = await instance.get(`/articles/${id}`); | ||
article = res.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.
여기서 성공했다면 필요한 props들 바로 return 해줘도 좋을듯!
요구사항
기본
상품 등록 페이지
상품 상세 페이지
주요 변경사항
스크린샷
멘토에게