From aa754657a23971872390fefd93dfeb0ebaaf80ba Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Mon, 5 Mar 2018 20:53:01 +0100 Subject: [PATCH] Fix styling and toggle off issues --- .../client/components/Toggle.css | 3 +-- .../client/containers/Settings.js | 14 ++++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/plugins/talk-plugin-notifications/client/components/Toggle.css b/plugins/talk-plugin-notifications/client/components/Toggle.css index 6514a5db6..3f5b02705 100644 --- a/plugins/talk-plugin-notifications/client/components/Toggle.css +++ b/plugins/talk-plugin-notifications/client/components/Toggle.css @@ -1,6 +1,6 @@ .title { display: inline-block; - width: 270px; + width: 100%; cursor: pointer; user-select: none; @@ -16,6 +16,5 @@ } .checkBox { - width: 100%; text-align: right; } diff --git a/plugins/talk-plugin-notifications/client/containers/Settings.js b/plugins/talk-plugin-notifications/client/containers/Settings.js index 61a21f440..76a03462d 100644 --- a/plugins/talk-plugin-notifications/client/containers/Settings.js +++ b/plugins/talk-plugin-notifications/client/containers/Settings.js @@ -15,13 +15,15 @@ class SettingsContainer extends React.Component { }; indicateOn = plugin => - this.setState({ - hasNotifications: this.state.hasNotifications.concat(plugin), - }); + this.setState(state => ({ + hasNotifications: state.hasNotifications.concat(plugin), + })); + indicateOff = plugin => - this.setState({ - hasNotifications: this.state.hasNotifications.filter(i => i !== plugin), - }); + this.setState(state => ({ + hasNotifications: state.hasNotifications.filter(i => i !== plugin), + })); + setTurnOffInputFragment = fragment => this.setState(state => ({ turnOffInput: { ...state.turnOffInput, ...fragment },