MSP-3074 ThemeProvider change to ConfigProvider
This commit is contained in:
1 parent
7ac446d783
commit
c598e0dde8
11 files changed
+34
-30
No files matched your search
@@ -1,22 +1,22 @@
|
||||
import {useContext} from "react";
|
||||
import {ThemeAppearance, useTheme} from "antd-style";
|
||||
import {Segmented} from "antd";
|
||||
import {Segmented, theme} from "antd";
|
||||
import {Context} from "../../store";
|
||||
import {darkTheme, lightTheme} from "../../constants/theme.ts";
|
||||
import './header.scss'
|
||||
|
||||
|
||||
const options = [
|
||||
{label: 'Light', value: 'light'},
|
||||
{label: 'Light', value: 'light' },
|
||||
{label: 'Dark', value: 'dark'},
|
||||
];
|
||||
|
||||
function Header() {
|
||||
const theme = useTheme();
|
||||
const {setTheme} = useContext(Context)
|
||||
const { useToken } = theme;
|
||||
const { token } = useToken();
|
||||
|
||||
return <header className='header' style={{
|
||||
background: theme.colorBgLayout
|
||||
}}><Segmented onChange={(v) => setTheme(v as ThemeAppearance)} options={options}/></header>;
|
||||
backgroundColor: token.colorBgLayout
|
||||
}}><Segmented onChange={(v) => setTheme(v === 'light' ? lightTheme : darkTheme)} options={options}/></header>;
|
||||
}
|
||||
|
||||
export default Header;
|
||||
Reference in new issue
Block a user