Commit 85e9fa71 authored by 陈帅's avatar 陈帅

Add copy setting button look #1751

parent 1595c7d3
import React, { PureComponent } from 'react';
import { Select, message, List, Switch, Divider, Icon } from 'antd';
import DrawerMenu from 'rc-drawer';
import { CopyToClipboard } from 'react-copy-to-clipboard';
import { connect } from 'dva';
import styles from './index.less';
import ThemeColor from './ThemeColor';
......@@ -145,11 +146,9 @@ class SettingDarwer extends PureComponent {
};
render() {
const {
setting: { collapse, silderTheme, themeColor, layout, colorWeak },
} = this.props;
const { setting } = this.props;
const { collapse, silderTheme, themeColor, layout, colorWeak } = setting;
return (
<div className={styles.settingDarwer}>
<DrawerMenu
parent={null}
level={null}
......@@ -185,6 +184,18 @@ class SettingDarwer extends PureComponent {
onMaskClick={this.togglerContent}
>
<div className={styles.content}>
<CopyToClipboard
text={JSON.stringify(setting)}
onCopy={() => message.success('copy success')}
>
<div className={styles.clipboard}>
<img
src="https://gw.alipayobjects.com/zos/rmsportal/YuWymXLusbplhCwgZwMT.svg"
alt="Copy To Clipboard"
width={18}
/>
</div>
</CopyToClipboard>
<Body title="整体风格设置">
<BlockChecbox
list={[
......@@ -246,7 +257,6 @@ class SettingDarwer extends PureComponent {
</Body>
</div>
</DrawerMenu>
</div>
);
}
}
......
......@@ -5,6 +5,15 @@
min-height: 100%;
padding: 24px;
background: #fff;
position: relative;
.clipboard {
position: absolute;
top: 10px;
right: 10px;
cursor: pointer;
width: 16px;
height: 16px;
}
}
.blockChecbox {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment