From d61aaf8f97572a9e434a3219cd8b91991b8b2361 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 1 Sep 2018 22:26:46 +0800 Subject: [PATCH] remove collapse from defaultSettings --- src/components/SettingDrawer/index.js | 11 ++++++++--- src/defaultSettings.js | 1 - 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/SettingDrawer/index.js b/src/components/SettingDrawer/index.js index 10e989ed..8eabe552 100644 --- a/src/components/SettingDrawer/index.js +++ b/src/components/SettingDrawer/index.js @@ -21,6 +21,10 @@ const Body = ({ children, title, style }) => ( @connect(({ setting }) => ({ setting })) class SettingDrawer extends PureComponent { + state = { + collapse: false, + }; + getLayOutSetting = () => { const { setting: { grid, fixedHeader, layout, autoHideHeader, fixSiderbar }, @@ -98,13 +102,14 @@ class SettingDrawer extends PureComponent { }; togglerContent = () => { - const { setting } = this.props; - this.changeSetting('collapse', !setting.collapse); + const { collapse } = this.state; + this.setState({ collapse: !collapse }); }; render() { const { setting } = this.props; - const { collapse, navTheme, primaryColor, layout, colorWeak } = setting; + const { navTheme, primaryColor, layout, colorWeak } = setting; + const { collapse } = this.state; return (