mirror of https://github.com/msgbyte/tailchat
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.7 KiB
TypeScript
55 lines
1.7 KiB
TypeScript
4 years ago
|
import { FullModalField } from '@/components/FullModal/Field';
|
||
3 years ago
|
import { LanguageSelect } from '@/components/LanguageSelect';
|
||
4 years ago
|
import { pluginColorScheme } from '@/plugin/common';
|
||
3 years ago
|
import { Select, Switch } from 'antd';
|
||
3 years ago
|
import React from 'react';
|
||
|
import { t, useColorScheme, useSingleUserSetting } from 'tailchat-shared';
|
||
4 years ago
|
|
||
|
export const SettingsSystem: React.FC = React.memo(() => {
|
||
4 years ago
|
const { colorScheme, setColorScheme } = useColorScheme();
|
||
3 years ago
|
const {
|
||
|
value: messageListVirtualization,
|
||
|
setValue: setMessageListVirtualization,
|
||
|
loading,
|
||
|
} = useSingleUserSetting('messageListVirtualization', false);
|
||
4 years ago
|
|
||
|
return (
|
||
|
<div>
|
||
3 years ago
|
<FullModalField title={t('系统语言')} content={<LanguageSelect />} />
|
||
4 years ago
|
|
||
4 years ago
|
<FullModalField
|
||
|
title={t('配色方案')}
|
||
|
content={
|
||
|
<Select
|
||
4 years ago
|
style={{ width: 280 }}
|
||
4 years ago
|
size="large"
|
||
|
value={colorScheme}
|
||
|
onChange={setColorScheme}
|
||
|
>
|
||
|
<Select.Option value="dark">{t('暗黑模式')}</Select.Option>
|
||
|
<Select.Option value="light">{t('亮色模式')}</Select.Option>
|
||
|
<Select.Option value="auto">{t('自动')}</Select.Option>
|
||
4 years ago
|
{pluginColorScheme.map((pcs, i) => (
|
||
|
<Select.Option key={pcs.name + i} value={pcs.name}>
|
||
|
{pcs.label}
|
||
|
</Select.Option>
|
||
|
))}
|
||
4 years ago
|
</Select>
|
||
|
}
|
||
|
/>
|
||
3 years ago
|
|
||
|
<FullModalField
|
||
|
title={t('聊天列表虚拟化') + ' (Beta)'}
|
||
|
content={
|
||
|
<Switch
|
||
|
disabled={loading}
|
||
|
checked={messageListVirtualization}
|
||
|
onChange={(checked) => setMessageListVirtualization(checked)}
|
||
|
/>
|
||
|
}
|
||
|
/>
|
||
4 years ago
|
</div>
|
||
|
);
|
||
|
});
|
||
|
SettingsSystem.displayName = 'SettingsSystem';
|