diff --git a/src/app/dashboard/[id]/edit/layout.tsx b/src/app/dashboard/[id]/edit/layout.tsx index a991b87..e1ec752 100644 --- a/src/app/dashboard/[id]/edit/layout.tsx +++ b/src/app/dashboard/[id]/edit/layout.tsx @@ -8,10 +8,12 @@ export default function AboutLayout({ children: React.ReactNode }) { return ( -
+ <> -
-
{children}
{/* 여기에 page.tsx 내용이 들어옴 */} -
+
+
+
{children}
+
+ ) } diff --git a/src/app/dashboard/[id]/edit/page.tsx b/src/app/dashboard/[id]/edit/page.tsx index 261456c..c4903d2 100644 --- a/src/app/dashboard/[id]/edit/page.tsx +++ b/src/app/dashboard/[id]/edit/page.tsx @@ -1,3 +1,24 @@ -export default function dashBoardEditPage() { - return

대시보드 수정 페이지

+'use client' + +import { showError, showSuccess } from '@lib/toast' + +export default function DashBoardEditPage() { + const handleSuccess = () => { + showSuccess('대시보드가 성공적으로 저장되었습니다.') + } + + const handleError = () => { + showError('저장 중 오류가 발생했습니다.') + } + + return ( +
+

대시보드 수정 페이지

+ +
+ + +
+
+ ) } diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 7c46216..078002f 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,9 +1,9 @@ import './globals.css' import type { Metadata } from 'next' +import { Toaster } from 'sonner' import { Providers } from './providers' -import ThemeToggle from './shared/components/ThemeToggle' export const metadata: Metadata = { title: 'Coplan', @@ -21,7 +21,10 @@ export default function RootLayout({ return ( - {children} + + {children} + + ) diff --git a/src/app/shared/components/common/header/Header.tsx b/src/app/shared/components/common/header/Header.tsx index 78f6e3e..3cd1de8 100644 --- a/src/app/shared/components/common/header/Header.tsx +++ b/src/app/shared/components/common/header/Header.tsx @@ -14,7 +14,7 @@ export default function Header() { return (
-
+
{/* 좌측 대시보드명 */}
대시보드 명
diff --git a/src/app/shared/lib/toast.ts b/src/app/shared/lib/toast.ts new file mode 100644 index 0000000..7a15733 --- /dev/null +++ b/src/app/shared/lib/toast.ts @@ -0,0 +1,5 @@ +import { toast } from 'sonner' + +export const showSuccess = (message: string) => toast.success(message) +export const showError = (message: string) => toast.error(message) +export const showInfo = (message: string) => toast.message(message) // 성공, 실패가 아닌 정보