diff --git a/src/app/[locale]/(protected)/boards/[boardCode]/[postId]/page.tsx b/src/app/[locale]/(protected)/boards/[boardCode]/[postId]/page.tsx index a10f1a67..e8f9a3b4 100644 --- a/src/app/[locale]/(protected)/boards/[boardCode]/[postId]/page.tsx +++ b/src/app/[locale]/(protected)/boards/[boardCode]/[postId]/page.tsx @@ -10,7 +10,8 @@ import { DynamicBoardEditForm } from '@/components/board/DynamicBoard/DynamicBoa import { useState, useEffect, useCallback, Suspense } from 'react'; import { DetailPageSkeleton } from '@/components/ui/skeleton'; import { format } from 'date-fns'; -import { ArrowLeft, Pencil, Trash2, MessageSquare, Eye } from 'lucide-react'; +import { ArrowLeft, Edit, Trash2, MessageSquare, Eye } from 'lucide-react'; +import { useMenuStore } from '@/stores/menuStore'; import { PageLayout } from '@/components/organisms/PageLayout'; import { PageHeader } from '@/components/organisms/PageHeader'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; @@ -100,6 +101,7 @@ function DetailModeRouter() { // 실제 상세 컴포넌트 (자체 hooks 사용) function DynamicBoardDetailContent({ boardCode, postId }: { boardCode: string; postId: string }) { const router = useRouter(); + const sidebarCollapsed = useMenuStore((state) => state.sidebarCollapsed); // 게시판 정보 const [boardName, setBoardName] = useState('게시판'); @@ -261,6 +263,7 @@ function DynamicBoardDetailContent({ boardCode, postId }: { boardCode: string; p icon={MessageSquare} /> +
{/* 게시글 상세 */} @@ -282,9 +285,9 @@ function DynamicBoardDetailContent({ boardCode, postId }: { boardCode: string; p
{isAuthor && ( -
+
+
- {/* 하단 버튼 */} -
- + {isAuthor && ( +
+ + +
+ )}
{/* 게시글 삭제 확인 다이얼로그 */} diff --git a/src/app/[locale]/(protected)/boards/[boardCode]/page.tsx b/src/app/[locale]/(protected)/boards/[boardCode]/page.tsx index 0db94d31..ab47180d 100644 --- a/src/app/[locale]/(protected)/boards/[boardCode]/page.tsx +++ b/src/app/[locale]/(protected)/boards/[boardCode]/page.tsx @@ -223,7 +223,7 @@ function DynamicBoardListContent({ boardCode }: { boardCode: string }) { const handleRowClick = useCallback( (item: BoardPost) => { - router.push(`/ko/boards/${boardCode}/${item.id}`); + router.push(`/ko/boards/${boardCode}/${item.id}?mode=view`); }, [router, boardCode] ); diff --git a/src/components/board/BoardDetail/index.tsx b/src/components/board/BoardDetail/index.tsx index 70e93a57..00df72e4 100644 --- a/src/components/board/BoardDetail/index.tsx +++ b/src/components/board/BoardDetail/index.tsx @@ -125,17 +125,11 @@ export function BoardDetail({ post, comments: initialComments, currentUserId }: {/* 메타 정보: 작성자 | 날짜 | 조회수 */} -
- {post.authorName} - {post.authorDepartment && ( - <> - | - {post.authorDepartment} - - )} - | +
+ {post.authorName}{post.authorDepartment ? ` / ${post.authorDepartment}` : ''} + | {format(new Date(post.createdAt), 'yyyy-MM-dd HH:mm')} - | + | 조회수 {post.viewCount}
diff --git a/src/components/board/BoardManagement/BoardDetail.tsx b/src/components/board/BoardManagement/BoardDetail.tsx index 0185f55d..4d74a91e 100644 --- a/src/components/board/BoardManagement/BoardDetail.tsx +++ b/src/components/board/BoardManagement/BoardDetail.tsx @@ -7,6 +7,7 @@ import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Button } from '@/components/ui/button'; import { Badge } from '@/components/ui/badge'; import { ClipboardList, ArrowLeft, Edit, Trash2 } from 'lucide-react'; +import { useMenuStore } from '@/stores/menuStore'; import type { Board } from './types'; import { BOARD_STATUS_LABELS, @@ -33,6 +34,7 @@ const formatDateTime = (dateString: string): string => { export function BoardDetail({ board, onEdit, onDelete }: BoardDetailProps) { const router = useRouter(); + const sidebarCollapsed = useMenuStore((state) => state.sidebarCollapsed); const handleBack = () => { router.push('/ko/board/board-management'); @@ -54,7 +56,7 @@ export function BoardDetail({ board, onEdit, onDelete }: BoardDetailProps) { icon={ClipboardList} /> -
+
{/* 게시판 정보 */} @@ -93,26 +95,34 @@ export function BoardDetail({ board, onEdit, onDelete }: BoardDetailProps) { - {/* 버튼 영역 */} -
- -
- {onDelete && ( - - )} - {onEdit && ( - - )} -
+
+ + {/* 하단 액션 버튼 (sticky) */} +
+ +
+ {onDelete && ( + + )} + {onEdit && ( + + )}
diff --git a/src/components/board/BoardManagement/BoardDetailClientV2.tsx b/src/components/board/BoardManagement/BoardDetailClientV2.tsx index f490f2c4..c313fbfb 100644 --- a/src/components/board/BoardManagement/BoardDetailClientV2.tsx +++ b/src/components/board/BoardManagement/BoardDetailClientV2.tsx @@ -93,9 +93,10 @@ export function BoardDetailClientV2({ boardId, initialMode }: BoardDetailClientV // URL 쿼리 변경 감지 useEffect(() => { - if (!isNewMode && modeFromQuery === 'edit') { + if (isNewMode) return; + if (modeFromQuery === 'edit') { setMode('edit'); - } else if (!isNewMode && !modeFromQuery) { + } else { setMode('view'); } }, [modeFromQuery, isNewMode]); diff --git a/src/components/board/BoardManagement/BoardForm.tsx b/src/components/board/BoardManagement/BoardForm.tsx index a11b6331..77d51d3f 100644 --- a/src/components/board/BoardManagement/BoardForm.tsx +++ b/src/components/board/BoardManagement/BoardForm.tsx @@ -17,7 +17,8 @@ import { SelectValue, } from '@/components/ui/select'; import { Checkbox } from '@/components/ui/checkbox'; -import { ClipboardList, ArrowLeft, Save } from 'lucide-react'; +import { ClipboardList, ArrowLeft, Save, X } from 'lucide-react'; +import { useMenuStore } from '@/stores/menuStore'; import type { Board, BoardFormData, BoardTarget, BoardStatus } from './types'; import { BOARD_TARGETS, BOARD_STATUS_LABELS } from './types'; @@ -62,6 +63,7 @@ const getCurrentDateTime = (): string => { export function BoardForm({ mode, board, onSubmit }: BoardFormProps) { const router = useRouter(); + const sidebarCollapsed = useMenuStore((state) => state.sidebarCollapsed); const [formData, setFormData] = useState({ target: 'all', targetName: '', @@ -129,7 +131,7 @@ export function BoardForm({ mode, board, onSubmit }: BoardFormProps) { icon={ClipboardList} /> -
+ {/* 게시판 정보 */} @@ -254,18 +256,21 @@ export function BoardForm({ mode, board, onSubmit }: BoardFormProps) { - {/* 버튼 영역 */} -
- - -
+ + {/* 하단 액션 버튼 (sticky) */} +
+ + +
); } \ No newline at end of file diff --git a/src/components/board/CommentSection/CommentItem.tsx b/src/components/board/CommentSection/CommentItem.tsx index c1154bf5..32c08770 100644 --- a/src/components/board/CommentSection/CommentItem.tsx +++ b/src/components/board/CommentSection/CommentItem.tsx @@ -12,7 +12,7 @@ import { useState, useCallback, memo } from 'react'; import { format } from 'date-fns'; -import { User, Pencil, Trash2 } from 'lucide-react'; +import { User, Edit, Trash2 } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Textarea } from '@/components/ui/textarea'; import { DeleteConfirmDialog } from '@/components/ui/confirm-dialog'; @@ -90,7 +90,7 @@ export const CommentItem = memo(function CommentItem({ {/* 댓글 내용 */}
{/* 작성자 정보 + 날짜 + 버튼 */} -
+
{authorInfo} @@ -107,7 +107,7 @@ export const CommentItem = memo(function CommentItem({ className="h-7 px-2 text-gray-500 hover:text-gray-700" onClick={handleEditClick} > - + 수정 - -
+ + {/* 하단 액션 버튼 (sticky) */} +
+ + +
); } diff --git a/src/components/board/DynamicBoard/DynamicBoardEditForm.tsx b/src/components/board/DynamicBoard/DynamicBoardEditForm.tsx index f0a88322..b8f90662 100644 --- a/src/components/board/DynamicBoard/DynamicBoardEditForm.tsx +++ b/src/components/board/DynamicBoard/DynamicBoardEditForm.tsx @@ -7,7 +7,7 @@ import { useState, useEffect } from 'react'; import { useRouter } from 'next/navigation'; -import { ArrowLeft, Save, MessageSquare } from 'lucide-react'; +import { ArrowLeft, X, Save, MessageSquare } from 'lucide-react'; import { DetailPageSkeleton } from '@/components/ui/skeleton'; import { PageLayout } from '@/components/organisms/PageLayout'; import { PageHeader } from '@/components/organisms/PageHeader'; @@ -17,6 +17,7 @@ import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; import { Textarea } from '@/components/ui/textarea'; import { Checkbox } from '@/components/ui/checkbox'; +import { useMenuStore } from '@/stores/menuStore'; import { getDynamicBoardPost, updateDynamicBoardPost } from '@/components/board/DynamicBoard/actions'; import { getBoardByCode } from '@/components/board/BoardManagement/actions'; import type { PostApiData } from '@/components/customer-center/shared/types'; @@ -59,6 +60,7 @@ interface DynamicBoardEditFormProps { export function DynamicBoardEditForm({ boardCode, postId }: DynamicBoardEditFormProps) { const router = useRouter(); + const sidebarCollapsed = useMenuStore((state) => state.sidebarCollapsed); // 게시판 정보 const [boardName, setBoardName] = useState('게시판'); @@ -134,7 +136,7 @@ export function DynamicBoardEditForm({ boardCode, postId }: DynamicBoardEditForm }); if (result.success) { - router.push(`/ko/boards/${boardCode}/${postId}`); + router.push(`/ko/boards/${boardCode}/${postId}?mode=view`); } else { setError(result.error || '게시글 수정에 실패했습니다.'); setIsSubmitting(false); @@ -143,7 +145,7 @@ export function DynamicBoardEditForm({ boardCode, postId }: DynamicBoardEditForm // 취소 const handleCancel = () => { - router.push(`/ko/boards/${boardCode}/${postId}`); + router.push(`/ko/boards/${boardCode}/${postId}?mode=view`); }; // 로딩 상태 @@ -178,7 +180,7 @@ export function DynamicBoardEditForm({ boardCode, postId }: DynamicBoardEditForm icon={MessageSquare} /> -
+ 게시글 수정 @@ -230,23 +232,21 @@ export function DynamicBoardEditForm({ boardCode, postId }: DynamicBoardEditForm - {/* 버튼 영역 */} -
- - -
+ + {/* 하단 액션 버튼 (sticky) */} +
+ + +
); }