Fix toast text alignment

The text in the toast notification was left-aligned instead of centered. This commit fixes the alignment issue.
This commit is contained in:
gpt-engineer-app[bot]
2025-03-18 01:56:46 +00:00
parent 043db23836
commit 5bf8ff6e3f
4 changed files with 12 additions and 4 deletions

View File

@@ -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();

View File

@@ -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) => (
<ToastPrimitives.Title
ref={ref}
className={cn("text-sm font-semibold", className)}
className={cn("text-sm font-semibold text-center", className)}
{...props}
/>
))
@@ -104,7 +105,7 @@ const ToastDescription = React.forwardRef<
>(({ className, ...props }, ref) => (
<ToastPrimitives.Description
ref={ref}
className={cn("text-sm opacity-90", className)}
className={cn("text-sm opacity-90 text-center", className)}
{...props}
/>
))

View File

@@ -17,7 +17,7 @@ export function Toaster() {
{toasts.map(function ({ id, title, description, action, ...props }) {
return (
<Toast key={id} {...props}>
<div className="grid gap-1">
<div className="grid gap-1 w-full text-center">
{title && <ToastTitle>{title}</ToastTitle>}
{description && (
<ToastDescription>{description}</ToastDescription>

View File

@@ -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에서 제거