Repository navigation
feat: 사건기록 페이지 구현 #65
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 all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
ecadee2
feat: 사건기록 페이지 구현
wjdalss21 182e1ce
Merge remote-tracking branch 'origin/dev' into feature/case-record-jm
wjdalss21 3551f36
fix: CodeRabbit PR65 리뷰 반영
wjdalss21 b2c497f
Merge remote-tracking branch 'origin/dev' into feature/case-record-jm
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
Empty file.
This file was deleted.
Oops, something went wrong.
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,7 @@ | ||
| @use '@/styles/abstracts/functions' as fn; | ||
|
|
||
| .page { | ||
| display: flex; | ||
| flex-direction: column; | ||
| min-height: 100dvh; | ||
| } |
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 |
|---|---|---|
| @@ -1,11 +1,20 @@ | ||
| import { getServerSession } from 'next-auth' | ||
| import { redirect } from 'next/navigation' | ||
| import { authOptions } from '@/lib/auth' | ||
| import Header from '@/components/layout/Header' | ||
| import BottomNavigation from '@/components/layout/BottomNavigation' | ||
| import RecordListSection from '@/components/records/RecordListSection' | ||
| import styles from './page.module.scss' | ||
|
|
||
| export default async function RecordsPage() { | ||
| const session = await getServerSession(authOptions) | ||
| if (!session) redirect('/login') | ||
|
|
||
| export default function RecordsPage() { | ||
| return ( | ||
| <> | ||
| <div className={styles.page}> | ||
| <Header variant="logo" /> | ||
| <main> | ||
| </main> | ||
| </> | ||
| <RecordListSection /> | ||
| <BottomNavigation /> | ||
| </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
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,77 @@ | ||
| @use '@/styles/abstracts/functions' as fn; | ||
| @use '@/styles/abstracts/variables' as v; | ||
| @use '@/styles/abstracts/mixins' as m; | ||
|
|
||
| .section { | ||
| flex: 1; | ||
| display: flex; | ||
| flex-direction: column; | ||
| padding-bottom: fn.r(80); | ||
| } | ||
|
|
||
| .filterWrapper { | ||
| padding: fn.r(16) fn.r(16) fn.r(8); | ||
| border-bottom: 1px solid var(--border-default); | ||
| } | ||
|
|
||
| .list { | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: fn.r(12); | ||
| padding: fn.r(16); | ||
| list-style: none; | ||
| } | ||
|
|
||
| .cardWrapper { | ||
| display: flex; | ||
| flex-direction: column; | ||
| box-shadow: inset 0 0 0 2px v.$color-black-700; | ||
| border-radius: fn.r(12); | ||
| background-color: var(--bg-surface); | ||
| overflow: hidden; | ||
| cursor: pointer; | ||
|
|
||
| &:active { | ||
| opacity: 0.8; | ||
| } | ||
|
|
||
| > article { | ||
| border: none; | ||
| border-radius: 0; | ||
| background-color: transparent; | ||
| padding-bottom: 0; | ||
|
|
||
| time { display: none; } | ||
|
|
||
| > p { margin-bottom: fn.r(8); } | ||
| } | ||
| } | ||
|
|
||
| .cardFooter { | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: space-between; | ||
| padding: 0 fn.r(16) fn.r(16); | ||
| } | ||
|
|
||
| .cardFooterLeft { | ||
| display: flex; | ||
| align-items: center; | ||
| gap: fn.r(8); | ||
| } | ||
|
|
||
| .cardDate { | ||
| @include m.text-label-s; | ||
|
|
||
| color: v.$color-black-400; | ||
| } | ||
|
|
||
| .empty { | ||
| flex: 1; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| font-size: v.$font-size-body-s; | ||
| color: var(--text-secondary); | ||
| padding: fn.r(60) 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,110 @@ | ||
| 'use client' | ||
|
|
||
| import { useState } from 'react' | ||
| import Link from 'next/link' | ||
| import CategoryFilter, { type Category } from '@/components/ui/CategoryFilter' | ||
| import CaseCard from '@/components/ui/CaseCard' | ||
| import Avatar from '@/components/ui/Avatar' | ||
| import StatusBadge, { type DisputeStatus } from '@/components/ui/StatusBadge' | ||
| import type { CategoryGroup } from '@/types/common' | ||
| import styles from './RecordListSection.module.scss' | ||
|
|
||
| interface RecordItem { | ||
| id: string | ||
| disputeId: string | ||
| title: string | ||
| description: string | ||
| categoryGroup: CategoryGroup | ||
| disputeStatus: DisputeStatus | ||
| createdAt: string | ||
| profileImageUrl?: string | ||
| } | ||
|
|
||
| // TODO: API 연동 시 교체 | ||
| const DUMMY_RECORDS: RecordItem[] = [ | ||
| { | ||
| id: '1', | ||
| disputeId: 'dispute-1', | ||
| title: '술주정 사건', | ||
| description: '제보자 술을 아주 극혐하는데 남친은 술을 너무 좋아해서 벌어진 사건', | ||
| categoryGroup: 'romance', | ||
| disputeStatus: 'judged', | ||
| createdAt: '2026-06-13', | ||
| }, | ||
| { | ||
| id: '2', | ||
| disputeId: 'dispute-2', | ||
| title: '업무 분배 갈등 사건', | ||
| description: '팀장이 특정 팀원에게만 업무를 몰아줘서 발생한 직장 내 갈등 사건', | ||
| categoryGroup: 'work', | ||
| disputeStatus: 'judged', | ||
| createdAt: '2026-06-10', | ||
| }, | ||
| { | ||
| id: '3', | ||
| disputeId: 'dispute-3', | ||
| title: '용돈 갈등 사건', | ||
| description: '부모님이 형에게만 용돈을 더 많이 주는 것 같아서 억울한 마음이 든 사건', | ||
| categoryGroup: 'family', | ||
| disputeStatus: 'closed', | ||
| createdAt: '2026-06-05', | ||
| }, | ||
| { | ||
| id: '4', | ||
| disputeId: 'dispute-4', | ||
| title: '약속 파기 사건', | ||
| description: '친구가 중요한 약속을 갑자기 취소하고 연락도 잘 안 되어 상처받은 사건', | ||
| categoryGroup: 'friend', | ||
| disputeStatus: 'judged', | ||
| createdAt: '2026-05-28', | ||
| }, | ||
| ] | ||
|
|
||
| function formatDate(dateStr: string): string { | ||
| return dateStr.slice(2, 10) | ||
| } | ||
|
|
||
| export default function RecordListSection() { | ||
| const [selectedCategory, setSelectedCategory] = useState<Category>('all') | ||
|
|
||
| const filtered = selectedCategory === 'all' | ||
| ? DUMMY_RECORDS | ||
| : DUMMY_RECORDS.filter((r) => r.categoryGroup === selectedCategory) | ||
|
|
||
| return ( | ||
| <section className={styles.section}> | ||
| <div className={styles.filterWrapper}> | ||
| <CategoryFilter value={selectedCategory} onChange={setSelectedCategory} /> | ||
| </div> | ||
|
|
||
| {filtered.length === 0 ? ( | ||
| <p className={styles.empty}>진행완료된 사건이 없어요</p> | ||
| ) : ( | ||
| <ul className={styles.list}> | ||
| {filtered.map((record) => ( | ||
| <li key={record.id}> | ||
| <Link | ||
| href={`/disputes/${record.disputeId}`} | ||
| className={styles.cardWrapper} | ||
| > | ||
| <CaseCard | ||
| title={record.title} | ||
| preview={record.description} | ||
| date={formatDate(record.createdAt)} | ||
| categoryGroup={record.categoryGroup} | ||
| /> | ||
| <div className={styles.cardFooter}> | ||
| <div className={styles.cardFooterLeft}> | ||
| <Avatar src={record.profileImageUrl} alt="참여자" size="s" /> | ||
| <time className={styles.cardDate}>{formatDate(record.createdAt)}</time> | ||
| </div> | ||
| <StatusBadge status={record.disputeStatus} /> | ||
| </div> | ||
| </Link> | ||
| </li> | ||
| ))} | ||
| </ul> | ||
| )} | ||
| </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
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
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.