File tree 1 file changed +10
-3
lines changed
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -29,13 +29,18 @@ This page shows examples of how to use [`next-themes` (Next.js)](https://github.
29
29
30
30
' use client' ;
31
31
32
- import { ToastProvider , type ToastProviderProperties } from ' @pheralb/toast' ;
32
+ import {
33
+ ToastProvider ,
34
+ type ToastTheme ,
35
+ type ToastProviderProperties ,
36
+ } from ' @pheralb/toast' ;
37
+
33
38
import { useTheme } from ' next-themes' ;
34
39
35
40
const ToastClientProvider = (props : ToastProviderProperties ) => {
36
41
const { theme } = useTheme ();
37
42
return (
38
- <ToastProvider theme = { theme === ' dark ' ? ' dark ' : ' light ' } { ... props } >
43
+ <ToastProvider toastFont = " font-sans " theme = { theme as ToastTheme } { ... props } >
39
44
{ props .children }
40
45
</ToastProvider >
41
46
);
@@ -80,12 +85,14 @@ Import the `useTheme` hook from `remix-themes` and change the theme value:
80
85
``` tsx
81
86
// 📄 app/root.tsx
82
87
88
+ import clsx from ' clsx' ;
89
+ import { ToastProvider } from ' @pheralb/toast' ;
83
90
import { useTheme } from ' remix-themes' ;
84
91
85
92
function App() {
86
93
const [theme] = useTheme ();
87
94
return (
88
- <html lang = " en" className = { cn (theme )} >
95
+ <html lang = " en" className = { clsx (theme )} >
89
96
<head >
90
97
<meta charSet = " utf-8" />
91
98
<meta name = " viewport" content = " width=device-width, initial-scale=1" />
You can’t perform that action at this time.
0 commit comments