feat: post 공통 레이아웃 설정#45
Conversation
|
pick 만들기에서도 비슷한 레이아웃 써서 WriteLayout 컴포넌트를 common으로 빼야 할 것 같기도 |
halionaz
left a comment
There was a problem hiding this comment.
좋은데요?
근데 다쓰고 보니 잔소리 엄청 적어놨네ㅋㅋㅋ
로직적으로 막 크게 고칠건 없어보이고 짜잘한 사항들 제 생각 끄적여봤습니다
천천히 읽어보면서 이야기해보시쥬
아 그리고 린트 깨지는거는 좀 문제임
yarn lint하고 yarn lint --fix 해서 해결하거나
Prettier를 고쳐서 나중에 발생할 문제를 미연에 방지해보아요
이 벨로그가 도움이 좀 되지 않을까 싶네요
There was a problem hiding this comment.
Pull Request Overview
This PR sets up a multi-step post writing layout by replacing the old PostPage with a new PostPages route and introducing a WriteLayout component that wraps individual step pages.
- Replaces
PostPageroute withPostPageRoutesand removes deprecatedsrc/pages/PostPage/*files - Adds six step pages (
Step1–Step6) undersrc/pages/PostPages/stepPages/with inline centering styles - Implements
WriteLayout(header, navigator, safe area) and associated styling insrc/common/components/WriteLayout/
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/pages/routes.tsx | Updated /post route to use PostPageRoutes |
| src/pages/PostPages/stepPages/step1.tsx | Added centered placeholder for step 1 |
| src/pages/PostPages/stepPages/step2.tsx | Added centered placeholder for step 2 |
| src/pages/PostPages/stepPages/step3.tsx | Added centered placeholder for step 3 |
| src/pages/PostPages/stepPages/step4.tsx | Added centered placeholder for step 4 |
| src/pages/PostPages/stepPages/step5.tsx | Added centered placeholder for step 5 |
| src/pages/PostPages/stepPages/step6.tsx | Added centered placeholder for step 6 |
| src/pages/PostPages/index.tsx | Introduced PostPage that uses WriteLayout |
| src/common/components/WriteLayout/* | Added WriteLayout, Header, Navigator + CSS |
Comments suppressed due to low confidence (1)
src/common/components/WriteLayout/header.tsx:5
- The variable name
navigatormay be confused with the globalwindow.navigator. Consider renaming it tonavigateto clearly reflect it's a navigation function.
const navigator = useNavigate();
| import Btn from '@/common/components/Button'; | ||
| import * as s from './style.css'; | ||
|
|
||
| const MAX_STEP = 6; |
There was a problem hiding this comment.
Hardcoding MAX_STEP increases the risk of mismatches if steps are added or removed. Consider deriving this value from the length of the stepPages array or a config constant.
| @@ -0,0 +1,18 @@ | |||
| const Step1 = () => { | |||
| return ( | |||
| <div | |||
There was a problem hiding this comment.
All step pages duplicate the same inline centering styles. Extract these into a shared styled component or CSS class to reduce duplication and simplify future updates.
|
아아 디렉토리 이제 봤네 그리고 |
|
아 바로 위에 거에는 왜 코멘트가 안 달림? |
|
@jw0202058 |
|
아 그러네 으ㅏㄹ겠습니당 |
| const [step, setStep] = useState(1); | ||
|
|
||
| const isFirst = step === 1; | ||
| const isLast = step === MAX_STEP; | ||
|
|
||
| const goPrev = () => { | ||
| setStep((prev) => Math.max(1, prev - 1)); // 이전 상태 고려 (prev), 최소 1 | ||
| } | ||
|
|
||
| const goNext = () => { | ||
| if (step < MAX_STEP) setStep(step + 1); | ||
| else console.log('작성 완료'); | ||
| }; | ||
|
|
||
| return ( | ||
| <div className={s.entireLayout}> | ||
| <Header /> | ||
| <div className={s.innerPage}>{steps[step - 1]}</div> | ||
| <Navigator goNext={goNext} goPrev={goPrev} isFirst={isFirst} isLast={isLast} /> | ||
| </div> | ||
| ); |
❗ 연관 이슈
📌 내용
안의 내용은 비워두고 헤더랑 네비게이터를 구현햇습니다
마지막에 완료 버튼 누르면 어떻게 넘어갈지 아직 몰라서 작성 완료 로그가 뜨게만 ㅐㅎ뒀어요
☑️ 체크 사항 & 논의 사항