File tree 2 files changed +31
-3
lines changed
2 files changed +31
-3
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,9 @@ import {
27
27
} from 'remix-themes' ;
28
28
import { themeSessionResolver } from './sessions.server' ;
29
29
30
+ // Store:
31
+ import { useDocsStore } from './store' ;
32
+
30
33
export const links : LinksFunction = ( ) => [
31
34
{ rel : 'stylesheet' , href : stylesheet } ,
32
35
] ;
@@ -50,6 +53,7 @@ export default function AppWithProviders() {
50
53
function App ( ) {
51
54
const data = useLoaderData < typeof loader > ( ) ;
52
55
const [ theme ] = useTheme ( ) ;
56
+ const { toastPosition } = useDocsStore ( ) ;
53
57
return (
54
58
< html lang = "en" className = { cn ( theme ) } >
55
59
< head >
@@ -67,11 +71,15 @@ function App() {
67
71
) }
68
72
>
69
73
< Header />
70
- < ToastProvider position = "bottom-right" theme = { theme ! } >
71
- < div className = "container mx-auto max-w-7xl" >
74
+ < ToastProvider
75
+ position = { toastPosition }
76
+ theme = { theme ! }
77
+ toastFont = "font-sans"
78
+ >
79
+ < div className = "container w-full max-w-7xl" >
72
80
< SidebarContent />
73
81
< article
74
- className = { cn ( 'ml-60 w-full max-w-4xl py-8' , proseClasses ) }
82
+ className = { cn ( 'ml-64 max-w-4xl py-8 duration-100 ' , proseClasses ) }
75
83
>
76
84
< Outlet />
77
85
</ article >
Original file line number Diff line number Diff line change
1
+ import type { Position , Theme , Variant } from '@pheralb/toast' ;
2
+ import { create } from 'zustand' ;
3
+
4
+ interface DocsStore {
5
+ toastPosition : Position ;
6
+ toastVariant : Variant ;
7
+ toastTheme : Theme ;
8
+ setToastPosition : ( position : Position ) => void ;
9
+ setToastVariant : ( variant : Variant ) => void ;
10
+ setToastTheme : ( theme : Theme ) => void ;
11
+ }
12
+
13
+ export const useDocsStore = create < DocsStore > ( ( set ) => ( {
14
+ toastPosition : 'bottom-right' ,
15
+ toastVariant : 'success' ,
16
+ toastTheme : 'light' ,
17
+ setToastPosition : ( position ) => set ( { toastPosition : position } ) ,
18
+ setToastVariant : ( variant ) => set ( { toastVariant : variant } ) ,
19
+ setToastTheme : ( theme ) => set ( { toastTheme : theme } ) ,
20
+ } ) ) ;
You can’t perform that action at this time.
0 commit comments