Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions src/devtools/devtools.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
Select,
ActiveQueryPanel,
} from './styledComponents'
import { ThemeProvider } from './theme'
import { ThemeProvider, defaultTheme as theme } from './theme'
import { getQueryStatusLabel, getQueryStatusColor } from './utils'
import Explorer from './Explorer'
import Logo from './Logo'
Expand Down Expand Up @@ -74,20 +74,6 @@ interface DevtoolsPanelOptions {

const isServer = typeof window === 'undefined'

const theme = {
background: '#0b1521',
backgroundAlt: '#132337',
foreground: 'white',
gray: '#3f4e60',
grayAlt: '#222e3e',
inputBackgroundColor: '#fff',
inputTextColor: '#000',
success: '#00ab52',
danger: '#ff0085',
active: '#006bff',
warning: '#ffb200',
}

export function ReactQueryDevtools({
initialIsOpen,
panelProps = {},
Expand Down
24 changes: 20 additions & 4 deletions src/devtools/theme.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
// @ts-nocheck

import React from 'react'

const ThemeContext = React.createContext()
export const defaultTheme = {
background: '#0b1521',
backgroundAlt: '#132337',
foreground: 'white',
gray: '#3f4e60',
grayAlt: '#222e3e',
inputBackgroundColor: '#fff',
inputTextColor: '#000',
success: '#00ab52',
danger: '#ff0085',
active: '#006bff',
warning: '#ffb200',
}

interface ProviderProps {
theme: typeof defaultTheme
}

const ThemeContext = React.createContext(defaultTheme)

export function ThemeProvider({ theme, ...rest }) {
export function ThemeProvider({ theme, ...rest }: ProviderProps) {
return <ThemeContext.Provider value={theme} {...rest} />
}

Expand Down