Files
wewechat-plus-plus/src/js/pages/Settings/index.js
梵高先生 96143fd0b9 fix
2022-11-19 03:41:45 +08:00

193 lines
8.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import React, { Component } from 'react';
import { inject, observer } from 'mobx-react';
import classes from './style.css';
import Switch from 'components/Switch';
import Avatar from 'components/Avatar';
import helper from 'utils/helper';
@inject(stores => ({
alwaysOnTop: stores.settings.alwaysOnTop,
setAlwaysOnTop: stores.settings.setAlwaysOnTop,
showOnTray: stores.settings.showOnTray,
setShowOnTray: stores.settings.setShowOnTray,
showNotification: stores.settings.showNotification,
setShowNotification: stores.settings.setShowNotification,
startup: stores.settings.startup,
setStartup: stores.settings.setStartup,
downloads: stores.settings.downloads,
setDownloads: stores.settings.setDownloads,
confirmImagePaste: stores.settings.confirmImagePaste,
setConfirmImagePaste: stores.settings.setConfirmImagePaste,
blockRecall: stores.settings.blockRecall,
setBlockRecall: stores.settings.setBlockRecall,
rememberConversation: stores.settings.rememberConversation,
setRememberConversation: stores.settings.setRememberConversation,
showRedIcon: stores.settings.showRedIcon,
setShowRedIcon: stores.settings.setShowRedIcon,
user: stores.session.user,
logout: stores.session.logout,
}))
@observer
export default class Settings extends Component {
choiceDownloadDir() {
this.refs.downloads.click();
}
componentDidMount() {
this.refs.downloads.webkitdirectory = true;
}
render() {
var {
alwaysOnTop,
setAlwaysOnTop,
showOnTray,
setShowOnTray,
showNotification,
setShowNotification,
startup,
setStartup,
downloads,
setDownloads,
confirmImagePaste,
setConfirmImagePaste,
blockRecall,
setBlockRecall,
rememberConversation,
setRememberConversation,
showRedIcon,
setShowRedIcon,
user,
} = this.props;
return (
<div className={classes.container}>
<div className={classes.column}>
<h2>设置</h2>
<ul>
{
user && (
<li className={classes.user}>
<Avatar src={this.props.user.User.HeadImgUrl} />
<button onClick={e => this.props.logout()}>登出</button>
</li>
)
}
<li className={classes.downloads}>
<div>
<input
onChange={e => setDownloads(e.target.files[0])}
ref="downloads"
type="file" />
<p>下载目录</p>
<p onClick={e => this.choiceDownloadDir()}>{downloads}</p>
</div>
<button onClick={e => this.choiceDownloadDir()}>更改</button>
</li>
<li>
<label htmlFor="alwaysOnTop">
<span>窗口置顶</span>
<Switch
checked={alwaysOnTop}
id="alwaysOnTop"
onChange={e => setAlwaysOnTop(e.target.checked)} />
</label>
</li>
<li>
<label htmlFor="showOnTray">
<span>显示托盘图标</span>
<Switch
checked={showOnTray}
disabled={!helper.isOsx}
id="showOnTray"
onChange={e => setShowOnTray(e.target.checked)} />
</label>
</li>
<li>
<label htmlFor="showNotification">
<span>发送桌面通知</span>
<Switch
checked={showNotification}
id="showNotification"
onChange={e => setShowNotification(e.target.checked)} />
</label>
</li>
<li>
<label htmlFor="blockRecall">
<span>反撤回功能</span>
<Switch
checked={blockRecall}
id="blockRecall"
onChange={e => setBlockRecall(e.target.checked)} />
</label>
</li>
<li>
<label htmlFor="rememberConversation">
<span>记住上次的聊天内容</span>
<Switch
checked={rememberConversation}
disabled={true}
id="rememberConversation"
onChange={e => setRememberConversation(e.target.checked)} />
</label>
</li>
<li>
<label htmlFor="showRedIcon">
<span>显示首页红色加号按钮</span>
<Switch
checked={showRedIcon}
id="showRedIcon"
onChange={e => setShowRedIcon(e.target.checked)} />
</label>
</li>
<li>
<label htmlFor="confirmImagePaste">
<span>在粘贴图片时弹框确认</span>
<Switch
checked={confirmImagePaste}
id="confirmImagePaste"
onChange={e => setConfirmImagePaste(e.target.checked)} />
</label>
</li>
<li>
<label htmlFor="startup">
<span>开机自启动</span>
<Switch
checked={startup}
id="startup"
onChange={e => setStartup(e.target.checked)} />
</label>
</li>
</ul>
</div>
<div className={classes.column}>
<h2>更新记录:</h2>
<p>
v1.2.5 修复翻译;纠正反馈邮箱;禁用记住上次聊天内容此功能等待修复<br />
v1.2.4 更多的翻译;为darkmode添加过渡动画;删去不必要的代码去除自动检查更新;修改托盘图标让其更加明显<br />
v1.2.3 增添darkmode调整优化界面颜色以适应darkmode<br />
v1.2.2 添加单例运行在后台时在启动器中启动会拉到前台而不是再启动一个wewechat更多的汉化<br />
v1.2.1 汉化<br />
v1.2.0 Make weweChat great again!!! Fix uos support<br />
<hr />
<strong>Riceneeder: 本人不会React且较为业余此项目除重大bug外不再更新有能力者可提PR或联系星火的shenmo参与项目</strong>
</p>
</div>
</div>
);
}
}