@@ -11,6 +11,7 @@ import type {
1111 DevtoolsErrorType ,
1212 DevtoolsPosition ,
1313 QueryDevtoolsProps ,
14+ Theme ,
1415} from './contexts'
1516import type { Signal } from 'solid-js'
1617
@@ -33,6 +34,7 @@ class TanstackQueryDevtools {
3334 #errorTypes: Signal < Array < DevtoolsErrorType > | undefined >
3435 #hideDisabledQueries: Signal < boolean | undefined >
3536 #Component: DevtoolsComponentType | undefined
37+ #theme: Signal < Theme | undefined >
3638 #dispose?: ( ) => void
3739
3840 constructor ( config : TanstackQueryDevtoolsConfig ) {
@@ -48,6 +50,7 @@ class TanstackQueryDevtools {
4850 styleNonce,
4951 shadowDOMTarget,
5052 hideDisabledQueries,
53+ theme,
5154 } = config
5255 this . #client = createSignal ( client )
5356 this . #queryFlavor = queryFlavor
@@ -60,6 +63,7 @@ class TanstackQueryDevtools {
6063 this . #initialIsOpen = createSignal ( initialIsOpen )
6164 this . #errorTypes = createSignal ( errorTypes )
6265 this . #hideDisabledQueries = createSignal ( hideDisabledQueries )
66+ this . #theme = createSignal ( theme )
6367 }
6468
6569 setButtonPosition ( position : DevtoolsButtonPosition ) {
@@ -82,6 +86,10 @@ class TanstackQueryDevtools {
8286 this . #client[ 1 ] ( client )
8387 }
8488
89+ setTheme ( theme ?: Theme ) {
90+ this . #theme[ 1 ] ( theme )
91+ }
92+
8593 mount < T extends HTMLElement > ( el : T ) {
8694 if ( this . #isMounted) {
8795 throw new Error ( 'Devtools is already mounted' )
@@ -93,6 +101,7 @@ class TanstackQueryDevtools {
93101 const [ errors ] = this . #errorTypes
94102 const [ hideDisabledQueries ] = this . #hideDisabledQueries
95103 const [ queryClient ] = this . #client
104+ const [ theme ] = this . #theme
96105 let Devtools : DevtoolsComponentType
97106
98107 if ( this . #Component) {
@@ -128,6 +137,9 @@ class TanstackQueryDevtools {
128137 get hideDisabledQueries ( ) {
129138 return hideDisabledQueries ( )
130139 } ,
140+ get theme ( ) {
141+ return theme ( )
142+ } ,
131143 } }
132144 />
133145 )
0 commit comments