site: solve display exception when use happy work theme in dark mode (#44720)

* site: solve display exception when use happly work theme in dark mode

* feat: remove log

* feat: optimize code
This commit is contained in:
kiner-tang(文辉) 2023-09-11 11:17:11 +08:00 committed by GitHub
parent 3e97fee28c
commit b9dfb1847d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,15 +39,17 @@ const RESPONSIVE_MOBILE = 768;
// }
const getAlgorithm = (themes: ThemeName[] = []) =>
themes.map((theme) => {
if (theme === 'dark') {
return antdTheme.darkAlgorithm;
}
if (theme === 'compact') {
return antdTheme.compactAlgorithm;
}
return antdTheme.defaultAlgorithm;
});
themes
.map((theme) => {
if (theme === 'dark') {
return antdTheme.darkAlgorithm;
}
if (theme === 'compact') {
return antdTheme.compactAlgorithm;
}
return null;
})
.filter((item) => item);
const GlobalLayout: React.FC = () => {
const outlet = useOutlet();