add prettier
This commit is contained in:
1 parent
6a9a45a4cc
commit
07fc6c0b6c
35 files changed
+530
-461
No files matched your search
@@ -2,5 +2,5 @@
|
||||
width: 100%;
|
||||
border: none;
|
||||
display: flex;
|
||||
justify-content: end
|
||||
justify-content: end;
|
||||
}
|
||||
@@ -1,22 +1,28 @@
|
||||
import {useContext} from 'react';
|
||||
import {Segmented, theme} from 'antd';
|
||||
import {Context} from '../../store';
|
||||
import {darkTheme, lightTheme} from '../../constants/theme.ts';
|
||||
import { Segmented, theme } from 'antd'
|
||||
import { useContext } from 'react'
|
||||
|
||||
import { darkTheme, lightTheme } from '../../constants/theme.ts'
|
||||
import { Context } from '../../store'
|
||||
import './header.scss'
|
||||
|
||||
const options = [
|
||||
{label: "Light", value: "light"},
|
||||
{label: "Dark", value: "dark"},
|
||||
];
|
||||
{ label: 'Light', value: 'light' },
|
||||
{ label: 'Dark', value: 'dark' }
|
||||
]
|
||||
|
||||
const Header = () => {
|
||||
const {setTheme} = useContext(Context)
|
||||
const {useToken} = theme;
|
||||
const {token} = useToken();
|
||||
const { setTheme } = useContext(Context)
|
||||
const { useToken } = theme
|
||||
const { token } = useToken()
|
||||
|
||||
return <header className="header" style={{backgroundColor: token.colorBgLayout}}>
|
||||
<Segmented onChange={(v) => setTheme(v === "light" ? lightTheme : darkTheme)} options={options}/>
|
||||
</header>;
|
||||
return (
|
||||
<header className="header" style={{ backgroundColor: token.colorBgLayout }}>
|
||||
<Segmented
|
||||
onChange={(v) => setTheme(v === 'light' ? lightTheme : darkTheme)}
|
||||
options={options}
|
||||
/>
|
||||
</header>
|
||||
)
|
||||
}
|
||||
|
||||
export default Header;
|
||||
export default Header
|
||||
Reference in new issue
Block a user