-
Notifications
You must be signed in to change notification settings - Fork 3
feat: 사건작성 페이지 구현 (disputes/[id]/statement) #46
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
10 commits
Select commit
Hold shift + click to select a range
fe5198e
feat: 사건작성 페이지 구현 (disputes/[id]/statement)
juahcheon e982f2b
fix: 사건작성 페이지 카테고리/간격/드롭다운 수정
juahcheon 4585ada
fix: 카테고리 없음 모달에서 버튼 제거 — 페이지 블로킹만 유지
juahcheon 06a8977
fix: 카테고리 기본값 romance 적용, 모달 확인 버튼 복원
juahcheon cfdc8ce
fix: Select 커스텀 드롭다운 교체 및 Textarea focus 스타일 제거
juahcheon 74b8d4e
style: Button 좌우 패딩 16 → 12으로 조정
juahcheon 95019dd
style: SCSS import 상대경로 → 절대경로(@/) 변환 및 컨벤션 문서 추가
juahcheon 8a98285
fix: Select 접근성 및 스타일 개선
juahcheon 4dfc753
fix: dispute 생성 조건을 active room 전체로 완화 (ONE_TO_ONE 제한 제거)
juahcheon 4cc683d
fix: Select id 안정화, 빈 options 가드, Tab 기본 포커스 이동 허용
juahcheon 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
109 changes: 109 additions & 0 deletions
109
src/app/(page)/disputes/[id]/statement/StatementPage.module.scss
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,109 @@ | ||
| @use '@/styles/abstracts/variables' as v; | ||
| @use '@/styles/abstracts/functions' as fn; | ||
| @use '@/styles/abstracts/mixins' as m; | ||
|
|
||
| .page { | ||
| display: flex; | ||
| flex-direction: column; | ||
| min-height: 100vh; | ||
| background-color: var(--bg-page); | ||
| } | ||
|
|
||
| .content { | ||
| flex: 1; | ||
| padding: fn.r(16) fn.r(20) fn.r(100); | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: fn.r(16); | ||
| } | ||
|
|
||
| .section { | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: fn.r(16); | ||
| } | ||
|
|
||
| .label { | ||
| @include m.text-body-s; | ||
| color: v.$color-black; | ||
| margin: 0; | ||
| } | ||
|
|
||
| .categories { | ||
| display: flex; | ||
| flex-direction: row; | ||
| } | ||
|
|
||
| .categoryItem { | ||
| display: flex; | ||
| flex-direction: column; | ||
| align-items: center; | ||
| gap: fn.r(4); | ||
| width: fn.r(44); | ||
| } | ||
|
|
||
| .categoryIcon { | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| width: fn.r(44); | ||
| height: fn.r(44); | ||
| border-radius: fn.r(8); | ||
| background-color: var(--bg-surface); | ||
| border: 1px solid var(--border-brand); | ||
| } | ||
|
|
||
| .categoryLabel { | ||
| @include m.text-caption; | ||
| font-weight: v.$font-weight-bold; | ||
| color: var(--text-primary); | ||
| white-space: nowrap; | ||
| } | ||
|
|
||
| .statementGroup { | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: fn.r(8); | ||
| } | ||
|
|
||
| .textarea { | ||
| min-height: fn.r(350); | ||
| } | ||
|
|
||
| .footer { | ||
| position: fixed; | ||
| bottom: 0; | ||
| left: 0; | ||
| right: 0; | ||
| padding: fn.r(40) fn.r(20); | ||
| background-color: var(--bg-page); | ||
| } | ||
|
|
||
| .modalOverlay { | ||
| position: fixed; | ||
| inset: 0; | ||
| background-color: rgba(0, 0, 0, 0.4); | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| z-index: 100; | ||
| padding: fn.r(20); | ||
| } | ||
|
|
||
| .modal { | ||
| background-color: var(--bg-page); | ||
| border-radius: fn.r(16); | ||
| padding: fn.r(24) fn.r(20); | ||
| width: 100%; | ||
| max-width: fn.r(320); | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: fn.r(20); | ||
| } | ||
|
|
||
| .modalText { | ||
| @include m.text-body-m; | ||
| color: var(--text-primary); | ||
| margin: 0; | ||
| 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,110 @@ | ||
| 'use client' | ||
|
|
||
| import React from 'react' | ||
| import { useRouter } from 'next/navigation' | ||
| import Header from '@/components/layout/Header' | ||
| import Button from '@/components/ui/Button' | ||
| import Select from '@/components/ui/Select' | ||
| import Textarea from '@/components/ui/Textarea' | ||
| import { CATEGORY_ICON_MAP, CATEGORY_LABEL_MAP } from '@/components/ui/CategoryIcon' | ||
| import type { CategoryGroup } from '@/types/common' | ||
| import styles from './StatementPage.module.scss' | ||
|
|
||
| const VALID_CATEGORIES: CategoryGroup[] = ['romance', 'work', 'friend', 'family'] | ||
|
|
||
| const MBTI_OPTIONS = [ | ||
| 'INTJ', 'INTP', 'ENTJ', 'ENTP', | ||
| 'INFJ', 'INFP', 'ENFJ', 'ENFP', | ||
| 'ISTJ', 'ISFJ', 'ESTJ', 'ESFJ', | ||
| 'ISTP', 'ISFP', 'ESTP', 'ESFP', | ||
| ].map((v) => ({ value: v, label: v })) | ||
|
|
||
| export default function StatementPage({ | ||
| params, | ||
| searchParams, | ||
| }: { | ||
| params: Promise<{ id: string }> | ||
| searchParams: Promise<{ category?: string }> | ||
| }) { | ||
| const { id } = React.use(params) | ||
| const { category: rawCategory } = React.use(searchParams) | ||
| const router = useRouter() | ||
|
|
||
| // TODO: 이전 페이지 카테고리 데이터 연동 후 null 처리로 교체 | ||
| const category: CategoryGroup = VALID_CATEGORIES.includes(rawCategory as CategoryGroup) | ||
| ? (rawCategory as CategoryGroup) | ||
| : 'romance' | ||
|
evenif99 marked this conversation as resolved.
|
||
|
|
||
| const [mbti, setMbti] = React.useState('') | ||
| const [content, setContent] = React.useState('') | ||
|
|
||
| const handleSave = () => { | ||
| // TODO: API 연결 — 진술 저장 후 사건 상세 페이지로 이동 | ||
| router.push(`/disputes/${id}`) | ||
| } | ||
|
|
||
| if (!category) { | ||
| return ( | ||
| <div className={styles.page}> | ||
| <Header title="사건작성" onBack={() => router.back()} /> | ||
| <div className={styles.modalOverlay}> | ||
| <div className={styles.modal}> | ||
| <p className={styles.modalText}>카테고리를 선택해주세요</p> | ||
| <Button onClick={() => router.back()}>확인</Button> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| ) | ||
| } | ||
|
|
||
| const Icon = CATEGORY_ICON_MAP[category] | ||
|
|
||
| return ( | ||
| <div className={styles.page}> | ||
| <Header title="사건작성" onBack={() => router.back()} /> | ||
|
|
||
| <div className={styles.content}> | ||
| {/* 사건 카테고리 — 이전 페이지에서 선택된 카테고리만 표시 */} | ||
| <section className={styles.section}> | ||
| <p className={styles.label}>사건 카테고리</p> | ||
| <div className={styles.categories}> | ||
| <div className={styles.categoryItem}> | ||
| <div className={styles.categoryIcon}> | ||
| <Icon sx={{ fontSize: 20 }} /> | ||
| </div> | ||
| <span className={styles.categoryLabel}> | ||
| {CATEGORY_LABEL_MAP[category]} | ||
| </span> | ||
| </div> | ||
| </div> | ||
| </section> | ||
|
|
||
| {/* 진술서 */} | ||
| <section className={styles.section}> | ||
| <p className={styles.label}>작성자님의 진술서</p> | ||
| <div className={styles.statementGroup}> | ||
| <Select | ||
| value={mbti} | ||
| onChange={(e) => setMbti(e.target.value)} | ||
| options={MBTI_OPTIONS} | ||
| placeholder="작성자님의 MBTI 선택 해주세요" | ||
| /> | ||
| <Textarea | ||
| value={content} | ||
| onChange={(e) => setContent(e.target.value)} | ||
| maxLength={1000} | ||
| placeholder={"사건내용을 작성해주세요.\n욕설의 경우 가리기 처리 될 수 있어요"} | ||
| className={styles.textarea} | ||
| /> | ||
| </div> | ||
| </section> | ||
| </div> | ||
|
|
||
| <div className={styles.footer}> | ||
| <Button onClick={handleSave} disabled={!content.trim()}> | ||
| 진술저장 | ||
| </Button> | ||
| </div> | ||
| </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
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
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
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
Oops, something went wrong.
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.