File tree Expand file tree Collapse file tree 5 files changed +40
-9
lines changed
Expand file tree Collapse file tree 5 files changed +40
-9
lines changed Original file line number Diff line number Diff line change @@ -8,10 +8,12 @@ export default function AboutLayout({
88 children : React . ReactNode
99} ) {
1010 return (
11- < div >
11+ < >
1212 < Sidebar />
13- < Header />
14- < div > { children } </ div > { /* 여기에 page.tsx 내용이 들어옴 */ }
15- </ div >
13+ < div className = "pl-300" >
14+ < Header />
15+ < main > { children } </ main >
16+ </ div >
17+ </ >
1618 )
1719}
Original file line number Diff line number Diff line change 1- export default function dashBoardEditPage ( ) {
2- return < p > 대시보드 수정 페이지</ p >
1+ 'use client'
2+
3+ import { showError , showSuccess } from '@lib/toast'
4+
5+ export default function DashBoardEditPage ( ) {
6+ const handleSuccess = ( ) => {
7+ showSuccess ( '대시보드가 성공적으로 저장되었습니다.' )
8+ }
9+
10+ const handleError = ( ) => {
11+ showError ( '저장 중 오류가 발생했습니다.' )
12+ }
13+
14+ return (
15+ < div className = "space-y-4 p-6" >
16+ < p className = "text-xl font-semibold" > 대시보드 수정 페이지</ p >
17+
18+ < div className = "flex gap-4" >
19+ < button onClick = { handleSuccess } > 성공 토스트</ button >
20+ < button onClick = { handleError } > 에러 토스트</ button >
21+ </ div >
22+ </ div >
23+ )
324}
Original file line number Diff line number Diff line change 11import './globals.css'
22
33import type { Metadata } from 'next'
4+ import { Toaster } from 'sonner'
45
56import { Providers } from './providers'
6- import ThemeToggle from './shared/components/ThemeToggle'
77
88export const metadata : Metadata = {
99 title : 'Coplan' ,
@@ -21,7 +21,10 @@ export default function RootLayout({
2121 return (
2222 < html lang = "en" suppressHydrationWarning >
2323 < body >
24- < Providers > { children } </ Providers >
24+ < Providers >
25+ { children }
26+ < Toaster position = "top-right" richColors closeButton />
27+ </ Providers >
2528 </ body >
2629 </ html >
2730 )
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export default function Header() {
1414
1515 return (
1616 < header className = "BG-white Border-bottom Text-black w-full overflow-x-hidden border-b px-48 py-12" >
17- < div className = "flex w-full items-center justify-between pl-300 pr-16" >
17+ < div className = "flex w-full items-center justify-between pr-16" >
1818 { /* 좌측 대시보드명 */ }
1919 < div className = "flex shrink-0 items-center gap-8 pr-16" >
2020 < div className = "whitespace-nowrap font-bold" > 대시보드 명</ div >
Original file line number Diff line number Diff line change 1+ import { toast } from 'sonner'
2+
3+ export const showSuccess = ( message : string ) => toast . success ( message )
4+ export const showError = ( message : string ) => toast . error ( message )
5+ export const showInfo = ( message : string ) => toast . message ( message ) // 성공, 실패가 아닌 정보
You can’t perform that action at this time.
0 commit comments