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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user