Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Bit-Barron committed Oct 29, 2024
1 parent 18ed387 commit f3b8231
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 4 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.36.0",
"globals": "^15.0.0",
"mode-watcher": "^0.4.1",
"prettier": "^3.3.2",
"prettier-plugin-svelte": "^3.2.6",
"prettier-plugin-tailwindcss": "^0.6.5",
"svelte": "^5.0.0",
"svelte-check": "^4.0.0",
"svelte-sonner": "^0.3.28",
"tailwind-merge": "^2.5.4",
"tailwind-variants": "^0.2.1",
"tailwindcss": "^3.4.9",
Expand All @@ -41,7 +43,6 @@
"@prisma/client": "^5.21.1",
"lucia": "^3.2.2",
"lucide-svelte": "^0.454.0",
"mode-watcher": "^0.4.1",
"nodemailer": "^6.9.16",
"oslo": "^1.2.1",
"prisma": "^5.21.1",
Expand Down
18 changes: 15 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/lib/components/ui/sonner/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as Toaster } from "./sonner.svelte";
20 changes: 20 additions & 0 deletions src/lib/components/ui/sonner/sonner.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<script lang="ts">
import { Toaster as Sonner, type ToasterProps as SonnerProps } from "svelte-sonner";
import { mode } from "mode-watcher";
type $$Props = SonnerProps;
</script>

<Sonner
theme={$mode}
class="toaster group"
toastOptions={{
classes: {
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",
},
}}
{...$$restProps}
/>
2 changes: 2 additions & 0 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<script>
import '../app.css';
import { ModeWatcher } from 'mode-watcher';
import { Toaster } from '$lib/components/ui/sonner';
</script>

<ModeWatcher />

<Toaster />
<slot></slot>

0 comments on commit f3b8231

Please sign in to comment.