Commit d1308e4a authored by afc163's avatar afc163

refactor code

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