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

Add copy setting button look #1751

parent 1595c7d3
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import { Select, message, List, Switch, Divider, Icon } from 'antd'; import { Select, message, List, Switch, Divider, Icon } from 'antd';
import DrawerMenu from 'rc-drawer'; import DrawerMenu from 'rc-drawer';
import { CopyToClipboard } from 'react-copy-to-clipboard';
import { connect } from 'dva'; import { connect } from 'dva';
import styles from './index.less'; import styles from './index.less';
import ThemeColor from './ThemeColor'; import ThemeColor from './ThemeColor';
...@@ -145,11 +146,9 @@ class SettingDarwer extends PureComponent { ...@@ -145,11 +146,9 @@ class SettingDarwer extends PureComponent {
}; };
render() { render() {
const { const { setting } = this.props;
setting: { collapse, silderTheme, themeColor, layout, colorWeak }, const { collapse, silderTheme, themeColor, layout, colorWeak } = setting;
} = this.props;
return ( return (
<div className={styles.settingDarwer}>
<DrawerMenu <DrawerMenu
parent={null} parent={null}
level={null} level={null}
...@@ -185,6 +184,18 @@ class SettingDarwer extends PureComponent { ...@@ -185,6 +184,18 @@ class SettingDarwer extends PureComponent {
onMaskClick={this.togglerContent} onMaskClick={this.togglerContent}
> >
<div className={styles.content}> <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="整体风格设置"> <Body title="整体风格设置">
<BlockChecbox <BlockChecbox
list={[ list={[
...@@ -246,7 +257,6 @@ class SettingDarwer extends PureComponent { ...@@ -246,7 +257,6 @@ class SettingDarwer extends PureComponent {
</Body> </Body>
</div> </div>
</DrawerMenu> </DrawerMenu>
</div>
); );
} }
} }
......
...@@ -5,6 +5,15 @@ ...@@ -5,6 +5,15 @@
min-height: 100%; min-height: 100%;
padding: 24px; padding: 24px;
background: #fff; background: #fff;
position: relative;
.clipboard {
position: absolute;
top: 10px;
right: 10px;
cursor: pointer;
width: 16px;
height: 16px;
}
} }
.blockChecbox { .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