-
Notifications
You must be signed in to change notification settings - Fork 3
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
[Feat] 최근 본 상품, 구매하기 버튼 동작 구현 #163
The head ref may contain hidden characters: "156-feat-\uCD5C\uADFC-\uBCF8-\uC0C1\uD488-api\uC5F0\uACB0"
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.
LGTM !
src/app/shop/[category]/[productId]/_components/Product/OptionWithButtons.tsx
Outdated
Show resolved
Hide resolved
src/app/shop/[category]/[productId]/_components/Product/OptionWithButtons.tsx
Outdated
Show resolved
Hide resolved
@@ -85,7 +85,7 @@ export default function Header() { | |||
<SearchButton isBlack={isBlack} /> | |||
{!users ? <LoginButton onClick={handleLoginButtonClick} /> : <LogoutButton />} | |||
<button className={cn('user-icon')} type='button' onClick={handleUserIconClick}> | |||
{profileImage ? ( | |||
{profileImage && profileImage !== 'null' ? ( |
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.
{profileImage && profileImage !== 'null' ? ( | |
{profileImage && profileImage != null ? ( |
요즘 자바스크립트 공부하면서 드는 생각인데 이런식으로 null이 문자열로 넘어오는 경우에는 동치연산자 말고 동등 연산자로 사용해도 좋을거같아요
물론 컴포넌트 수정할때 제가 고려하지 못한 부분이지만.. 암튼
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.
예진님 화이띵~!!!
thumbnail={thumbnail} | ||
reviewscount={reviewCount} | ||
isLiked={liked} | ||
category={category} | ||
hasShop={false} |
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.
이거 제가 옵셔널로 바꿔서 이제 false면 안적어도 될꺼에용! 이름이 같은건 ...rest로 할 수 없나요? ㅠ 진짜 프롭스가 넘 많네용,, 제가 만든 부분이라 제가 고민해봐야 할 거 같아요,,
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.
hasShop 말씀하시는걸까용?? 옵셔널로 안되어있는데..!! isLiked는 하트 버튼때문에 대부분 다 필요할거에요!?
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 handleClickBuyButton = () => { | ||
checkUserAndOptions(); | ||
if (checkUserAndOptions()) 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 (checkUserAndOptions()) return; | |
if (checkUserAndOptions()) { | |
return; | |
} |
setCookie('orderId', response.data.toString()); | ||
router.push(ROUTER.MY_PAGE.CHECKOUT); |
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.
orderId 쿠키에 저장하기로 했었나요...?(정말 기억 안남😆)
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 (userData?.data && productId) { | ||
addRecentProduct(productId); | ||
} |
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로 mutation 불러오는 게 개인적으로는 살짝 위험하다고 생각합니다(dependency 관련),
이 부분은 상점 페이지에서 해당 상품을 클릭했을 때 mutation 발생시키는 건 어떨지 제안해봅니다!
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.
좋은 것 같은데 그럼 productlist나 productitem에서 onclick이벤트가 필요한데 지금 둘 다 서버 컴포넌트로 되어있어서🥹 고민을 좀 해봐야겠네요우...
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.
클라이언트 컴포넌트도 서버에서 prerender되기 때문에, prerender때 seo에 필요한 내용들은 반영되도록 하면 클라이언트 컴포넌트로 해도 큰 문제 없을 것 같아요
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.
고생하셨습니닷 👍 리뷰가 증말 늦었군뇨,,, 다른 분들이 좋은 리뷰 많이 달아주셔서 추가할 리뷰는 없었던 것 같아요옹
price: number; | ||
category: 'switch' | 'keyboard' | 'keycap' | 'etc'; | ||
reviewCount: number; | ||
liked: boolean; |
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.
isLiked는 어떠신가용
🚀 작업 내용
📝 참고 사항
🖼️ 스크린샷
🚨 관련 이슈 (이슈 번호)
✅ 체크리스트