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:
@@ -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();
|
||||
|
||||
@@ -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}
|
||||
/>
|
||||
))
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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에서 제거
|
||||
|
||||
Reference in New Issue
Block a user