Skip to content

Commit

Permalink
better toast
Browse files Browse the repository at this point in the history
  • Loading branch information
nichtsam committed May 11, 2024
1 parent 174f010 commit 8de1231
Show file tree
Hide file tree
Showing 13 changed files with 226 additions and 364 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ FROM base as deps
WORKDIR /app

COPY package.json pnpm-lock.yaml ./
COPY patches ./patches
RUN pnpm install

FROM deps as prod-deps
Expand Down
29 changes: 29 additions & 0 deletions app/components/ui/sonner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { useTheme } from "next-themes";
import { Toaster as Sonner } from "sonner";

type ToasterProps = React.ComponentProps<typeof Sonner>;

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

return (
<Sonner
theme={theme as ToasterProps["theme"]}
className="toaster group"
toastOptions={{
classNames: {
toast:
"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
description: "group-[.toast]:text-muted-foreground",
actionButton:
"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
cancelButton:
"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",
},
}}
{...props}
/>
);
};

export { Toaster };
127 changes: 0 additions & 127 deletions app/components/ui/toast.tsx

This file was deleted.

33 changes: 0 additions & 33 deletions app/components/ui/toaster.tsx

This file was deleted.

192 changes: 0 additions & 192 deletions app/components/ui/use-toast.ts

This file was deleted.

Loading

0 comments on commit 8de1231

Please sign in to comment.