Commit d1308e4a authored by afc163's avatar afc163

refactor code

parent 4037a8f1
...@@ -84,17 +84,10 @@ class SettingDrawer extends PureComponent { ...@@ -84,17 +84,10 @@ 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.grid = 'Fluid';
}
}
if (key === 'fixedHeader') {
if (!value) {
nextState.autoHideHeader = false; nextState.autoHideHeader = false;
} }
}
this.setState(nextState, () => { this.setState(nextState, () => {
const { dispatch } = this.props; const { dispatch } = this.props;
dispatch({ dispatch({
...@@ -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
type="setting"
style={{
color: '#FFF',
fontSize: 20,
}}
/>
) : (
<Icon <Icon
type="close" type={collapse ? 'close' : 'setting'}
style={{ style={{
color: '#FFF', color: '#fff',
fontSize: 20, 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