Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

theme.tsx

33 lines738 Bytes

1'use client'
2import * as React from 'react'
3​
4export const defaultTheme = {
5 background: '#0b1521',
6 backgroundAlt: '#132337',
7 foreground: 'white',
8 gray: '#3f4e60',
9 grayAlt: '#222e3e',
10 inputBackgroundColor: '#fff',
11 inputTextColor: '#000',
12 success: '#00ab52',
13 danger: '#ff0085',
14 active: '#006bff',
15 paused: '#8c49eb',
16 warning: '#ffb200',
17} as const
18​
19export type Theme = typeof defaultTheme
20interface ProviderProps {
21 theme: Theme
22 children?: React.ReactNode
24​
25const ThemeContext = React.createContext(defaultTheme)
26​
27export function ThemeProvider({ theme, ...rest }: ProviderProps) {
28 return <ThemeContext.Provider value={theme} {...rest} />
30​
31export function useTheme() {
32 return React.useContext(ThemeContext)