-
Notifications
You must be signed in to change notification settings - Fork 1
Feat(client): 레벨 페이지 레이아웃 #57
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
Changes from 5 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,5 +1,58 @@ | ||||||||||||||||||||||||||||||||||
| const Level = () => { | ||||||||||||||||||||||||||||||||||
| return <div className="bg-secondary flex flex-col gap-[2rem] p-[1rem]"></div>; | ||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||
| import { Icon } from '@pinback/design-system/icons'; | ||||||||||||||||||||||||||||||||||
| import { cn } from '@pinback/design-system/utils'; | ||||||||||||||||||||||||||||||||||
| import LevelScene from './components/LevelScene'; | ||||||||||||||||||||||||||||||||||
| import LevelInfoCard from './components/LevelInfoCard'; | ||||||||||||||||||||||||||||||||||
| import TreeStatusCard from './components/TreeStatusCard'; | ||||||||||||||||||||||||||||||||||
| import { getTreeLevel, type TreeLevel } from './utils/treeLevel'; | ||||||||||||||||||||||||||||||||||
| import { Badge } from '@pinback/design-system/ui'; | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export default Level; | ||||||||||||||||||||||||||||||||||
| interface LevelPageProps { | ||||||||||||||||||||||||||||||||||
| acorns?: number; | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export default function Level({ acorns = 3 }: LevelPageProps) { | ||||||||||||||||||||||||||||||||||
|
Member
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. acorns가 optional인 부분과 default가 3이 맞는지 궁금합니다!
Collaborator
Author
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. default 값은 테스트 해보느라 제가 임의로 넣어둔 값이었어요 이부분은 삭제하겠습니다
Member
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. 확인했습니다~ |
||||||||||||||||||||||||||||||||||
| const info = getTreeLevel(acorns); | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||||||||
| <div className={cn('bg-subcolor mx-auto w-full max-w-[96rem]')}> | ||||||||||||||||||||||||||||||||||
| <div className="relative overflow-hidden rounded-[1.2rem]"> | ||||||||||||||||||||||||||||||||||
| <LevelScene level={info.level as TreeLevel} /> | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| <div className="absolute inset-0"> | ||||||||||||||||||||||||||||||||||
| <div className="flex flex-col items-start gap-[2rem] px-[8rem] py-[5.2rem]"> | ||||||||||||||||||||||||||||||||||
| <div className="flex flex-row items-center gap-[0.8rem]"> | ||||||||||||||||||||||||||||||||||
| <h1 className="head3 text-font-black-1">치삐의 지식나무 숲</h1> | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| <div className="relative items-center"> | ||||||||||||||||||||||||||||||||||
| <button | ||||||||||||||||||||||||||||||||||
| type="button" | ||||||||||||||||||||||||||||||||||
| className="peer flex items-center justify-center p-[0.4rem]" | ||||||||||||||||||||||||||||||||||
| aria-describedby="level-info-card" | ||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||
| <Icon name="ic_info" width={20} height={20} /> | ||||||||||||||||||||||||||||||||||
| </button> | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+28
to
+30
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. 🛠️ Refactor suggestion 아이콘 전용 버튼: 접근 가능한 이름과 ARIA 속성 정정 필요 현재 버튼은 시각적 아이콘만 있고 접근 가능한 이름이 없습니다. 또한 - <button
+ <button
type="button"
className="peer p-[0.4rem]"
- aria-describedby="level-info-card"
+ aria-controls="level-info-card"
+ aria-haspopup="dialog"
+ aria-label="레벨 안내 보기"
>팁: 완전한 접근성(포커스 트랩, ESC 닫기, 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
| <div | ||||||||||||||||||||||||||||||||||
| id="level-info-card" | ||||||||||||||||||||||||||||||||||
| className={cn( | ||||||||||||||||||||||||||||||||||
| 'pointer-events-none absolute left-0 top-[3rem] z-[20]', | ||||||||||||||||||||||||||||||||||
| 'opacity-0 transition-opacity duration-150', | ||||||||||||||||||||||||||||||||||
| 'peer-hover:pointer-events-auto peer-focus-visible:pointer-events-auto', | ||||||||||||||||||||||||||||||||||
| 'peer-hover:opacity-100 peer-focus-visible:opacity-100' | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+32
to
+37
Member
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. 이거 cn이 스타일값 객체들을 여러개 합칠 때 사용하는 걸로 아는데요!
Collaborator
Author
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. 맞습니당 이 코드에 따로 분기나 객체 구분은 없어요-! 다만 한줄로 쭉 나열해서 쓰다보면 가독성이 좋지 않아 cn으로 구분해서 사용했습니다-! |
||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||
|
coderabbitai[bot] marked this conversation as resolved.
|
||||||||||||||||||||||||||||||||||
| <LevelInfoCard /> | ||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||
| {/* TODO: 오늘 모은 도토리 개수 배지 */} | ||||||||||||||||||||||||||||||||||
|
Member
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. badge 추가된 걸까요??
Collaborator
Author
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. 아직 수정 안된 부분입니다 따로 원래 있던 뱃지 사용하고있는 코드입니다 |
||||||||||||||||||||||||||||||||||
| <Badge text={'오늘 모은 도토리 개수'} countNum={acorns} /> | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| <div className="flex"> | ||||||||||||||||||||||||||||||||||
| <TreeStatusCard acorns={acorns} /> | ||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| // components/LevelScene.tsx | ||
| import * as React from 'react'; | ||
| import { cn } from '@pinback/design-system/utils'; | ||
| import { type TreeLevel } from '../utils/treeLevel'; | ||
|
Member
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. Level 페이지 컴포넌트에도 해당 type 쓰이던데 util에서 불러오는 것 같아서! util파일이 아닌 type으로 따로 빼고 재사용 해도 되지 않을까요?
Collaborator
Author
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. 유틸이 아닌 타입으로 뺴는게 맞는거 같아보이네요 수정하겠습니다-! |
||
|
|
||
| import chippi_level1 from '../../../assets/chippi_level1.png'; | ||
| import chippi_level2 from '../../../assets/chippi_level2.png'; | ||
| import chippi_level3 from '../../../assets/chippi_level3.png'; | ||
| import chippi_level4 from '../../../assets/chippi_level4.png'; | ||
| import chippi_level5 from '../../../assets/chippi_level5.png'; | ||
|
|
||
| const SCENE_BY_LEVEL: Record<TreeLevel, string> = { | ||
| 1: chippi_level1, | ||
| 2: chippi_level2, | ||
| 3: chippi_level3, | ||
| 4: chippi_level4, | ||
| 5: chippi_level5, | ||
| } as const; | ||
|
|
||
| interface LevelSceneProps extends React.HTMLAttributes<HTMLDivElement> { | ||
| level: TreeLevel; | ||
| } | ||
|
Member
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. 트리셰이킹이 되긴 하겠지만 React 전체 모듈을 불러올 이유가 크게 없다면 그냥 |
||
|
|
||
| export default function LevelScene({ | ||
| level, | ||
| className, | ||
| ...rest | ||
| }: LevelSceneProps) { | ||
| const src = SCENE_BY_LEVEL[level]; | ||
| return ( | ||
| <div className={cn('relative w-full', className)} {...rest}> | ||
|
Member
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. 단순 궁금증으로 rest props로 들어오는 예시가 있을까요?? |
||
| <img | ||
| src={src} | ||
| alt={`지식나무 숲 Lv.${level}`} | ||
| className="h-auto w-full select-none rounded-[1.2rem] object-cover" | ||
| draggable={false} | ||
| /> | ||
| </div> | ||
| ); | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -180,7 +180,7 @@ | |||||||||||||||||||||||
| --color-gradient-end: #33d08f; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| /* Secondary Color */ | ||||||||||||||||||||||||
| --color-secondary: #f4f2ec; | ||||||||||||||||||||||||
| --color-subcolor: #f4f2ec; | ||||||||||||||||||||||||
|
Member
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. 👍 |
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| /* Grayscale */ | ||||||||||||||||||||||||
|
Comment on lines
182
to
185
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. 💡 Verification agent 🧩 Analysis chain토큰명 리네임은 합리적이나 Biome 파서 오류로 CI 차단 가능 Tailwind v4 권장 조치:
추가로, 점진적 마이그레이션을 위해 이전 토큰도 함께 노출해두면 레거시 클래스( /* Secondary Color */
- --color-subcolor: #f4f2ec;
+ --color-subcolor: #f4f2ec;
+ /* temporary alias for backward-compat */
+ --color-secondary: var(--color-subcolor);확인 스크립트: 🏁 Script executed: #!/bin/bash
# 1) 레거시 사용처 존재 여부
rg -nP 'bg-secondary|--color-secondary'
# 2) Biome가 해당 파일에서만 실패하는지 확인
pnpm biome check packages/tailwind-config/shared-styles.css || trueLength of output: 11255 Biome 파서 오류로 CI 실패 확인 – 단기 대응 필요
/* Secondary Color */
+ /* temporary alias for backward-compat */
+ --color-secondary: var(--color-subcolor);📝 Committable suggestion
Suggested change
🧰 Tools🪛 Biome (2.1.2)[error] 183-183: expected Remove --color-subcolor (parse) [error] 183-183: Unexpected value or character. Expected one of: (parse) [error] 183-183: expected Remove ; (parse) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||
| --color-gray0: #f7f7fb; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
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.
절대 경로 체크!