fix(style): dark css vars
This commit is contained in:
@@ -463,6 +463,7 @@ const InstanceItem: React.FC<InstanceItemProps> = ({
|
||||
return (
|
||||
<div>
|
||||
<SimpleTabel
|
||||
rowKey="worker_name"
|
||||
columns={distributeCols}
|
||||
dataSource={[...mainWorker, ...list]}
|
||||
></SimpleTabel>
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
import useUserSettings from '@/hooks/use-user-settings';
|
||||
import { MoonOutlined, SunOutlined } from '@ant-design/icons';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Radio } from 'antd';
|
||||
import React from 'react';
|
||||
|
||||
const ThemeOptions = [
|
||||
{
|
||||
key: 'realDark',
|
||||
label: 'common.appearance.dark',
|
||||
icon: <MoonOutlined />
|
||||
},
|
||||
{
|
||||
key: 'light',
|
||||
label: 'common.appearance.light',
|
||||
icon: <SunOutlined />
|
||||
}
|
||||
];
|
||||
const Appearance: React.FC = () => {
|
||||
const { setTheme } = useUserSettings();
|
||||
const intl = useIntl();
|
||||
|
||||
const handleOnChange = (e: any) => {
|
||||
setTheme(e.target.value);
|
||||
};
|
||||
return (
|
||||
<Radio.Group onChange={handleOnChange} style={{ marginTop: 16 }}>
|
||||
{ThemeOptions.map((item) => (
|
||||
<Radio key={item.key} value={item.key}>
|
||||
{intl.formatMessage({ id: item.label })}
|
||||
</Radio>
|
||||
))}
|
||||
</Radio.Group>
|
||||
);
|
||||
};
|
||||
|
||||
Appearance.displayName = 'Appearance';
|
||||
|
||||
export default Appearance;
|
||||
@@ -4,7 +4,7 @@ import { useIntl } from '@umijs/max';
|
||||
import { TabsProps } from 'antd';
|
||||
import React, { useCallback, useState } from 'react';
|
||||
import styled from 'styled-components';
|
||||
import CustomUI from './components/custom-ui';
|
||||
import Appearance from './components/appearance';
|
||||
import ModifyPasswordn from './components/modify-password';
|
||||
|
||||
const Wrapper = styled.div`
|
||||
@@ -27,9 +27,9 @@ const Profile: React.FC = () => {
|
||||
children: <ModifyPasswordn />
|
||||
},
|
||||
{
|
||||
key: 'custom-ui',
|
||||
label: 'Custom UI',
|
||||
children: <CustomUI />
|
||||
key: 'appearance',
|
||||
label: intl.formatMessage({ id: 'common.appearance' }),
|
||||
children: <Appearance />
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user