Skip to content
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

게시글 상세 기능 및 공용 레이아웃 수정 #44

Merged
merged 7 commits into from
Mar 31, 2025

Conversation

rmkim7
Copy link
Contributor

@rmkim7 rmkim7 commented Mar 30, 2025

관련 이슈 번호

#40

핵심 변경 사항 및 이유

  • 게시글 상세(PostDetail)를 서버 컴포넌트로 변경, 데이터 패칭 방식 변경
  • PostViewModel 인터페이스 추가, PostDetail에 ViewModel 적용
  • 게시글 목록으로 이동 및 수정 버튼을 추가

이외 기타 변경 사항

  • 게시글 상세 페이지(PostDetail.tsx) 서버 컴포넌트로 전환 및 ViewModel 적용

    • 기존 useStateuseEffect를 제거하고, async/await를 활용하여 서버에서 직접 데이터 패칭
    • useParams()로 ID를 가져오던 방식 → params를 직접 props로 전달하는 방식으로 변경
    • formatToLocaleDate가 더 이상 PostDetail 컴포넌트에서 호출되지 않고, mapPostToViewModel을 통해 한 단계 추상화된 구조로 변경
  • 게시글 상세 페이지(page.tsx) UI 개선

    • "목록으로 이동", "수정" 버튼 추가 (Button 컴포넌트 사용)
    • Tailwind CSS 적용 (mx-8 flex gap-2 등)
  • 홈페이지(page.tsx) 버튼 및 레이아웃 개선

    • "새 글 작성" 버튼의 스타일 (mx-8) 추가
    • <PostInfiniteScroll>을 감싸는 div 추가
  • 공용 레이아웃 스타일 조정 (layout.tsx)

    • <main>max-w-4xl p-6 추가하여 중앙 정렬 및 가독성 개선
    • lang="en"lang="ko"로 변경
  • 페이지 및 게시글 컴포넌트 UI 스타일 수정

    • 페이지 UI 수정 (app/page.tsx app/posts/[id]/page.tsx)
    • 게시글 컴포넌트 UI 수정 (post-detail.tsx post-form.tsx)
  • 불필요한 태그 및 속성 정리

    • layout.tsx 변경으로 인한 main 태그 제거 (app/posts/edit/[id]/page.tsx app/posts/write/page.tsx)
    • key 속성 제거 (post-detail.tsx)

PR 시 참고 사항

  • UI 작업은 기능이 합쳐진 후, 논의를 통해 작업할 예정입니다.

@rmkim7 rmkim7 added type: feature 새로운 기능 & 기능적 개선 status: in-progress 현재 처리 중 labels Mar 30, 2025
@rmkim7 rmkim7 requested a review from a team March 30, 2025 10:15
@rmkim7 rmkim7 self-assigned this Mar 30, 2025
Copy link
Contributor

@Seono-Na Seono-Na left a comment

Choose a reason for hiding this comment

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

오 UI도 전반적으로 깔끔해졌네요!

해당 PR은 머지 해놓겠습니다

작업하느라 고생하셨습니다😀

@Seono-Na Seono-Na merged commit d8756dd into feature-group/post Mar 31, 2025
@github-actions github-actions bot added status: done 완료 and removed status: in-progress 현재 처리 중 labels Mar 31, 2025
@rmkim7 rmkim7 deleted the feature/post-detail branch March 31, 2025 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: done 완료 type: feature 새로운 기능 & 기능적 개선
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants