Brandon Presley
31f1528c35
The settings context was having a big performance impact on the app. We only truly need the theme + color to be a global context.
18 lines
345 B
TypeScript
18 lines
345 B
TypeScript
import {createContext, useContext} from 'react'
|
|
|
|
export const ThemeContext = createContext<{
|
|
theme: string
|
|
color: string
|
|
setTheme: (value: string) => void
|
|
setColor: (value: string) => void
|
|
}>({
|
|
theme: '',
|
|
color: '',
|
|
setTheme: () => null,
|
|
setColor: () => null,
|
|
})
|
|
|
|
export function useTheme() {
|
|
return useContext(ThemeContext)
|
|
}
|