From 5bf8ff6e3ffd4f9308af1805d69b81a865a755db Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Tue, 18 Mar 2025 01:56:46 +0000 Subject: [PATCH] Fix toast text alignment The text in the toast notification was left-aligned instead of centered. This commit fixes the alignment issue. --- src/components/security/DataResetSection.tsx | 7 +++++++ src/components/ui/toast.tsx | 5 +++-- src/components/ui/toaster.tsx | 2 +- src/hooks/toast/constants.ts | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/components/security/DataResetSection.tsx b/src/components/security/DataResetSection.tsx index dfa72f2..efb7d4e 100644 --- a/src/components/security/DataResetSection.tsx +++ b/src/components/security/DataResetSection.tsx @@ -6,6 +6,7 @@ import { useAuth } from '@/contexts/auth/AuthProvider'; import { useDataReset } from '@/hooks/useDataReset'; import DataResetDialog from './DataResetDialog'; import { isSyncEnabled } from '@/utils/sync/syncSettings'; +import { toast } from '@/hooks/useToast.wrapper'; const DataResetSection = () => { const [isResetDialogOpen, setIsResetDialogOpen] = useState(false); @@ -17,6 +18,12 @@ const DataResetSection = () => { await resetAllData(); setIsResetDialogOpen(false); + // 알림 표시 + toast({ + title: "데이터 초기화 완료", + description: "모든 데이터가 초기화되었습니다.", + }); + // 초기화 후 페이지 새로고침 setTimeout(() => { window.location.reload(); diff --git a/src/components/ui/toast.tsx b/src/components/ui/toast.tsx index a822477..5d47d4a 100644 --- a/src/components/ui/toast.tsx +++ b/src/components/ui/toast.tsx @@ -1,3 +1,4 @@ + import * as React from "react" import * as ToastPrimitives from "@radix-ui/react-toast" import { cva, type VariantProps } from "class-variance-authority" @@ -92,7 +93,7 @@ const ToastTitle = React.forwardRef< >(({ className, ...props }, ref) => ( )) @@ -104,7 +105,7 @@ const ToastDescription = React.forwardRef< >(({ className, ...props }, ref) => ( )) diff --git a/src/components/ui/toaster.tsx b/src/components/ui/toaster.tsx index 5b7ef65..628ec3c 100644 --- a/src/components/ui/toaster.tsx +++ b/src/components/ui/toaster.tsx @@ -17,7 +17,7 @@ export function Toaster() { {toasts.map(function ({ id, title, description, action, ...props }) { return ( -
+
{title && {title}} {description && ( {description} diff --git a/src/hooks/toast/constants.ts b/src/hooks/toast/constants.ts index 9d0e167..74c8129 100644 --- a/src/hooks/toast/constants.ts +++ b/src/hooks/toast/constants.ts @@ -1,3 +1,3 @@ export const TOAST_LIMIT = 5 // 최대 5개로 제한 -export const TOAST_REMOVE_DELAY = 3000 // 3초 후 DOM에서 제거 (5초에서 3초로 변경) +export const TOAST_REMOVE_DELAY = 3000 // 3초 후 DOM에서 제거