()
| 86 | } |
| 87 | |
| 88 | export function currentDocumentTheme(): DocumentTheme | null { |
| 89 | if (document.documentElement.classList.contains('dark-mode')) |
| 90 | return 'dark-mode'; |
| 91 | if (document.documentElement.classList.contains('light-mode')) |
| 92 | return 'light-mode'; |
| 93 | return null; |
| 94 | } |
| 95 | |
| 96 | export function useThemeSetting(): [Theme, (value: Theme) => void] { |
| 97 | const [theme, setTheme] = React.useState<Theme>(currentTheme()); |
no test coverage detected
searching dependent graphs…