Skip to content

feat: post 공통 레이아웃 설정#45

Merged
jw0202058 merged 10 commits into
devfrom
feat/#37/post-layout
Jul 4, 2025
Merged

feat: post 공통 레이아웃 설정#45
jw0202058 merged 10 commits into
devfrom
feat/#37/post-layout

Conversation

@jw0202058

@jw0202058 jw0202058 commented Jul 3, 2025

Copy link
Copy Markdown
Collaborator

❗ 연관 이슈

📌 내용

image

안의 내용은 비워두고 헤더랑 네비게이터를 구현햇습니다
마지막에 완료 버튼 누르면 어떻게 넘어갈지 아직 몰라서 작성 완료 로그가 뜨게만 ㅐㅎ뒀어요

☑️ 체크 사항 & 논의 사항

  • 피그마랑 다른 거 없는지
  • 디렉터리 구조 한번 확인해주세요,,,
  • path 라우팅 안 해도 되는 거 맞죠?

@jw0202058

Copy link
Copy Markdown
Collaborator Author

pick 만들기에서도 비슷한 레이아웃 써서 WriteLayout 컴포넌트를 common으로 빼야 할 것 같기도

@halionaz halionaz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

좋은데요?
근데 다쓰고 보니 잔소리 엄청 적어놨네ㅋㅋㅋ

로직적으로 막 크게 고칠건 없어보이고 짜잘한 사항들 제 생각 끄적여봤습니다
천천히 읽어보면서 이야기해보시쥬

아 그리고 린트 깨지는거는 좀 문제임
yarn lint하고 yarn lint --fix 해서 해결하거나
Prettier를 고쳐서 나중에 발생할 문제를 미연에 방지해보아요

https://velog.io/@yjw0517/TIL2023.06.27-prettier-%EC%A0%81%EC%9A%A9-%EC%95%88%EB%90%98%EB%8A%94-%ED%98%84%EC%83%81

이 벨로그가 도움이 좀 되지 않을까 싶네요

Comment thread src/common/components/WriteLayout/index.tsx Outdated
Comment thread src/common/components/WriteLayout/navigator.tsx Outdated
Comment thread src/common/components/WriteLayout/navigator.tsx Outdated
Comment thread src/pages/PostPages/index.tsx Outdated
Comment thread src/common/components/WriteLayout/style.css.ts Outdated
Comment thread src/common/components/WriteLayout/style.css.ts Outdated
Comment thread src/common/components/WriteLayout/style.css.ts Outdated
Comment thread src/common/components/WriteLayout/style.css.ts Outdated
@halionaz halionaz requested a review from Copilot July 3, 2025 12:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 PostPage route with PostPageRoutes and removes deprecated src/pages/PostPage/* files
  • Adds six step pages (Step1Step6) under src/pages/PostPages/stepPages/ with inline centering styles
  • Implements WriteLayout (header, navigator, safe area) and associated styling in src/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 navigator may be confused with the global window.navigator. Consider renaming it to navigate to 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;

Copilot AI Jul 3, 2025

Copy link

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

내가 먼저 말함 ㅅㄱ

Comment thread src/pages/PostPages/stepPages/step1.tsx Outdated
@@ -0,0 +1,18 @@
const Step1 = () => {
return (
<div

Copilot AI Jul 3, 2025

Copy link

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
@halionaz

halionaz commented Jul 3, 2025

Copy link
Copy Markdown
Member

아아 디렉토리 이제 봤네
Pick도 퍼널이 비슷하긴 한데 Step들이 다 다를거 같아서
WriteLayoutfeatures/posts?작명은맘대로하로 빼도 될듯함

그리고 stepPages 폴더 안에 있는 Step들도 각각이 path 라우트가 되는게 아니라 지나가는 State Page니까
WriteLayout이랑 가까운 features 폴더에서 관리하는게 좋을듯??
더 좋은 아이디어가 있다면 언제든 환ㅇ영이에요

@jw0202058

Copy link
Copy Markdown
Collaborator Author

아 바로 위에 거에는 왜 코멘트가 안 달림?
근데 지금 공통 레이아웃으로 만들어둔 게 헤더랑 네비게이터 버튼뿐이라 재활용할 수 있지 않을까여?? 아님 말고요...
@halionaz

@halionaz

halionaz commented Jul 3, 2025

Copy link
Copy Markdown
Member

@jw0202058
common으로 하려면 renderStep() 으로 스텝 컴포넌트 넣어주는걸 부모단에서 할 수 있도록 바꿔줘야 할듯?
근데 피그마 다시 보니까 Pick쪽은 퍼널이 아닌데?
순차적으로 진행되는게 아니라 하나하나가 확인창 / 수정창 / 수락창이라 따로 구현하는게 편할거 같긴 해요

@jw0202058

Copy link
Copy Markdown
Collaborator Author

아 그러네 으ㅏㄹ겠습니당

@halionaz halionaz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

height: 100% 이상하게 적용되는 이유 찾음

이거 제 브랜치에서 수정하긴 했는데 SafeArea/style.css.ts 파일의 Container를

export const Container = css({
  position: 'absolute',
  bottom: 0,
});

이렇게 수정해야 됩니다... 제 코드 문제였ㅅ음

Comment thread src/pages/PostPages/WriteLayout/index.tsx Outdated
@jw0202058 jw0202058 requested a review from halionaz July 4, 2025 05:07

@halionaz halionaz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🚀 어뿌루부

Comment on lines +27 to +47
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>
);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

아주좋군요 😎

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

오우예

@jw0202058 jw0202058 merged commit d140ea9 into dev Jul 4, 2025
@jw0202058 jw0202058 deleted the feat/#37/post-layout branch July 4, 2025 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants