import React, { memo } from 'react'; import { Row, Col } from '@miragenflow/ui/grid'; import { Switch } from '@miragenflow/ui'; import { useAppDispatch, useAppSelector } from 'modules/store'; import { selectGlobal, toggleShowHeader, toggleShowBreadcrumbs, toggleShowFooter, switchTheme, switchColor, switchLayout, openSystemTheme, ELayout, } from 'modules/global'; import { ETheme } from 'types/index.d'; import RadioColor from './RadioColor'; import RadioRect from './RadioRect'; import Light from 'assets/svg/assets-setting-light.svg?component'; import Dark from 'assets/svg/assets-setting-dark.svg?component'; import System from 'assets/svg/assets-setting-auto.svg?component'; import Style from './index.module.less'; enum ESettingTheme { system, } const themeList = [ { value: ETheme.light, image: , name: '明亮', }, { value: ETheme.dark, image: , name: '黑暗', }, { value: ESettingTheme.system, image: , name: '跟随系统', }, ]; const layoutList = [ { value: ELayout.side, image:
侧
, }, { value: ELayout.top, image:
顶
, }, { value: ELayout.mix, image:
混
, }, ]; export default memo(() => { const dispatch = useAppDispatch(); const globalState = useAppSelector(selectGlobal); const handleThemeSwitch = (value: any) => { if (value === ESettingTheme.system) { dispatch(openSystemTheme()); } else { dispatch(switchTheme(value)); dispatch(switchColor(globalState.color)); } }; return (
主题模式
主题色
dispatch(switchColor(value))} />
导航布局
dispatch(switchLayout(value))} options={layoutList} ariaLabel='导航布局' />
元素开关
显示顶部栏
dispatch(toggleShowHeader())} />
显示面包屑导航
dispatch(toggleShowBreadcrumbs())} />
显示页脚
dispatch(toggleShowFooter())} />
); });