Skip to content

Commit

Permalink
fix: sonner types
Browse files Browse the repository at this point in the history
  • Loading branch information
zmh-program committed Jan 8, 2024
1 parent 57ed843 commit 3c8bcd6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/src/components/ui/sonner.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { useTheme } from "next-themes";
import { Toaster as Sonner } from "sonner";
import React from "react";

type ToasterProps = React.ComponentProps<typeof Sonner>;

const Toaster = ({ ...props }: ToasterProps) => {
const { theme = "system" } = useTheme();

return (
<Sonner
<Sonner //@ts-ignore
theme={theme as ToasterProps["theme"]}
className="toaster group"
toastOptions={{
Expand Down
2 changes: 2 additions & 0 deletions app/src/types/ui.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ declare module "sonner" {
description: string;
}

export const Toaster: React.FC;

export function toast(title: string, content?: ToastProps): void;
}

0 comments on commit 3c8bcd6

Please sign in to comment.