Change theme

This commit is contained in:
MD. Ariful Alam
2021-08-21 15:27:39 +06:00
parent 0229b5e453
commit e6935a32b9
13 changed files with 2563 additions and 109 deletions

View File

@@ -0,0 +1,10 @@
import config from "../config";
export const getThemeValue = () => {
if (localStorage.hasOwnProperty('theme')) {
let theme = localStorage.getItem('theme');
return theme;
}
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : config.defaultTheme;
}