diff --git a/src/components/SettingDrawer/index.js b/src/components/SettingDrawer/index.js index 5d5eae0738722336c06ee132ecdd468cf695058b..10e989ed58ed0a7e3a1ea2c893206cdd04c468c7 100644 --- a/src/components/SettingDrawer/index.js +++ b/src/components/SettingDrawer/index.js @@ -84,16 +84,9 @@ 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.autoHideHeader = false; - } + nextState.grid = value === 'topmenu' ? 'Wide' : 'Fluid'; + } else if (key === 'fixedHeader' && !value) { + nextState.autoHideHeader = false; } this.setState(nextState, () => { const { dispatch } = this.props; @@ -120,23 +113,13 @@ class SettingDrawer extends PureComponent { placement="right" handler={