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/space-tools-dock/index.ts
Normal file
1
src/widgets/space-tools-dock/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './ui/SpaceToolsDockWidget';
|
||||
23
src/widgets/space-tools-dock/model/useSpaceToolsDock.ts
Normal file
23
src/widgets/space-tools-dock/model/useSpaceToolsDock.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
'use client';
|
||||
|
||||
import { useState } from 'react';
|
||||
|
||||
export type SpaceToolPanel = 'room' | 'notes' | 'quick' | null;
|
||||
|
||||
export const useSpaceToolsDock = () => {
|
||||
const [activePanel, setActivePanel] = useState<SpaceToolPanel>(null);
|
||||
|
||||
const togglePanel = (panel: Exclude<SpaceToolPanel, null>) => {
|
||||
setActivePanel((current) => (current === panel ? null : panel));
|
||||
};
|
||||
|
||||
const closePanel = () => {
|
||||
setActivePanel(null);
|
||||
};
|
||||
|
||||
return {
|
||||
activePanel,
|
||||
togglePanel,
|
||||
closePanel,
|
||||
};
|
||||
};
|
||||
105
src/widgets/space-tools-dock/ui/SpaceToolsDockWidget.tsx
Normal file
105
src/widgets/space-tools-dock/ui/SpaceToolsDockWidget.tsx
Normal file
@@ -0,0 +1,105 @@
|
||||
'use client';
|
||||
|
||||
import type { RoomPresence } from '@/entities/room';
|
||||
import { CHECK_IN_PHRASES, REACTION_OPTIONS } from '@/entities/session';
|
||||
import { useCheckIn } from '@/features/check-in';
|
||||
import { useToast } from '@/shared/ui';
|
||||
import { cn } from '@/shared/lib/cn';
|
||||
import { NotesSheetWidget } from '@/widgets/notes-sheet';
|
||||
import { QuickSheetWidget } from '@/widgets/quick-sheet';
|
||||
import { RoomSheetWidget } from '@/widgets/room-sheet';
|
||||
import { useSpaceToolsDock } from '../model/useSpaceToolsDock';
|
||||
|
||||
interface SpaceToolsDockWidgetProps {
|
||||
roomName: string;
|
||||
activeMembers: number;
|
||||
presence: RoomPresence;
|
||||
}
|
||||
|
||||
const TOOL_BUTTONS: Array<{
|
||||
id: 'room' | 'notes' | 'quick';
|
||||
icon: string;
|
||||
label: string;
|
||||
}> = [
|
||||
{ id: 'room', icon: '👥', label: 'Room' },
|
||||
{ id: 'notes', icon: '📝', label: 'Notes' },
|
||||
{ id: 'quick', icon: '⚙️', label: 'Quick' },
|
||||
];
|
||||
|
||||
export const SpaceToolsDockWidget = ({
|
||||
roomName,
|
||||
activeMembers,
|
||||
presence,
|
||||
}: SpaceToolsDockWidgetProps) => {
|
||||
const { pushToast } = useToast();
|
||||
const { lastCheckIn, recordCheckIn } = useCheckIn();
|
||||
const { activePanel, closePanel, togglePanel } = useSpaceToolsDock();
|
||||
|
||||
const handleCheckIn = (message: string) => {
|
||||
recordCheckIn(message);
|
||||
pushToast({ title: `체크인: ${message}` });
|
||||
};
|
||||
|
||||
const handleReaction = (emoji: string) => {
|
||||
pushToast({ title: `리액션: ${emoji}` });
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
{activePanel ? (
|
||||
<button
|
||||
type="button"
|
||||
aria-label="시트 닫기"
|
||||
onClick={closePanel}
|
||||
className="fixed inset-0 z-30 bg-slate-950/10"
|
||||
/>
|
||||
) : null}
|
||||
|
||||
<div className="fixed right-2 top-1/2 z-50 -translate-y-1/2">
|
||||
<div className="flex w-12 flex-col items-center gap-2 rounded-2xl border border-white/20 bg-slate-950/66 py-2 shadow-lg shadow-slate-950/60 backdrop-blur-xl">
|
||||
{TOOL_BUTTONS.map((tool) => (
|
||||
<button
|
||||
key={tool.id}
|
||||
type="button"
|
||||
title={tool.label}
|
||||
onClick={() => togglePanel(tool.id)}
|
||||
className={cn(
|
||||
'inline-flex h-9 w-9 items-center justify-center rounded-xl border text-base transition-colors',
|
||||
activePanel === tool.id
|
||||
? 'border-sky-200/75 bg-sky-300/28'
|
||||
: 'border-white/20 bg-white/8 hover:bg-white/15',
|
||||
)}
|
||||
>
|
||||
<span aria-hidden>{tool.icon}</span>
|
||||
<span className="sr-only">{tool.label}</span>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{activePanel === 'room' ? (
|
||||
<RoomSheetWidget
|
||||
roomName={roomName}
|
||||
activeMembers={activeMembers}
|
||||
presence={presence}
|
||||
checkInPhrases={CHECK_IN_PHRASES}
|
||||
reactions={REACTION_OPTIONS}
|
||||
lastCheckIn={lastCheckIn}
|
||||
onClose={closePanel}
|
||||
onCheckIn={handleCheckIn}
|
||||
onReaction={(reaction) => handleReaction(reaction.emoji)}
|
||||
/>
|
||||
) : null}
|
||||
|
||||
{activePanel === 'notes' ? (
|
||||
<NotesSheetWidget
|
||||
onClose={closePanel}
|
||||
onNoteAdded={(note) => pushToast({ title: `노트 추가: ${note}` })}
|
||||
onNoteRemoved={() => pushToast({ title: '노트를 정리했어요' })}
|
||||
/>
|
||||
) : null}
|
||||
|
||||
{activePanel === 'quick' ? <QuickSheetWidget onClose={closePanel} /> : null}
|
||||
</>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user