Repository navigation
feat: 홈 화면 개선 — DB 닉네임 인사말, 통계 API, 새 사건 버튼 연결 #68
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
Merged
Merged
Changes from 32 commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
6eb7ed6
feat: 홈 화면 기본 구조 생성 (헤더, 일기 박스)
wjdalss21 f98f8f3
feat: Header variant 분리 (logo/title) 및 홈 화면 적용
wjdalss21 d959392
feat: 사건기록 페이지 생성 및 로고 헤더 적용 (/records)
wjdalss21 5a6643e
fix: diaryBox 고정 폭을 max-width + width 100%로 반응형 처리
wjdalss21 a04b781
feat: 감정일기 작성 버튼 /diary/new 네비게이션 연결
wjdalss21 6ab4d7e
feat: 홈 화면 캐릭터 이미지 교체 및 위치 조정
wjdalss21 24aed23
fix: 홈 화면 코드래빗 피드백 반영
wjdalss21 f67c9e9
refactor: 홈 화면 typography 믹신 적용
wjdalss21 2b194f9
fix: 비로그인 알아보기 박스 위치 수정
wjdalss21 e5188f7
feat: 홈 화면에 통계 섹션 및 구분선 통합
wjdalss21 f2154c6
chore: 개발 편의용 로그인 상태 강제 설정 (배포 전 제거 필요)
wjdalss21 47e7138
feat: 홈 화면 진행중인 사건 섹션 UI 구현
wjdalss21 a31fe0e
fix: dev 머지 충돌 해결 (ActiveCasesSection 유지)
wjdalss21 f02cec2
fix: 진행중인 사건 카드 수정 - CaseCard 원본 구조 유지, 좌측 컬러바 제거, Avatar 좌측 배치
wjdalss21 e92b35f
fix: CaseCard preview 텍스트 컬러 black-700으로 수정
wjdalss21 804f450
fix: 진행중인 사건 섹션 내 진행중 뱃지 제거
wjdalss21 fd1b1f3
fix: 진행중인 사건 카드 푸터 레이아웃 및 외곽선 black-700 2px inset 적용
wjdalss21 8561f05
fix: 진행중인 사건 카드 preview-footer 간격 8px 조정
wjdalss21 cca1afc
Merge remote-tracking branch 'origin/dev' into feature/homepage-jm
wjdalss21 2afe223
fix: 코드래빗 리뷰 반영 - 린트, loading/error 상태 처리, onClick li로 이동
wjdalss21 cff2117
Merge remote-tracking branch 'origin/dev' into feature/homepage-jm
wjdalss21 28c7139
chore: 홈 화면 캐릭터 이미지 추가
wjdalss21 200262e
refactor: 홈 페이지를 /home에서 / 루트 경로로 이동
wjdalss21 692170e
Merge remote-tracking branch 'origin/dev' into feature/homepage-jm
wjdalss21 80b320a
Merge remote-tracking branch 'origin/dev' into feature/homepage-jm
wjdalss21 c5eed1d
Merge remote-tracking branch 'origin/dev' into feature/homepage-jm
wjdalss21 b6f81f0
Merge remote-tracking branch 'origin/dev' into feature/homepage-jm
wjdalss21 7937e2c
feat: 홈 화면 새 사건 버튼 및 서비스 정보 푸터 구현
wjdalss21 12871f4
feat: 새 사건 버튼 카테고리 선택 모달 구현
wjdalss21 9408df5
fix: CodeRabbit 리뷰 반영 — isLoggedIn 하드코딩 제거, 서비스 링크 경로 교체, SCSS 빈 줄 정리
wjdalss21 d10f250
Merge remote-tracking branch 'origin/dev' into feature/homepage-jm
wjdalss21 889d131
feat: HomeGreeting 컴포넌트 추가 및 DB 닉네임 기반 인사말 적용
wjdalss21 6aa97cf
fix: 통계 카테고리 API 불필요한 인증 체크 제거
wjdalss21 f63d464
feat: 통계 데이터 없을 때 목 데이터 fallback 추가 (UI 확인용)
wjdalss21 ed7b7df
chore: 진행중인 사건 목 데이터 제거
wjdalss21 55e3268
feat: 새 사건 버튼 카테고리 클릭 시 진술 작성 페이지로 이동
wjdalss21 cd5dfc5
fix: 서비스 소개·고객문의 링크 미연결 항목 span으로 교체
wjdalss21 83440e7
style: NewCaseButton SCSS declaration-empty-line-before 위반 수정
wjdalss21 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| 'use client' | ||
|
|
||
| import { useUserMe } from '@/domains/user/hooks' | ||
| import styles from '@/app/page.module.scss' | ||
|
|
||
| export default function HomeGreeting() { | ||
| const { data: user } = useUserMe() | ||
|
|
||
| const greeting = user?.nickname ? `${user.nickname}님` : '안녕하세요' | ||
|
|
||
| return ( | ||
| <section className={styles.greeting}> | ||
| <p className={styles.userName}>{greeting}</p> | ||
| <p className={styles.greetingText}>오늘 감정은 어떠신가요?</p> | ||
| </section> | ||
| ) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| @use '@/styles/abstracts/variables' as v; | ||
| @use '@/styles/abstracts/mixins' as m; | ||
| @use '@/styles/abstracts/functions' as fn; | ||
|
|
||
| .box { | ||
| display: flex; | ||
| flex-direction: column; | ||
| align-items: center; | ||
| width: 100%; | ||
| background-color: var(--text-primary); | ||
| border-radius: 0; | ||
| padding: fn.r(20) fn.r(16) fn.r(20); | ||
| box-sizing: border-box; | ||
| } | ||
|
|
||
| .logo { | ||
| display: block; | ||
| width: fn.r(66); | ||
| height: fn.r(19); | ||
| object-fit: contain; | ||
| } | ||
|
|
||
| .links { | ||
| display: flex; | ||
| align-items: center; | ||
| gap: fn.r(10); | ||
| margin-top: fn.r(10); | ||
| } | ||
|
|
||
| .link { | ||
| @include m.text-caption; | ||
|
|
||
| color: v.$color-black-200; | ||
| text-decoration: none; | ||
| white-space: nowrap; | ||
| } | ||
|
|
||
| .copyright { | ||
| @include m.text-caption; | ||
|
|
||
| color: v.$color-black-400; | ||
| margin-top: fn.r(10); | ||
| text-align: center; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| import Image from 'next/image' | ||
| import styles from './HomeServiceInfo.module.scss' | ||
|
|
||
| const LINKS = [ | ||
| { label: '서비스 소개', href: '#' }, | ||
| { label: '개인정보 처리방침', href: '/privacy' }, | ||
| { label: '이용약관', href: '/terms' }, | ||
| { label: '고객문의', href: '#' }, | ||
| ] | ||
|
|
||
| export default function HomeServiceInfo() { | ||
| return ( | ||
| <div className={styles.box}> | ||
| <Image | ||
| src="/images/common/logo.png" | ||
| alt="말해부엉" | ||
| width={66} | ||
| height={19} | ||
| className={styles.logo} | ||
| /> | ||
| <nav className={styles.links} aria-label="서비스 정보"> | ||
| {LINKS.map(({ label, href }) => ( | ||
| <a key={label} href={href} className={styles.link}> | ||
| {label} | ||
| </a> | ||
| ))} | ||
| </nav> | ||
| <p className={styles.copyright}>Copyright ⓒ 말해부엉. ALL Rights Reserved.</p> | ||
| </div> | ||
| ) | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| @use '@/styles/abstracts/variables' as v; | ||
| @use '@/styles/abstracts/mixins' as m; | ||
| @use '@/styles/abstracts/functions' as fn; | ||
|
|
||
| // ─── 새 사건 + 버튼 ───────────────────────────────────────── | ||
| .button { | ||
| position: fixed; | ||
| bottom: fn.r(81); | ||
| right: max(fn.r(16), calc((100vw - #{v.$container-max-width}) / 2 + #{fn.r(16)})); | ||
|
|
||
| display: flex; | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| align-items: center; | ||
| justify-content: center; | ||
| width: fn.r(115); | ||
| height: fn.r(48); | ||
|
|
||
| background-color: v.$color-black-700; | ||
| border: none; | ||
| border-radius: fn.r(100); | ||
| cursor: pointer; | ||
| z-index: 101; | ||
|
|
||
| @include m.text-title-s; | ||
|
|
||
| color: #ffffff; | ||
| white-space: nowrap; | ||
| } | ||
|
|
||
| // ─── 카테고리 선택 모달 ────────────────────────────────────── | ||
| .overlay { | ||
| position: fixed; | ||
| inset: 0; | ||
|
|
||
| // 페이지 배경을 불투명 베이스로 깔아 콘텐츠가 비치지 않게 하고, | ||
| // 그 위에 color-black-700 40% 틴트를 적용 | ||
| background-color: var(--bg-page); | ||
| background-image: linear-gradient(rgba(26, 29, 31, 0.4), rgba(26, 29, 31, 0.4)); | ||
| z-index: 200; | ||
| } | ||
|
|
||
| // 카테고리 박스 + X버튼 컨테이너 — 새 사건 + 버튼과 동일 위치 기준 | ||
| .panel { | ||
| position: absolute; | ||
| bottom: fn.r(81); | ||
| right: max(fn.r(16), calc((100vw - #{v.$container-max-width}) / 2 + #{fn.r(16)})); | ||
|
|
||
| display: flex; | ||
| flex-direction: column; | ||
| align-items: flex-end; | ||
| gap: fn.r(16); | ||
| } | ||
|
|
||
| .categoryBox { | ||
| width: fn.r(133); | ||
| height: fn.r(176); | ||
| background-color: #ffffff; | ||
| border-radius: fn.r(12); | ||
| box-sizing: border-box; | ||
| padding: fn.r(20) fn.r(16); | ||
|
|
||
| display: flex; | ||
| flex-direction: column; | ||
| align-items: center; | ||
| justify-content: center; | ||
| gap: fn.r(8); | ||
| } | ||
|
|
||
| .item { | ||
| display: flex; | ||
| align-items: center; | ||
| gap: fn.r(9); | ||
| text-decoration: none; | ||
| } | ||
|
|
||
| .itemLabel { | ||
| @include m.text-body-m; | ||
|
|
||
| color: var(--text-primary); | ||
| } | ||
|
|
||
| .closeButton { | ||
| width: fn.r(48); | ||
| height: fn.r(48); | ||
| border-radius: 50%; | ||
| background-color: #ffffff; | ||
| border: none; | ||
| cursor: pointer; | ||
|
|
||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| color: v.$color-black-700; | ||
| flex-shrink: 0; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| 'use client' | ||
|
|
||
| import { useState, useEffect } from 'react' | ||
| import CloseIcon from '@mui/icons-material/Close' | ||
| import CategoryIcon from '@/components/ui/CategoryIcon' | ||
| import type { CategoryGroup } from '@/types/common' | ||
| import styles from './NewCaseButton.module.scss' | ||
|
|
||
| const CATEGORY_ITEMS: { category: CategoryGroup; label: string }[] = [ | ||
| { category: 'romance', label: '연인관계' }, | ||
| { category: 'work', label: '직장관계' }, | ||
| { category: 'friend', label: '친구관계' }, | ||
| { category: 'family', label: '가족관계' }, | ||
| ] | ||
|
|
||
| // TODO: 새 사건 작성 페이지(/rooms/new 등) 생성 후 카테고리별 실제 경로로 교체 | ||
| // 현재는 페이지가 없어 '#'으로 임시 처리 | ||
| function getCategoryHref(_category: CategoryGroup): string { | ||
| return '#' | ||
| } | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
|
|
||
| export default function NewCaseButton() { | ||
| const [isOpen, setIsOpen] = useState(false) | ||
|
|
||
| useEffect(() => { | ||
| document.body.style.overflow = isOpen ? 'hidden' : '' | ||
| return () => { document.body.style.overflow = '' } | ||
| }, [isOpen]) | ||
|
|
||
| return ( | ||
| <> | ||
| {isOpen && ( | ||
| <div | ||
| className={styles.overlay} | ||
| onClick={() => setIsOpen(false)} | ||
| role="dialog" | ||
| aria-modal="true" | ||
| > | ||
| <div className={styles.panel} onClick={(e) => e.stopPropagation()}> | ||
| <div className={styles.categoryBox}> | ||
| {CATEGORY_ITEMS.map(({ category, label }) => ( | ||
| <a key={category} href={getCategoryHref(category)} className={styles.item}> | ||
| <CategoryIcon category={category} /> | ||
| <span className={styles.itemLabel}>{label}</span> | ||
| </a> | ||
| ))} | ||
| </div> | ||
| <button | ||
| className={styles.closeButton} | ||
| onClick={() => setIsOpen(false)} | ||
| aria-label="카테고리 선택 닫기" | ||
| > | ||
| <CloseIcon style={{ width: 24, height: 24 }} /> | ||
| </button> | ||
| </div> | ||
| </div> | ||
| )} | ||
| {!isOpen && ( | ||
| <button | ||
| className={styles.button} | ||
| onClick={() => setIsOpen(true)} | ||
| aria-label="새 사건 작성" | ||
| > | ||
| 새 사건 + | ||
| </button> | ||
| )} | ||
| </> | ||
| ) | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| 'use client' | ||
|
|
||
| import { useQuery } from '@tanstack/react-query' | ||
| import type { ApiResponse } from '@/types/common' | ||
|
|
||
| interface UserMeData { | ||
| id: string | ||
| nickname: string | null | ||
| mbti: string | null | ||
| } | ||
|
|
||
| async function fetchUserMe(): Promise<UserMeData | null> { | ||
| const res = await fetch('/api/user/me') | ||
| if (res.status === 401) return null | ||
| if (!res.ok) throw new Error('사용자 정보를 불러오지 못했습니다.') | ||
| const json: ApiResponse<UserMeData> = await res.json() | ||
| return json.data ?? null | ||
| } | ||
|
|
||
| export function useUserMe() { | ||
| return useQuery({ | ||
| queryKey: ['user', 'me'], | ||
| queryFn: fetchUserMe, | ||
| staleTime: 1000 * 60 * 5, | ||
| }) | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.