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