React 김세환 sprint6#52
Hidden character warning
Conversation
78ad799 to
b5d5281
Compare
f3eb26f to
b5d5281
Compare
1ce39d5 to
92ce525
Compare
92ce525 to
113950f
Compare
seobew
left a comment
There was a problem hiding this comment.
세환님 고생 많으셨습니다!
네이밍 컨벤션 관련해서 좀더 신경써주시면 좋을것 같고,
나머지는 구현 못하신 부분 제외하고 깔끔하게 잘 작성해주신것 같아요 ㅎㅎ
몇가지 코멘트 달아놨으니 한번 확인 부탁드려요~
수고하셨습니다!
| page = 1, | ||
| sort = "recent", | ||
| keyword = "", | ||
| } |
|
|
||
| export function BestProducts() { | ||
|
|
||
| const emptyHeart = require("../images/emptyHeart.png"); |
There was a problem hiding this comment.
이렇게 정적인 파일은 렌더링 되기 위해 실행되는 함수 안보다는 위에 import문 아래에 넣어주는 것이 좋습니다!
| setBestProducts(data); | ||
| data.forEach(product => { | ||
| if (!IsImage(String(product.images))) { | ||
| product.images = noImageAvailable; |
There was a problem hiding this comment.
여기서 넣어주기보다는 아래쪽에서 product.images ?? noImageAvailable로 넣어줘도 괜찮을것 같습니다!
|
|
||
| export function Content() { | ||
|
|
||
| const content_image_01 = require("../images/Img_home_01.png"); |
There was a problem hiding this comment.
js인데 변수는 웬만하면 camel case로 해주는게 좋을듯 합니다!
contentImage01 이런식으로요! 그리고 위에서 말씀드린대로 함수 밖에서 선언해주는게 좋습니다
| const [selectedOption, setSelectedOption] = useState(null); | ||
|
|
||
| const toggleDropdown = () => { | ||
| setIsOpen(!isOpen); |
There was a problem hiding this comment.
요런거는 setIsOpen((v) => !v) 요렇게 쓸수 있을것 같아요~
| ); | ||
| } | ||
|
|
||
| return <p className="dropdown-no-options">옵션이 없습니다.</p>; |
There was a problem hiding this comment.
이걸 if (options.length == = 0) {
return
}
이런식으로 위에서 먼저 간단한 조건들에 대해서 처리하고 그 아래에서 리스트를 보여주는 로직을 넣어주는게 더 좋아보입니다
| tags: product_tags | ||
| }; | ||
|
|
||
| fetch("https://backend-c2ut.onrender.com/product", { |
There was a problem hiding this comment.
요런 api들은 따로 관리를 하고 함수만 호출하는 형태로 바꾸는게 더 좋을듯 합니다!
| export const is_image = ["jpg", "jpeg", "png", "gif", "bmp"]; | ||
|
|
||
| export function IsImage(src) { | ||
| return is_image.includes(src.split(".").pop()); |
There was a problem hiding this comment.
좋습니다 ㅎㅎ 이런 유틸성 헬퍼 파일을 따로 만들고 이름도 image.helper.js 라니!
요구사항
기본 요구사항
공통
프론트엔드 구현 요구사항
랜딩 페이지
중고마켓 페이지
상품 등록 페이지
심화 요구사항
상품 등록 페이지
유효한 조건
주요 변경사항
스크린샷
메인 페이지
중고마켓 페이지
멘토에게