Skip to content
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

[Fix] 상품 정보 옵션 컴포넌트 수정 #176

Merged
merged 10 commits into from
Aug 18, 2024

Conversation

armd482
Copy link
Contributor

@armd482 armd482 commented Aug 13, 2024

🚀 작업 내용

  • ItemOverview
    • 커스텀 키보드 옵션 보이도록 변경
    • 일반 상품 카테고리 보이도록 변경(일단은 상품 상세로 조회), 클릭 시 상품 상세페이지 이동하도록 추가(optional)
  • 장바구니 페이지, 찜목록 페이지
    • ItemOverview 컴포넌트 적용

🖼️ 스크린샷

image
image
image

📝 참고 사항

  • 상품 카테고리가 포함되어 있지 않아서 개별 상품에 대해서 상품 상세정보 api를 불러와서 카테고리에 적용했습니다
  • 114번 branch merge된 후에 리뷰 남겨주세요!

🚨 관련 이슈 (이슈 번호)

✅ 체크리스트

  • Code Review 요청
  • Label 설정
  • PR 제목 규칙에 맞는지 확인

@armd482 armd482 added 🐞 Fix 버그 수정 📬 API 서버 api 통신 labels Aug 13, 2024
@armd482 armd482 self-assigned this Aug 13, 2024
Copy link
Contributor

@ggjiny ggjiny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생 많으십니다 도원님 최고

@@ -48,6 +48,7 @@
color: $black;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
line-clamp: 2;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아니 이거 꿀팁이네요~

src/components/ItemOverview/ItemOverview.tsx Outdated Show resolved Hide resolved
src/app/my-info/(account)/cart/_components/CartCard.tsx Outdated Show resolved Hide resolved
src/components/ItemOverview/ItemOverview.tsx Outdated Show resolved Hide resolved
src/components/ItemOverview/ItemOverview.tsx Outdated Show resolved Hide resolved
Comment on lines +79 to +87
texture: switchOption.customOption.appearanceTexture,
type: switchOption.customOption.layout,
boardColor: switchOption.customOption.appearanceColor,
switchType: switchOption.customOption.keyboardSwitch,
baseKeyColor: switchOption.customOption.baseKeyColor,
hasPointKeyCap: switchOption.customOption.hasPointKey,
pointKeyType: switchOption.customOption.pointKeyType,
pointSetColor: switchOption.customOption.pointSetColor,
individualColor: switchOption.individualColor,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기도 구조분해 해서 쓰면 조건이 너무 생길까유>?

Copy link
Contributor Author

@armd482 armd482 Aug 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

얘는 타입 조건에 따라서 사용되는 거라, 애매하지 않을까요?
다른 분들의 의견도 궁금하네요!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

switchOption 객체 통으로 넣어도 입력 받는쪽에서 type에 의해 필요한것만 걸러지게 되니까 저도 구조분해가 좋을거같아요

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

구조분해가 되나요...?
타입이 string 또는 객체이고, 전달하는 값도 key가 달라서 바로 전달할 수 없는데...

src/components/ItemOverview/ItemWrapper.tsx Show resolved Hide resolved
src/libs/convertProductCategory.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@bokeeeey bokeeeey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다 LGTM!

src/components/ItemOverview/ItemOverview.tsx Outdated Show resolved Hide resolved
Comment on lines +79 to +87
texture: switchOption.customOption.appearanceTexture,
type: switchOption.customOption.layout,
boardColor: switchOption.customOption.appearanceColor,
switchType: switchOption.customOption.keyboardSwitch,
baseKeyColor: switchOption.customOption.baseKeyColor,
hasPointKeyCap: switchOption.customOption.hasPointKey,
pointKeyType: switchOption.customOption.pointKeyType,
pointSetColor: switchOption.customOption.pointSetColor,
individualColor: switchOption.individualColor,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

switchOption 객체 통으로 넣어도 입력 받는쪽에서 type에 의해 필요한것만 걸러지게 되니까 저도 구조분해가 좋을거같아요

src/libs/convertProductCategory.ts Outdated Show resolved Hide resolved
@@ -9,6 +9,8 @@ export type OptionTypes = {
optionName: string;
};

export type CategoryNameType = 'switch' | 'keyboard' | 'keycap' | 'etc';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as const 로 사용해도 좋을거같군요

팀프로젝트나 개인 작업에서 저는 enum을 많이 활용하고 또 리뷰에서 사용을 추천하고 있었는데 알고보니 enum사용은 모던한 방법이 아니었습니다... ㅋㅋㅋ 여러분들도 enum사용이 컴파일 단계에서 어떤 차이를 두고 변환되는지 알고계시면 도움 될거같아서 공유 드립니다

https://velog.io/@hhhminme/네-Enum-누가-Typescript에서-Enum을-쓰냐

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

제목부터 무섭네요

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as const는 보통 객체 key 가져올 때 타입 확정지을려고 사용하는 거 아닌가요?(enum이랑 비슷한 맥락일 것 같은데...)
오히려 그냥 type 지정하는 게 더 확실한 거 아닌가요?

Copy link
Contributor

@minjeong9919 minjeong9919 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다 👍

@@ -18,7 +20,7 @@ export interface ContentType {
thumbnail: string;
price: number;
reviewCount: number;
category: 'keyboard' | 'keycap' | 'switch' | 'etc';
category: CategoryNameType;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

깔꼼해요

@@ -9,6 +9,8 @@ export type OptionTypes = {
optionName: string;
};

export type CategoryNameType = 'switch' | 'keyboard' | 'keycap' | 'etc';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

제목부터 무섭네요

src/components/ItemOverview/ItemOverview.tsx Outdated Show resolved Hide resolved
src/components/ItemOverview/ItemWrapper.tsx Outdated Show resolved Hide resolved
@armd482 armd482 merged commit 5d2ec27 into develop Aug 18, 2024
@armd482 armd482 deleted the 173-fix-상품-정보-옵션-컴포넌트-수정 branch August 25, 2024 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📬 API 서버 api 통신 🐞 Fix 버그 수정
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Fix] 상품 정보 옵션 컴포넌트 수정
4 participants