MSP-3074 add antd theme
This commit is contained in:
1 parent
9f7fa17af1
commit
5f73d33a58
6 files changed
+984
-49
No files matched your search
+16
-1
@@ -2,16 +2,31 @@ import { Route, Routes } from 'react-router-dom';
|
||||
import HomePages from '../pages/HomePage/HomePages.tsx';
|
||||
import './app.scss'
|
||||
|
||||
function App() {
|
||||
import { useState } from 'react';
|
||||
import { Segmented } from 'antd';
|
||||
import { ThemeAppearance, ThemeProvider } from 'antd-style';
|
||||
|
||||
|
||||
|
||||
const options = [
|
||||
{ label: 'Light', value: 'light' },
|
||||
{ label: 'Dark', value: 'dark' },
|
||||
];
|
||||
|
||||
function App() {
|
||||
const [appearance, setTheme] = useState<ThemeAppearance>('light');
|
||||
return (
|
||||
<div className="app">
|
||||
<Segmented onChange={(v) => setTheme(v as ThemeAppearance)} options={options} />
|
||||
<ThemeProvider appearance={appearance} >
|
||||
<Routes>
|
||||
<Route path="/" element={<HomePages/>}/>
|
||||
</Routes>
|
||||
</ThemeProvider>
|
||||
</div>
|
||||
|
||||
)
|
||||
}
|
||||
|
||||
export default App
|
||||
|
||||
Reference in new issue
Block a user