feat(fsd): 허브·스페이스 중심 UI 목업 구조로 재편
맥락: - 기존 라우트/컴포넌트 구조를 FSD 기준으로 정리하고, /app 허브와 /space 집중 화면 중심의 목업 흐름을 구성하기 위해 변경사항: - App Router 구조를 /landing, /app, /space, /stats, /settings 중심으로 재배치 - entities/session/room/user 더미 데이터와 타입 정의 추가 - features(커스텀 입장, 룸 선택, 체크인, 리액션, 30초 리스타트 등) 단위로 로직 분리 - widgets(허브, 룸 갤러리, 타이머 HUD, 툴 도크 등) 조합형 UI 추가 - shared 공용 UI(Button/Chip/Modal/Toast 등) 및 유틸(cn/useReducedMotion) 정비 - 로그인 후 이동 경로를 /dashboard 에서 /app 으로 변경 - README를 현재 프로젝트 구조/라우트/구현 범위 기준으로 갱신 검증: - npx tsc --noEmit 세션-상태: 허브·스페이스 목업이 FSD 레이어로 동작 가능하도록 정리됨 세션-다음: /space 상단 및 도크의 인원 수 카피를 분위기형 카피로 후속 정리 세션-리스크: build는 네트워크 환경에서 Google Fonts fetch 실패 가능
This commit is contained in:
1
src/widgets/settings-panel/index.ts
Normal file
1
src/widgets/settings-panel/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './ui/SettingsPanelWidget';
|
||||
110
src/widgets/settings-panel/ui/SettingsPanelWidget.tsx
Normal file
110
src/widgets/settings-panel/ui/SettingsPanelWidget.tsx
Normal file
@@ -0,0 +1,110 @@
|
||||
'use client';
|
||||
|
||||
import Link from 'next/link';
|
||||
import { useState } from 'react';
|
||||
import {
|
||||
DEFAULT_PRESET_OPTIONS,
|
||||
NOTIFICATION_INTENSITY_OPTIONS,
|
||||
} from '@/shared/config/settingsOptions';
|
||||
import { cn } from '@/shared/lib/cn';
|
||||
|
||||
export const SettingsPanelWidget = () => {
|
||||
const [reduceMotion, setReduceMotion] = useState(false);
|
||||
const [notificationIntensity, setNotificationIntensity] =
|
||||
useState<(typeof NOTIFICATION_INTENSITY_OPTIONS)[number]>('기본');
|
||||
const [defaultPresetId, setDefaultPresetId] = useState<
|
||||
(typeof DEFAULT_PRESET_OPTIONS)[number]['id']
|
||||
>(DEFAULT_PRESET_OPTIONS[0].id);
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-[radial-gradient(circle_at_80%_0%,rgba(34,211,238,0.16),transparent_48%),linear-gradient(170deg,#020617_0%,#111827_54%,#0f172a_100%)] text-white">
|
||||
<div className="mx-auto w-full max-w-4xl px-4 pb-10 pt-6 sm:px-6">
|
||||
<header className="mb-6 flex items-center justify-between rounded-xl border border-white/12 bg-white/6 px-4 py-3">
|
||||
<h1 className="text-xl font-semibold">Settings</h1>
|
||||
<Link
|
||||
href="/app"
|
||||
className="rounded-lg border border-white/24 px-3 py-1.5 text-xs text-white/85 transition hover:bg-white/10"
|
||||
>
|
||||
허브로
|
||||
</Link>
|
||||
</header>
|
||||
|
||||
<div className="space-y-4">
|
||||
<section className="rounded-xl border border-white/15 bg-white/8 p-4">
|
||||
<div className="flex items-center justify-between gap-3">
|
||||
<div>
|
||||
<h2 className="text-base font-semibold text-white">Reduce Motion</h2>
|
||||
<p className="mt-1 text-sm text-white/70">
|
||||
전환 애니메이션을 최소화합니다. (UI 토글 목업)
|
||||
</p>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
role="switch"
|
||||
aria-checked={reduceMotion}
|
||||
onClick={() => setReduceMotion((current) => !current)}
|
||||
className={cn(
|
||||
'inline-flex w-16 items-center rounded-full border px-1 py-1 transition-colors',
|
||||
reduceMotion
|
||||
? 'border-sky-200/70 bg-sky-300/28'
|
||||
: 'border-white/30 bg-white/10',
|
||||
)}
|
||||
>
|
||||
<span
|
||||
className={cn(
|
||||
'h-5 w-5 rounded-full bg-white transition-transform duration-200 motion-reduce:transition-none',
|
||||
reduceMotion ? 'translate-x-9' : 'translate-x-0',
|
||||
)}
|
||||
/>
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section className="rounded-xl border border-white/15 bg-white/8 p-4">
|
||||
<h2 className="text-base font-semibold text-white">알림 강도</h2>
|
||||
<p className="mt-1 text-sm text-white/70">집중 시작/종료 신호의 존재감을 선택합니다.</p>
|
||||
<div className="mt-3 flex flex-wrap gap-2">
|
||||
{NOTIFICATION_INTENSITY_OPTIONS.map((option) => (
|
||||
<button
|
||||
key={option}
|
||||
type="button"
|
||||
onClick={() => setNotificationIntensity(option)}
|
||||
className={cn(
|
||||
'rounded-full border px-3 py-1.5 text-xs transition-colors',
|
||||
notificationIntensity === option
|
||||
? 'border-sky-200/80 bg-sky-300/25 text-sky-50'
|
||||
: 'border-white/24 bg-white/8 text-white/82 hover:bg-white/14',
|
||||
)}
|
||||
>
|
||||
{option}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section className="rounded-xl border border-white/15 bg-white/8 p-4">
|
||||
<h2 className="text-base font-semibold text-white">기본 프리셋</h2>
|
||||
<p className="mt-1 text-sm text-white/70">입장 시 자동 선택될 추천 세트를 고릅니다.</p>
|
||||
<div className="mt-3 space-y-2">
|
||||
{DEFAULT_PRESET_OPTIONS.map((preset) => (
|
||||
<button
|
||||
key={preset.id}
|
||||
type="button"
|
||||
onClick={() => setDefaultPresetId(preset.id)}
|
||||
className={cn(
|
||||
'w-full rounded-lg border px-3 py-2 text-left text-sm transition-colors',
|
||||
defaultPresetId === preset.id
|
||||
? 'border-sky-200/75 bg-sky-300/20 text-sky-50'
|
||||
: 'border-white/18 bg-white/5 text-white/85 hover:bg-white/10',
|
||||
)}
|
||||
>
|
||||
{preset.label}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user