File tree Expand file tree Collapse file tree 3 files changed +6
-1
lines changed Expand file tree Collapse file tree 3 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ const ThemeProvider: FC<PropsWithChildren> = ({ children }) => {
40
40
// 在组件卸载时清理监听器
41
41
mediaQuery . removeEventListener ( 'change' , handler ) ;
42
42
} ;
43
+ // eslint-disable-next-line react-hooks/exhaustive-deps
43
44
} , [ ] ) ;
44
45
45
46
return (
Original file line number Diff line number Diff line change 1
1
import type { ButtonProps , TooltipProps } from 'antd' ;
2
2
import type { CSSProperties } from 'react' ;
3
3
4
- import ButtonIcon from '@/components/stateless/custom/ ButtonIcon' ;
4
+ import ButtonIcon from '@/components/ButtonIcon' ;
5
5
6
6
import { ThemeContext , icons } from './themeContext' ;
7
7
Original file line number Diff line number Diff line change @@ -37,3 +37,7 @@ export function toggleCssDarkMode(darkMode = false) {
37
37
htmlElementClassList . remove ( DARK_CLASS ) ;
38
38
}
39
39
}
40
+
41
+ export function useTheme ( ) {
42
+ return useContext ( ThemeContext ) ;
43
+ }
You can’t perform that action at this time.
0 commit comments