chore: init mask theme
This commit is contained in:
@@ -37,6 +37,15 @@ const DarkModeMask = () => {
|
|||||||
const maskRef = useRef<HTMLDivElement>(null);
|
const maskRef = useRef<HTMLDivElement>(null);
|
||||||
const timerRef = useRef<any>(null);
|
const timerRef = useRef<any>(null);
|
||||||
|
|
||||||
|
const initTheme = () => {
|
||||||
|
const html = document.querySelector('html');
|
||||||
|
if (html) {
|
||||||
|
html.setAttribute('data-theme', savedTheme);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
initTheme();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (savedTheme === 'realDark') {
|
if (savedTheme === 'realDark') {
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
|
|||||||
@@ -431,7 +431,7 @@ export default (props: any) => {
|
|||||||
...themeData
|
...themeData
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<DarkMask theme={userSettings.theme}></DarkMask>
|
<DarkMask></DarkMask>
|
||||||
<ProLayout
|
<ProLayout
|
||||||
route={route}
|
route={route}
|
||||||
location={location}
|
location={location}
|
||||||
|
|||||||
Reference in New Issue
Block a user