-
Notifications
You must be signed in to change notification settings - Fork 1
Feat(client): 온보딩 페이지 레이아웃 #56
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 9 commits
5bd7577
404ae5b
624cc17
9a70e01
63d6ffe
af80d54
eddface
e40be82
1969490
8cb98d6
99a5139
70d222e
dc94e2b
ab4b776
ffd5261
5c436c3
0b8eefb
5250c8d
3bb0c7f
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,16 @@ | ||
| import onBoardingBg from '../../assets/onBoarding/background/onBoardingBg.svg'; | ||
|
||
| import Header from './components/header/Header'; | ||
| import MainCard from './components/funnel/MainCard'; | ||
| const OnBoarding = () => { | ||
| return <div>OnBoarding</div>; | ||
| return ( | ||
| <div | ||
| className={`relative flex h-screen w-screen items-center justify-center bg-cover bg-center bg-no-repeat`} | ||
| style={{ backgroundImage: `url(${onBoardingBg})` }} | ||
| > | ||
| <Header /> | ||
| <MainCard /> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default OnBoarding; | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,51 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| import avatar1 from '../../../../assets/onBoarding/icons/chippi_morning.svg'; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| import avatar2 from '../../../../assets/onBoarding/icons/chippi_night.svg'; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| import avatar3 from '../../../../assets/onBoarding/icons/chippi_bell.svg'; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| import { cva } from 'class-variance-authority'; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| interface AlarmBoxProps { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| select: 1 | 2 | 3; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| isDisabled: boolean; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| onClick?: () => void; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| const AlarmsType = [ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| { img: avatar1, title: '아침형 치삐', time: '오전 9시' }, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| { img: avatar2, title: '저녁형 치삐', time: '오후 8시' }, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| { img: avatar3, title: '사용자 설정' }, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ]; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| const boxStyle = cva( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 'flex h-[22.4rem] w-[18rem] flex-col items-center rounded-[1.2rem] px-[3.9rem] pb-[2.6rem] pt-[3.6rem] cursor-pointer transition', | ||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| variants: { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| disabled: { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| true: 'border-main400 bg-main100 border', | ||||||||||||||||||||||||||||||||||||||||||||||||||
| false: 'bg-white border border-transparent hover:border-main300', | ||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| defaultVariants: { disabled: false }, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+11
to
+22
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 disabled 변형에서도 커서/클릭이 유지됨 베이스 클래스에 -const boxStyle = cva(
- 'flex h-[22.4rem] w-[18rem] flex-col items-center rounded-[1.2rem] px-[3.9rem] pb-[2.6rem] pt-[3.6rem] cursor-pointer transition',
+const boxStyle = cva(
+ 'flex h-[22.4rem] w-[18rem] flex-col items-center rounded-[1.2rem] px-[3.9rem] pb-[2.6rem] pt-[3.6rem] transition',
{
variants: {
disabled: {
- true: 'border-main400 bg-main100 border',
- false: 'bg-white border border-transparent hover:border-main300',
+ true: 'border-main400 bg-main100 border cursor-not-allowed pointer-events-none',
+ false: 'bg-white border border-transparent hover:border-main300 cursor-pointer',
},
},
defaultVariants: { disabled: false },
}
);📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| const AlarmBox = ({ select, isDisabled, onClick }: AlarmBoxProps) => { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| <div className={boxStyle({ disabled: isDisabled })} onClick={onClick}> | ||||||||||||||||||||||||||||||||||||||||||||||||||
| <img src={AlarmsType[select - 1].img} alt="chippi" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||
| <p | ||||||||||||||||||||||||||||||||||||||||||||||||||
| className={`sub3-sb ${ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| isDisabled ? 'text-main500' : 'text-font-black-1' | ||||||||||||||||||||||||||||||||||||||||||||||||||
| }`} | ||||||||||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||||||||||
| {AlarmsType[select - 1].title} | ||||||||||||||||||||||||||||||||||||||||||||||||||
| </p> | ||||||||||||||||||||||||||||||||||||||||||||||||||
| {select <= 2 && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| <p className="caption2-m text-font-gray-3"> | ||||||||||||||||||||||||||||||||||||||||||||||||||
| {AlarmsType[select - 1].time} | ||||||||||||||||||||||||||||||||||||||||||||||||||
| </p> | ||||||||||||||||||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+31
to
+76
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 클릭 가능한 div → button으로 전환하여 키보드/스크린리더 접근성 보장 현재 div+onClick은 키보드 포커스/Space/Enter 동작, 아래 diff 적용 제안: -const AlarmBox = ({ select, isDisabled, onClick }: AlarmBoxProps) => {
+const AlarmBox = ({ select, isDisabled, onClick }: AlarmBoxProps) => {
return (
- <div className={boxStyle({ disabled: isDisabled })} onClick={onClick}>
- <img src={AlarmsType[select - 1].img} alt="chippi" />
+ <button
+ type="button"
+ className={boxStyle({ disabled: isDisabled })}
+ onClick={onClick}
+ disabled={isDisabled}
+ >
+ <img src={AlarmsType[select - 1].img} alt={AlarmsType[select - 1].title} loading="lazy" />
<p
className={`sub3-sb ${
isDisabled ? 'text-main500' : 'text-font-black-1'
}`}
>
{AlarmsType[select - 1].title}
</p>
{select <= 2 && (
<p className="caption2-m text-font-gray-3">
{AlarmsType[select - 1].time}
</p>
)}
- </div>
+ </button>
);
}; |
||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| export default AlarmBox; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| import { useState } from 'react'; | ||
| import dotori from '../../../../assets/onBoarding/icons/dotori.svg'; | ||
| import AlarmBox from './AlarmBox'; | ||
|
|
||
| const AlarmStep = () => { | ||
| const [selected, setSelected] = useState<1 | 2 | 3>(1); // 기본값은 1번 선택 | ||
|
|
||
| return ( | ||
| <div className="flex flex-col items-center justify-between"> | ||
| <img src={dotori} className="mb-[1.2rem]" alt="dotori" /> | ||
| <p className="head2 text-font-black-1"> | ||
| 도토리 찾으러 갈 시간을 정해볼까요? | ||
| </p> | ||
| <p className="body2-m text-font-gray-3 mb-[4.3rem] mt-[0.8rem] text-center"> | ||
| 매일 지정한 시간에 저장한 북마크를 리마인드해드려요 | ||
| </p> | ||
|
|
||
| <div className="mb-[2rem] flex w-full items-center justify-center gap-[1.4rem]"> | ||
| {[1, 2, 3].map((n) => ( | ||
| <AlarmBox | ||
| key={n} | ||
| select={n as 1 | 2 | 3} | ||
| isDisabled={selected === n} | ||
| onClick={() => setSelected(n as 1 | 2 | 3)} | ||
| /> | ||
| ))} | ||
| </div> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default AlarmStep; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import dotori from '../../../../assets/onBoarding/icons/dotori.svg'; | ||
| const FinalStep = () => { | ||
| return ( | ||
| <div className="flex h-full flex-col items-center"> | ||
| <img src={dotori} className="mb-[1.2rem]" alt="dotori" /> | ||
| <p className="head2 text-font-black-1"> | ||
| 도토리 찾으러 갈 시간을 정해볼까요? | ||
| </p> | ||
| </div> | ||
| ); | ||
| }; | ||
| export default FinalStep; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import MacNotice from '../../../../assets/onBoarding/story/macNotice.svg'; | ||
| import dotori from '../../../../assets/onBoarding/icons/dotori.svg'; | ||
| const MacStep = () => { | ||
| return ( | ||
| <div className="flex h-full flex-col items-center"> | ||
| <img src={dotori} className="mb-[1.2rem]" alt="dotori" /> | ||
| <p className="head2 text-font-black-1"> | ||
| 도토리 찾으러 갈 시간을 정해볼까요? | ||
| </p> | ||
| <p className="body2-m text-font-gray-3 mb-[4.3rem] mt-[0.8rem] text-center"> | ||
| Mac 사용자는 추가 알림 설정을 진행해 주세요. | ||
| </p> | ||
| <img src={MacNotice} className="absolute -bottom-[104px]" alt="mac" /> | ||
| </div> | ||
| ); | ||
| }; | ||
| export default MacStep; |
|
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. 전체적으로 현재는 |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,111 @@ | ||||||||||||||||||||||||||||||||||||||||||
| import { Progress, Button } from '@pinback/design-system/ui'; | ||||||||||||||||||||||||||||||||||||||||||
| import { useState } from 'react'; | ||||||||||||||||||||||||||||||||||||||||||
| import { motion, AnimatePresence } from 'framer-motion'; | ||||||||||||||||||||||||||||||||||||||||||
| import StoryStep from './StoryStep'; | ||||||||||||||||||||||||||||||||||||||||||
| import AlarmStep from './AlarmStep'; | ||||||||||||||||||||||||||||||||||||||||||
| import MacStep from './MacStep'; | ||||||||||||||||||||||||||||||||||||||||||
| import FinalStep from './FinalStep'; | ||||||||||||||||||||||||||||||||||||||||||
| const stepProgress = [{ progress: 30 }, { progress: 60 }, { progress: 100 }]; | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| const variants = { | ||||||||||||||||||||||||||||||||||||||||||
|
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.
Member
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. slideIn~Out 느낌으로 네이밍 구체화 했습니당 |
||||||||||||||||||||||||||||||||||||||||||
| enter: (direction: number) => ({ | ||||||||||||||||||||||||||||||||||||||||||
| x: direction > 0 ? 200 : -200, | ||||||||||||||||||||||||||||||||||||||||||
| opacity: 0, | ||||||||||||||||||||||||||||||||||||||||||
| }), | ||||||||||||||||||||||||||||||||||||||||||
| center: { x: 0, opacity: 1 }, | ||||||||||||||||||||||||||||||||||||||||||
| exit: (direction: number) => ({ | ||||||||||||||||||||||||||||||||||||||||||
| x: direction > 0 ? -200 : 200, | ||||||||||||||||||||||||||||||||||||||||||
| opacity: 0, | ||||||||||||||||||||||||||||||||||||||||||
| }), | ||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| const MainCard = () => { | ||||||||||||||||||||||||||||||||||||||||||
| const [step, setStep] = useState(0); | ||||||||||||||||||||||||||||||||||||||||||
|
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. 제 개인적인 생각으로는 예를 들어 <Button
variant="primary"
size="medium"
isDisabled={step === 6}
className="ml-auto w-[4.8rem]"
onClick={nextStep}
>이런 코드도 재림님은 이 부분에 대해서 어떻게 생각하시나요!
Member
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. 안그래도 구현할때, step 몇이 어떤단계인지 저도 헷갈렸었는데,, 너무 좋은 방향인 것 같아요!! |
||||||||||||||||||||||||||||||||||||||||||
| const [direction, setDirection] = useState(0); | ||||||||||||||||||||||||||||||||||||||||||
| const renderStep = () => { | ||||||||||||||||||||||||||||||||||||||||||
| switch (step) { | ||||||||||||||||||||||||||||||||||||||||||
| case 0: | ||||||||||||||||||||||||||||||||||||||||||
| case 1: | ||||||||||||||||||||||||||||||||||||||||||
| case 2: | ||||||||||||||||||||||||||||||||||||||||||
| return <StoryStep step={step as 0 | 1 | 2} />; | ||||||||||||||||||||||||||||||||||||||||||
|
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.
Member
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. 혹시 스텝꼬일까봐 |
||||||||||||||||||||||||||||||||||||||||||
| case 3: | ||||||||||||||||||||||||||||||||||||||||||
| return <AlarmStep />; | ||||||||||||||||||||||||||||||||||||||||||
| case 4: | ||||||||||||||||||||||||||||||||||||||||||
| return <MacStep />; | ||||||||||||||||||||||||||||||||||||||||||
| case 5: | ||||||||||||||||||||||||||||||||||||||||||
| return <FinalStep />; | ||||||||||||||||||||||||||||||||||||||||||
| default: | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+56
to
+60
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. 비-Apple(Windows 등) 환경에서 step 5가 공백으로 렌더되고, ‘다음’을 두 번 눌러야 홈으로 이동하는 버그 step 5가 @@
- case 5:
- if (isMac) return <FinalStep />;
- return null;
+ case 5:
+ return <FinalStep />;
@@
- const nextStep = () => {
+ const nextStep = () => {
if (step === 3) {
// 이거 이후에 api 붙일 자리 표시임! console.log('선택된 알람:', AlarmsType[alarmSelected - 1].time);
}
- if (step < 5) {
- setDirection(1);
- setStep((prev) => prev + 1);
- } else if (step === 5) {
- window.location.href = '/';
- }
+ const shouldRedirect = (!isMac && step === 4) || (isMac && step === 5);
+ if (shouldRedirect) {
+ window.location.href = '/';
+ return;
+ }
+ setDirection(1);
+ setStep((prev) => prev + 1);
};Also applies to: 65-75 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||
| return <FinalStep />; | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+57
to
+62
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. 이렇게 될 때
Member
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. 헉 이부분 클날뻔했네요!! 분기를 꼬이게 잘못 설계한 것 같아서 수정했습니다! 감사합니다~~! |
||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||
| const nextStep = () => { | ||||||||||||||||||||||||||||||||||||||||||
| if (step < 5) { | ||||||||||||||||||||||||||||||||||||||||||
| setDirection(1); | ||||||||||||||||||||||||||||||||||||||||||
| setStep((prev) => prev + 1); | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
| if (step === 5) { | ||||||||||||||||||||||||||||||||||||||||||
| window.location.href = '/'; | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| const prevStep = () => { | ||||||||||||||||||||||||||||||||||||||||||
| if (step > 0) { | ||||||||||||||||||||||||||||||||||||||||||
| setDirection(-1); | ||||||||||||||||||||||||||||||||||||||||||
| setStep((prev) => prev - 1); | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+65
to
+82
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. step string 관련 의논을 해보고 필요하다면 로직 관련은 커스텀 훅으로 분리하는 것도 좋을 것 같아요! |
||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||||||||||||||||
| <div className="bg-white-bg flex h-[54.8rem] w-[63.2rem] flex-col items-center justify-between overflow-hidden rounded-[2.4rem] pt-[3.2rem]"> | ||||||||||||||||||||||||||||||||||||||||||
| {step < 3 && ( | ||||||||||||||||||||||||||||||||||||||||||
| <Progress | ||||||||||||||||||||||||||||||||||||||||||
| value={stepProgress[step].progress} | ||||||||||||||||||||||||||||||||||||||||||
| variant="profile" | ||||||||||||||||||||||||||||||||||||||||||
| className="w-[30%]" | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+86
to
+92
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. 해당 progress bar는
Member
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. 아 해당 mainCard 는 패딩 레이아웃 다 통일해둔 흰박스레이아웃 안에 안에 내용물만 슬라이딩 하면서 바뀌게 되는데요!
다음처럼 설계했었습니다! 좋은 의견 있다면 말씀주세요! |
||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| <div className="relative flex h-full w-full items-center justify-center"> | ||||||||||||||||||||||||||||||||||||||||||
| <AnimatePresence custom={direction} mode="wait"> | ||||||||||||||||||||||||||||||||||||||||||
| <motion.div | ||||||||||||||||||||||||||||||||||||||||||
| key={step} | ||||||||||||||||||||||||||||||||||||||||||
| custom={direction} | ||||||||||||||||||||||||||||||||||||||||||
| variants={variants} | ||||||||||||||||||||||||||||||||||||||||||
| initial="enter" | ||||||||||||||||||||||||||||||||||||||||||
| animate="center" | ||||||||||||||||||||||||||||||||||||||||||
| exit="exit" | ||||||||||||||||||||||||||||||||||||||||||
| transition={{ duration: 0.4 }} | ||||||||||||||||||||||||||||||||||||||||||
| className="flex h-full flex-col items-center" | ||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||
| {renderStep()} | ||||||||||||||||||||||||||||||||||||||||||
| </motion.div> | ||||||||||||||||||||||||||||||||||||||||||
| </AnimatePresence> | ||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| <div className="mb-[4.8rem] mt-[1.2rem] flex w-full justify-between px-[3.2rem]"> | ||||||||||||||||||||||||||||||||||||||||||
| {step < 4 && ( | ||||||||||||||||||||||||||||||||||||||||||
| <Button | ||||||||||||||||||||||||||||||||||||||||||
| variant="primary" | ||||||||||||||||||||||||||||||||||||||||||
| size="medium" | ||||||||||||||||||||||||||||||||||||||||||
| isDisabled={step === 0} | ||||||||||||||||||||||||||||||||||||||||||
| className="w-[4.8rem]" | ||||||||||||||||||||||||||||||||||||||||||
| onClick={prevStep} | ||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||
| 이전 | ||||||||||||||||||||||||||||||||||||||||||
| </Button> | ||||||||||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||||||||||
| <Button | ||||||||||||||||||||||||||||||||||||||||||
| variant="primary" | ||||||||||||||||||||||||||||||||||||||||||
| size="medium" | ||||||||||||||||||||||||||||||||||||||||||
| isDisabled={step === 6} | ||||||||||||||||||||||||||||||||||||||||||
| className="ml-auto w-[4.8rem]" | ||||||||||||||||||||||||||||||||||||||||||
| onClick={nextStep} | ||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||
| 다음 | ||||||||||||||||||||||||||||||||||||||||||
| </Button> | ||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+123
to
+132
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 다음 버튼 비활성화 조건 버그(step === 6) 수정 step은 0–5 범위로 운용되므로 현재 조건은 영원히 false입니다. 의미 없는 prop 전달이므로 제거하거나 전환 중(isAnimating) 비활성화로 교체하세요. 전환 중 비활성화로 교체 예: - isDisabled={step === 6}
+ isDisabled={isAnimating}단순 제거 예: - isDisabled={step === 6}
+ // isDisabled 제거📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
Collaborator
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. 이부분 한번 확인해주세요-! 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. @jjangminii 네, 확인했습니다! CodeRabbit이 지적한 버그가 맞습니다. 문제점:
수정 방안:
<Button
variant="primary"
size="medium"
className="ml-auto w-[4.8rem]"
onClick={nextStep}
>
다음
</Button>
// 상태 추가
const [isAnimating, setIsAnimating] = useState(false);
// 애니메이션 처리
const nextStep = () => {
setIsAnimating(true);
// ... 기존 로직
setTimeout(() => setIsAnimating(false), 400); // 애니메이션 duration과 맞춤
};
// 버튼에서 사용
<Button
variant="primary"
size="medium"
isDisabled={isAnimating}
className="ml-auto w-[4.8rem]"
onClick={nextStep}
>
다음
</Button>어떤 방향으로 수정하실 건가요? |
||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| export default MainCard; | ||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| import story1 from '../../../../assets/onBoarding/story/story1.svg'; | ||
| import story2 from '../../../../assets/onBoarding/story/story2.svg'; | ||
| import story3 from '../../../../assets/onBoarding/story/story3.svg'; | ||
| interface StoryStepProps { | ||
| step: 0 | 1 | 2; | ||
| } | ||
| const steps = [ | ||
| { | ||
| img: story1, | ||
| text: ( | ||
| <> | ||
| 깊고 신비한 숲에는 지식 나무가 있어요. <br /> | ||
| 지식 나무는 사람들의 잊힌 기록을 도토리 씨앗으로 바꾼답니다. | ||
| </> | ||
| ), | ||
| progress: 30, | ||
| }, | ||
| { | ||
| img: story2, | ||
| text: ( | ||
| <> | ||
| 당신이 정보를 읽고 활용하는 것을 양분삼아, <br /> | ||
| 지식 나무에는 맛있는 도토리 열매가 열려요. | ||
| </> | ||
| ), | ||
| progress: 60, | ||
| }, | ||
| { | ||
| img: story3, | ||
| text: ( | ||
| <> | ||
| 다람쥐 치삐는 정보를 활용하지 못해 아직 도토리 만개 숲에 도착하지 못하고 | ||
| 있어요. | ||
| <br /> | ||
| 도토리를 모아 치삐가 숲에 닿을 수 있도록 도와주세요! | ||
| </> | ||
| ), | ||
| progress: 100, | ||
| }, | ||
| ]; | ||
|
|
||
| const StoryStep = ({ step }: StoryStepProps) => { | ||
| return ( | ||
| <div className="flex flex-col items-center"> | ||
| <img | ||
| src={steps[step].img} | ||
| className="mb-[1.6rem] mt-[2.4rem] w-[31.2rem]" | ||
| alt="onboarding" | ||
| /> | ||
| <p className="sub4-sb text-center text-black">{steps[step].text}</p> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default StoryStep; |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,13 @@ | ||||||||||||||||||||||||||||||
| import HeaderLogo from '../../../../assets/onBoarding/icons/header_logo.svg'; | ||||||||||||||||||||||||||||||
| const Header = () => { | ||||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||||
| <div | ||||||||||||||||||||||||||||||
| className="z-5 absolute top-0 flex w-full justify-items-start px-[8rem] py-[2.5rem]" | ||||||||||||||||||||||||||||||
| onClick={() => window.location.reload()} | ||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||
| <img src={HeaderLogo} alt="header logo" /> | ||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
| <div | |
| className="z-5 absolute top-0 flex w-full justify-items-start px-[8rem] py-[2.5rem]" | |
| onClick={() => window.location.reload()} | |
| > | |
| <img src={HeaderLogo} alt="header logo" /> | |
| </div> | |
| <button | |
| type="button" | |
| aria-label="홈으로 이동" | |
| className="z-[5] absolute top-0 flex w-full justify-start px-[8rem] py-[2.5rem]" | |
| onClick={() => window.location.reload()} | |
| > | |
| <img src={HeaderLogo} alt="header logo" /> | |
| </button> |
🤖 Prompt for AI Agents
In apps/client/src/pages/onBoarding/components/header/Header.tsx around lines
4-9, replace the clickable div with a semantic <button type="button"> to restore
keyboard activation and add an aria-label (e.g., "Reload page"); preserve the
onClick handler (window.location.reload()). Update the Tailwind classes: change
justify-items-start to justify-start and z-5 to z-[5], and ensure button styles
don't introduce unwanted defaults (use inline-flex/px/py and
transparent/background-none/border-none as needed) so the layout and image
remain unchanged while improving accessibility.
Outdated
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.
헤더라면 의미(semantic)를 생각하면 header 태그를 쓰는 것이 더 좋을 것 같아요!
그리고 header 전체는 w-full 영역을 잡으니 onClick은 logo image에 달아 주는 것이 맞을 것 같아요!
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,7 +4,7 @@ export { default as Card } from './card/Card'; | |||||||
| export { default as Chip } from './chip/Chip'; | ||||||||
| export { default as Input } from './input/Input'; | ||||||||
| export { default as Level } from './level/Level'; | ||||||||
| export { Progress } from './progress/Progress'; | ||||||||
| export { default as Progress } from './progress/Progress'; | ||||||||
|
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 chainProgressProps 타입 재노출 누락으로 인한 잠재적 BP 이전 소비자가 export { default as Progress } from './progress/Progress';
+export type { ProgressProps } from './progress/Progress';🏁 Script executed: #!/bin/bash
# 레포 전역에서 ProgressProps 직접 임포트 사용 여부 확인
rg -nP '\bProgressProps\b' -SLength of output: 264 🏁 Script executed: #!/bin/bash
rg -n "export type" -C2 packages/design-system/src/components/index.ts || trueLength of output: 276 ProgressProps 타입 재노출 추가 export { default as Progress } from './progress/Progress';
+export type { ProgressProps } from './progress/Progress';📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||
| export { Switch } from './switch/Switch'; | ||||||||
| export { Textarea } from './textarea/Textarea'; | ||||||||
| export { default as AutoDismissToast } from './toast/hooks/uesFadeOut'; | ||||||||
|
|
||||||||

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.
로고는 사이드바에서도 사용하고 익스텐션에서등 다양한 위치에서 사용된다고 생각하는데 디자인 시스템에 추가하는 것은 어떤가요?
괜찮으시다면 추후 제 사이드바 pr에서 로고 디자인 시스템 위치에 아이콘 적용해뒀는데 가져다 사용해도 좋을것같아요-!