mirror of https://github.com/longtai-cn/hippo4j
parent
4320aac82f
commit
44162399da
@ -1,19 +1,22 @@
|
||||
.container {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background-color: #eee;
|
||||
color: #fff;
|
||||
.header {
|
||||
height: 48px;
|
||||
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.01), 0 3px 6px 3px rgba(0, 0, 0, 0.01), 0 2px 6px 0 rgba(0, 0, 0, 0.03);
|
||||
}
|
||||
.sider {
|
||||
// display: flex;
|
||||
height: calc(100vh - 48px);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
// flex-direction: column;
|
||||
// justify-content: center;
|
||||
padding-top: 24px;
|
||||
}
|
||||
.content {
|
||||
margin: 24px;
|
||||
margin: 10px 10px 0px;
|
||||
border-radius: 12px 12px 0 0;
|
||||
padding: 16px 24px;
|
||||
height: 100%;
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,16 @@
|
||||
import { useContext, useEffect } from 'react';
|
||||
import { useLocalStorageState } from 'ahooks';
|
||||
import { MyThemeContext, THEME_NAME } from '@/context/themeContext';
|
||||
|
||||
const useThemeMode = () => {
|
||||
const [isDark, setIsDark] = useLocalStorageState<boolean>('current-mode', { defaultValue: false });
|
||||
const { setThemeName } = useContext<any>(MyThemeContext);
|
||||
|
||||
useEffect(() => {
|
||||
isDark ? setThemeName(THEME_NAME.DARK) : setThemeName(THEME_NAME.DEFAULT);
|
||||
}, [isDark, setThemeName]);
|
||||
|
||||
return [setIsDark];
|
||||
};
|
||||
|
||||
export default useThemeMode;
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue