Skip to content

Commit

Permalink
site: solve display exception when use happy work theme in dark mode (a…
Browse files Browse the repository at this point in the history
…nt-design#44720)

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

* feat: remove log

* feat: optimize code
  • Loading branch information
kiner-tang authored Sep 11, 2023
1 parent 3e97fee commit b9dfb18
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions .dumi/theme/layouts/GlobalLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit b9dfb18

Please sign in to comment.