diff --git a/frontend/app/app.css b/frontend/app/app.css index 71d6c96..0bcef87 100644 --- a/frontend/app/app.css +++ b/frontend/app/app.css @@ -196,10 +196,6 @@ animation: modal-in 0.18s ease-out; } - .toast-enter { - animation: toast-in 0.2s ease-out; - } - .notebook-md h1, .notebook-md h2, .notebook-md h3, @@ -260,13 +256,6 @@ } } -@keyframes toast-in { - from { - opacity: 0; - transform: translateY(-7px); - } -} - @keyframes spin { to { transform: rotate(360deg); diff --git a/frontend/app/components/common/Toast.tsx b/frontend/app/components/common/Toast.tsx deleted file mode 100644 index f200567..0000000 --- a/frontend/app/components/common/Toast.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import Icon from "./Icon"; - -type ToastState = { - tone: "success" | "error" | "info"; - message: string; -}; - -type ToastProps = { - toast: ToastState | null; -}; - -const toneIconClass: Record = { - success: "bg-[#e6f7f0] text-[#177b55]", - error: "bg-[#fff0f0] text-[#b94a4a]", - info: "bg-[#eaf4fd] text-[#2675bf]", -}; - -export function Toast({ toast }: ToastProps) { - if (!toast) return null; - - return ( -
- - - - {toast.message} -
- ); -} diff --git a/frontend/app/components/ui/sonner.tsx b/frontend/app/components/ui/sonner.tsx new file mode 100644 index 0000000..1919f52 --- /dev/null +++ b/frontend/app/components/ui/sonner.tsx @@ -0,0 +1,44 @@ +import { Toaster as Sonner, type ToasterProps } from "sonner" +import { CircleCheckIcon, InfoIcon, TriangleAlertIcon, OctagonXIcon, Loader2Icon } from "lucide-react" + +const Toaster = ({ ...props }: ToasterProps) => { + return ( + + ), + info: ( + + ), + warning: ( + + ), + error: ( + + ), + loading: ( + + ), + }} + style={ + { + "--normal-bg": "var(--popover)", + "--normal-text": "var(--popover-foreground)", + "--normal-border": "var(--border)", + "--border-radius": "var(--radius)", + } as React.CSSProperties + } + toastOptions={{ + classNames: { + toast: "cn-toast", + }, + }} + {...props} + /> + ) +} + +export { Toaster } diff --git a/frontend/app/components/ui/toast.tsx b/frontend/app/components/ui/toast.tsx deleted file mode 100644 index a294f83..0000000 --- a/frontend/app/components/ui/toast.tsx +++ /dev/null @@ -1,232 +0,0 @@ -import * as React from "react" -import { Toast as ToastPrimitive } from "@base-ui/react/toast" - -import { cn } from "~/lib/utils" -import { Button } from "~/components/ui/button" -import { XIcon, CircleCheckIcon, InfoIcon, TriangleAlertIcon, OctagonXIcon, Loader2Icon } from "lucide-react" - -const toast = ToastPrimitive.createToastManager() - -function ToastProvider({ ...props }: ToastPrimitive.Provider.Props) { - return -} - -function ToastPortal({ ...props }: ToastPrimitive.Portal.Props) { - return -} - -function ToastViewport({ className, ...props }: ToastPrimitive.Viewport.Props) { - return ( - - ) -} - -function Toast({ className, ...props }: ToastPrimitive.Root.Props) { - return ( - - ) -} - -function ToastContent({ className, ...props }: ToastPrimitive.Content.Props) { - return ( - - ) -} - -function ToastTitle({ className, ...props }: ToastPrimitive.Title.Props) { - return ( - - ) -} - -function ToastDescription({ - className, - ...props -}: ToastPrimitive.Description.Props) { - return ( - - ) -} - -function ToastAction({ - className, - render =