Commit d1308e4a authored by afc163's avatar afc163

refactor code

parent 4037a8f1
...@@ -84,16 +84,9 @@ class SettingDrawer extends PureComponent { ...@@ -84,16 +84,9 @@ class SettingDrawer extends PureComponent {
const nextState = { ...setting }; const nextState = { ...setting };
nextState[key] = value; nextState[key] = value;
if (key === 'layout') { if (key === 'layout') {
if (value === 'topmenu') { nextState.grid = value === 'topmenu' ? 'Wide' : 'Fluid';
nextState.grid = 'Wide'; } else if (key === 'fixedHeader' && !value) {
} else { nextState.autoHideHeader = false;
nextState.grid = 'Fluid';
}
}
if (key === 'fixedHeader') {
if (!value) {
nextState.autoHideHeader = false;
}
} }
this.setState(nextState, () => { this.setState(nextState, () => {
const { dispatch } = this.props; const { dispatch } = this.props;
...@@ -120,23 +113,13 @@ class SettingDrawer extends PureComponent { ...@@ -120,23 +113,13 @@ class SettingDrawer extends PureComponent {
placement="right" placement="right"
handler={ handler={
<div className={styles.handle}> <div className={styles.handle}>
{!collapse ? ( <Icon
<Icon type={collapse ? 'close' : 'setting'}
type="setting" style={{
style={{ color: '#fff',
color: '#FFF', fontSize: 20,
fontSize: 20, }}
}} />
/>
) : (
<Icon
type="close"
style={{
color: '#FFF',
fontSize: 20,
}}
/>
)}
</div> </div>
} }
onHandleClick={this.togglerContent} onHandleClick={this.togglerContent}
......
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