(cookieValue = '')
| 88 | } |
| 89 | |
| 90 | export function getComponentTheme(cookieValue = ''): ComponentColorTheme { |
| 91 | const { colorMode, lightTheme, darkTheme } = getCssTheme(cookieValue) |
| 92 | return { |
| 93 | // The cookie value is a primer/css color_mode. |
| 94 | // We need to convert that to a primer/react compatible version. |
| 95 | colorMode: cssColorModeToComponentColorMode[colorMode], |
| 96 | dayScheme: lightTheme, |
| 97 | nightScheme: darkTheme, |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | export function useTheme() { |
| 102 | const [theme, setTheme] = useState<ColorModeThemes>({ |
no test coverage detected