-
Notifications
You must be signed in to change notification settings - Fork 2
[feat] style detail page v2.1 구현 #514
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
Open
soyyyyy
wants to merge
25
commits into
develop
Choose a base branch
from
feat/styleDetailPage/#507
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
b306eaa
feat: 스타일 디테일 (목록/상세) 목데이터
soyyyyy 45c3868
feat: 스타일 목록 페이지
soyyyyy 6074a58
chore: 목데이터 수정
soyyyyy dbbf6c0
chore: 주석 수정
soyyyyy f157e0e
feat: 스타일 디테일 페이지
soyyyyy 0985b61
chore: 목데이터 추가
soyyyyy 9c182cf
style: cta 버튼 고정
soyyyyy 65f5794
feat: 스타일 디테일 (목록/상세) 목데이터
soyyyyy 1d96472
feat: 스타일 목록 페이지
soyyyyy 1fac859
chore: 목데이터 수정
soyyyyy 609ea23
chore: 주석 수정
soyyyyy 0d27ecc
feat: 스타일 디테일 페이지
soyyyyy e44f989
chore: 목데이터 추가
soyyyyy 45c8648
style: cta 버튼 고정
soyyyyy 87b6420
style: cta버튼 여백
soyyyyy 77d4a9e
chore: 공컴 수정 반영
soyyyyy c1fd3b9
Merge remote-tracking branch 'origin/feat/styleDetailPage/#507' into …
soyyyyy 96687b6
style: listcard 텍스트 컨테이너 최소 넓이 수정
soyyyyy a6506c4
style: product container style
soyyyyy 5b15123
fix: normalizeColorHexes 함수 객체 형태도 받도록 수정
soyyyyy db20d0b
chore: 스타일 주석 해제
soyyyyy aa95e85
chore: cta버튼 onclick 연결
soyyyyy a233414
fix: 컬러칩 객체 분기 검증 추가
soyyyyy c107595
fix: 찜하기 스토어 구독 (근데 목데이터라 안됨)
soyyyyy 5be76b6
chore: 색상 hex 업데이트
soyyyyy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| import { style } from '@vanilla-extract/css'; | ||
|
|
||
| import { zIndex } from '@/shared/styles/tokens/zIndex'; | ||
| import { fontVars } from '@/shared/styles/tokensV2/font.css'; | ||
| import { unitVars } from '@/shared/styles/tokensV2/unit.css'; | ||
|
|
||
| export const wrapper = style({ | ||
| display: 'flex', | ||
| flexDirection: 'column', | ||
| paddingBottom: '9.6rem', | ||
| }); | ||
|
|
||
| export const container = style({ | ||
| display: 'flex', | ||
| flexDirection: 'column', | ||
| gap: unitVars.unit.gapPadding['700'], | ||
| padding: `${unitVars.unit.gapPadding['300']} ${unitVars.unit.gapPadding['500']}`, | ||
| }); | ||
|
soyyyyy marked this conversation as resolved.
|
||
|
|
||
| export const styleCardInfo = style({}); | ||
|
|
||
| export const productList = style({ | ||
| display: 'flex', | ||
| flexDirection: 'column', | ||
| }); | ||
|
|
||
| export const sectionTitle = style({ | ||
| ...fontVars.font.title_sb_16, | ||
| marginBottom: unitVars.unit.gapPadding['400'], | ||
| }); | ||
|
|
||
| export const products = style({ | ||
| display: 'flex', | ||
| flexDirection: 'column', | ||
| gap: unitVars.unit.gapPadding['200'], | ||
| width: '100%', | ||
| }); | ||
|
|
||
| export const ctaBtn = style({ | ||
| position: 'fixed', | ||
| zIndex: zIndex.button, | ||
| right: 0, | ||
| bottom: unitVars.unit.gapPadding['500'], | ||
| left: 0, | ||
| margin: '0 auto', | ||
| width: `calc(100% - ${unitVars.unit.gapPadding['500']} * 2)`, | ||
| maxWidth: `calc(${unitVars.unit.dimension.wMax} - ${unitVars.unit.gapPadding['500']} * 2)`, | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,16 +3,37 @@ import { useNavigate, useLocation, useParams } from 'react-router-dom'; | |
| import { ROUTES } from '@routes/paths'; | ||
|
|
||
| import { ENTRY_ROUTE, useImageFlowStore } from '@store/useImageFlowStore'; | ||
| import { useSavedItemsStore } from '@store/useSavedItemsStore'; | ||
| import { useUserStore } from '@store/useUserStore'; | ||
|
|
||
| import { useJjymMutation } from '@apis/mutations/useJjymMutation'; | ||
|
|
||
| import ActionButton from '@components/v2/button/actionButton/ActionButton'; | ||
| import TitleNavBar from '@components/v2/navBar/TitleNavBar'; | ||
| import ListCardProduct from '@components/v2/productCard/ListProductCard'; | ||
| import StyleCard from '@components/v2/styleCard/StyleCard'; | ||
|
|
||
| import { setLoginRedirect } from '@utils/loginRedirect'; | ||
|
|
||
| import { STYLE_DETAIL_MOCK } from './mocks/styleDetail'; | ||
| import * as styles from './StyleDetailPage.css'; | ||
| import { normalizeColorHexes } from '../generate/pages/result/curationSection/curationProducts'; | ||
|
Comment on lines
+18
to
+20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 현재 상세 화면은 리스트에서는 Also applies to: 54-77 🤖 Prompt for AI Agents |
||
|
|
||
| const StyleDetailPage = () => { | ||
| const { styleId } = useParams(); | ||
| const navigate = useNavigate(); | ||
| const location = useLocation(); | ||
| const isLoggedIn = !!useUserStore((state) => state.accessToken); | ||
|
|
||
| const savedProductIds = useSavedItemsStore((state) => state.savedProductIds); | ||
|
|
||
| // 찜 해제 토글 | ||
| const { mutate: toggleJjym } = useJjymMutation(); | ||
|
|
||
| const handleToggleSave = (id: number) => { | ||
| toggleJjym(id); | ||
| }; | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| // 스타일 상세 CTA: setFlow(STYLE_RESTYLE) → 로그인 체크 → 스타일 상세로 복귀 | ||
| const handleCta = () => { | ||
| const parsedId = Number(styleId); | ||
|
|
@@ -33,9 +54,58 @@ const StyleDetailPage = () => { | |
| }; | ||
|
|
||
| return ( | ||
| <div> | ||
| <div>스타일 상세 페이지 / styleId: {styleId}</div> | ||
| <button onClick={handleCta}>이 스타일로 우리 집 꾸미기</button> | ||
| <div className={styles.wrapper}> | ||
| <TitleNavBar | ||
| title="스타일 상세 보기" | ||
| backLabel="이전" | ||
| onBackClick={() => navigate(-1)} | ||
| /> | ||
| <div className={styles.container}> | ||
| <section className={styles.styleCardInfo}> | ||
| <StyleCard | ||
| size="L" | ||
| title={STYLE_DETAIL_MOCK.data.styleName} | ||
| largeContents={{ | ||
| title: STYLE_DETAIL_MOCK.data.styleName, | ||
| description: STYLE_DETAIL_MOCK.data.styleDescription, | ||
| }} | ||
| imageSrc={STYLE_DETAIL_MOCK.data.styleImageUrl} | ||
| imageLoading="eager" | ||
| /> | ||
| </section> | ||
| <section className={styles.productList}> | ||
| <span className={styles.sectionTitle}>사용된 가구</span> | ||
| <div className={styles.products}> | ||
| {STYLE_DETAIL_MOCK.data.products.map((item) => ( | ||
| <ListCardProduct | ||
| key={item.id} | ||
| product={{ | ||
| title: item.name, | ||
| imageUrl: item.imageUrl, | ||
| colorHexes: normalizeColorHexes(item.colors), | ||
| }} | ||
| price={{ | ||
| original: item.originalPrice, | ||
| discount: item.finalPrice, | ||
| discountRate: item.discountRate, | ||
| }} | ||
| save={{ | ||
| isSaved: savedProductIds.has(item.id), | ||
| onToggle: () => handleToggleSave(item.id), | ||
| }} | ||
| link={{ | ||
| href: item.linkUrl, | ||
| // onClick: logMyPageClickBtnFurnitureCard, | ||
| }} | ||
| enableWholeCardLink={true} | ||
| /> | ||
| ))} | ||
| </div> | ||
| </section> | ||
| </div> | ||
| <ActionButton onClick={handleCta} className={styles.ctaBtn}> | ||
| 이 스타일로 우리 집 꾸미기 | ||
| </ActionButton> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import { style } from '@vanilla-extract/css'; | ||
|
|
||
| import { unitVars } from '@/shared/styles/tokensV2/unit.css'; | ||
|
|
||
| export const wrapper = style({ | ||
| display: 'flex', | ||
| flexDirection: 'column', | ||
| }); | ||
|
|
||
| export const cardList = style({ | ||
| display: 'flex', | ||
| flexDirection: 'column', | ||
| gap: unitVars.unit.gapPadding['400'], | ||
| padding: `${unitVars.unit.gapPadding['300']} ${unitVars.unit.gapPadding['500']}`, | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,39 @@ | ||
| import { generatePath, useNavigate } from 'react-router-dom'; | ||
|
|
||
| import { ROUTES } from '@/routes/paths'; | ||
| import TitleNavBar from '@/shared/components/v2/navBar/TitleNavBar'; | ||
| import StyleCard from '@/shared/components/v2/styleCard/StyleCard'; | ||
|
|
||
| import { STYLELIST_MOCK } from './mocks/styleDetail'; | ||
| import * as styles from './StyleListPage.css'; | ||
|
|
||
| const StyleListPage = () => { | ||
| return <div>스타일 목록 페이지</div>; | ||
| const navigate = useNavigate(); | ||
| const handleStyleClick = (styleId: number) => { | ||
| navigate(generatePath(ROUTES.STYLE_DETAIL, { styleId: String(styleId) })); | ||
| }; | ||
|
|
||
| return ( | ||
| <section className={styles.wrapper}> | ||
| <TitleNavBar | ||
| title="스타일 전체 보기" | ||
| backLabel="이전" | ||
| onBackClick={() => navigate(-1)} | ||
| /> | ||
| <div className={styles.cardList}> | ||
| {STYLELIST_MOCK.data.otherStyles.map((style) => ( | ||
| <StyleCard | ||
| size="L" | ||
| key={style.id} | ||
| imageSrc={style.imageUrl} | ||
| title={style.name} | ||
| onClick={() => handleStyleClick(style.id)} | ||
| imageLoading="eager" | ||
| /> | ||
| ))} | ||
| </div> | ||
| </section> | ||
| ); | ||
| }; | ||
|
|
||
| export default StyleListPage; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,116 @@ | ||
| export const STYLELIST_MOCK = { | ||
| data: { | ||
| otherStyles: [ | ||
| { | ||
| id: 1, | ||
| name: '미니멀한 개발자의 집', | ||
| imageUrl: '@assets/v2/images/Imgbanner_01.png', | ||
| }, | ||
| { | ||
| id: 2, | ||
| name: '미니멀한 개발자의 집', | ||
| imageUrl: '@assets/v2/images/Imgbanner_02.png', | ||
| }, | ||
| { | ||
| id: 3, | ||
| name: '빈티지 카페 감성 공간', | ||
| imageUrl: '@assets/v2/images/Imgbanner_03.png', | ||
|
soyyyyy marked this conversation as resolved.
|
||
| }, | ||
| { | ||
| id: 4, | ||
| name: '미니멀한 개발자의 집', | ||
| imageUrl: '@assets/v2/images/Imgbanner_04.png', | ||
| }, | ||
| { | ||
| id: 5, | ||
| name: '미니멀한 개발자의 집', | ||
| imageUrl: '@assets/v2/images/Imgbanner_01.png', | ||
| }, | ||
| { | ||
| id: 6, | ||
| name: '미니멀한 개발자의 집', | ||
| imageUrl: '@assets/v2/images/Imgbanner_02.png', | ||
| }, | ||
| { | ||
| id: 7, | ||
| name: '미니멀한 개발자의 집', | ||
| imageUrl: '@assets/v2/images/Imgbanner_03.png', | ||
| }, | ||
| ], | ||
| }, | ||
| }; | ||
|
|
||
| export const STYLE_DETAIL_MOCK = { | ||
| data: { | ||
| styleName: '미니멀한 개발자의 집', | ||
| styleImageUrl: '@assets/v2/images/Imgbanner_01.png', | ||
| styleDescription: | ||
| '블랙을 중심으로 모노톤 인테리어에 핑크 포인트로 감각을 더한 개발자의 집이다. 층고가 높은 복층으로 업무 책상을 복층에 배치해 공간 활용성을 높였다. 높였더높였다높였다높여다높여', | ||
|
soyyyyy marked this conversation as resolved.
|
||
| products: [ | ||
| { | ||
| id: 1, | ||
| name: '리샘 코지 저상형 평상형 무헤드 침대(SS/Q) 매트리스 선택', | ||
| imageUrl: '@assets/v2/images/Product_01.png', | ||
| originalPrice: 39900, | ||
| discountRate: 30, | ||
| finalPrice: 27990, | ||
| linkUrl: '@assets/v2/images/Imgbanner_01.png', | ||
| isLiked: false, | ||
| colors: [ | ||
| { | ||
| name: '블루', | ||
| value: '#0000FF', | ||
| }, | ||
| ], | ||
| }, | ||
| { | ||
| id: 2, | ||
| name: '리샘 코지 저상형 평상형 무헤드 침대(SS/Q) 매트리스 선택', | ||
| imageUrl: '@assets/v2/images/Product_01.png', | ||
| originalPrice: 39900, | ||
| discountRate: 30, | ||
| finalPrice: 27990, | ||
| linkUrl: '@assets/v2/images/Imgbanner_01.png', | ||
| isLiked: true, | ||
| colors: [ | ||
| { | ||
| name: '브라운', | ||
| value: '#8B4513', | ||
| }, | ||
| ], | ||
| }, | ||
| { | ||
| id: 3, | ||
| name: '리샘 코지 저상형 평상형 무헤드 침대(SS/Q) 매트리스 선택', | ||
| imageUrl: '@assets/v2/images/Product_01.png', | ||
| originalPrice: 39900, | ||
| discountRate: 30, | ||
| finalPrice: 27990, | ||
| linkUrl: '@assets/v2/images/Imgbanner_01.png', | ||
| isLiked: true, | ||
| colors: [ | ||
| { | ||
| name: '브라운', | ||
| value: '#8B4513', | ||
| }, | ||
| ], | ||
| }, | ||
| { | ||
| id: 4, | ||
| name: '리샘 코지 저상형 평상형 무헤드 침대(SS/Q) 매트리스 선택', | ||
| imageUrl: '@assets/v2/images/Product_01.png', | ||
| originalPrice: 39900, | ||
| discountRate: 30, | ||
| finalPrice: 27990, | ||
| linkUrl: '@assets/v2/images/Imgbanner_01.png', | ||
| isLiked: true, | ||
| colors: [ | ||
| { | ||
| name: '브라운', | ||
| value: '#8B4513', | ||
| }, | ||
| ], | ||
| }, | ||
| ], | ||
| }, | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🧹 Nitpick | 🔵 Trivial
색상 파싱 로직 중복을 헬퍼로 추출해 유지보수성을 높여주세요.
객체 분기와 문자열 분기에서
trim → hex 검사 → 이름 매핑로직이반복됩니다. 규칙 변경 시 한쪽만 수정되는 리스크가 있습니다.
리팩터링 예시
🤖 Prompt for AI Agents