ci: added commit lint, build check, test and release (#31)
* ci: added commit lint, build check, test and release * refactor: fix compilation errors * ci: add checkout to the tests * test: resolved issues with running tests * chore: addressed PR comments * chore: renamed package-name in release-please
This commit is contained in:
@@ -50,16 +50,16 @@ const Dashboard = (props: any) => {
|
||||
|
||||
if (theme) {
|
||||
toggleThemeMode(String(localStorage.getItem('theme')))
|
||||
} else if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
||||
} else if (window?.matchMedia('(prefers-color-scheme: dark)')?.matches) {
|
||||
toggleThemeMode('dark')
|
||||
}
|
||||
|
||||
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', e => {
|
||||
toggleThemeMode(e.matches ? "dark" : "light")
|
||||
window?.matchMedia('(prefers-color-scheme: dark)')?.addEventListener('change', e => {
|
||||
toggleThemeMode(e?.matches ? "dark" : "light")
|
||||
});
|
||||
|
||||
return () => window.matchMedia('(prefers-color-scheme: dark)').removeEventListener('change', e => {
|
||||
toggleThemeMode(e.matches ? "dark" : "light")
|
||||
return () => window?.matchMedia('(prefers-color-scheme: dark)')?.removeEventListener('change', e => {
|
||||
toggleThemeMode(e?.matches ? "dark" : "light")
|
||||
})
|
||||
}, [])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user