From 6f0a7e4b137e193e6cfaac6aa90f0c91ec6b139c Mon Sep 17 00:00:00 2001 From: David Lu Date: Sat, 4 Jun 2016 08:23:44 -0700 Subject: PLT-2981 Disabled Push Notifications section in Settings if disabled by admin (#3225) * Added push notifications disabled message to settings * Update user_settings_notifications.jsx --- .../user_settings/user_settings_notifications.jsx | 148 ++++++++++++--------- 1 file changed, 85 insertions(+), 63 deletions(-) (limited to 'webapp/components') diff --git a/webapp/components/user_settings/user_settings_notifications.jsx b/webapp/components/user_settings/user_settings_notifications.jsx index 410ce1a4e..6b07f59e2 100644 --- a/webapp/components/user_settings/user_settings_notifications.jsx +++ b/webapp/components/user_settings/user_settings_notifications.jsx @@ -263,71 +263,89 @@ class NotificationsTab extends React.Component { } let inputs = []; + let extraInfo = null; + let submit = null; - inputs.push( -
-
- -
-
-
- -
-
-
- + if (global.window.mm_config.SendPushNotifications === 'true') { + inputs.push( +
+
+ +
+
+
+ +
+
+
+ +
-
- ); + ); - const extraInfo = ( - - - - ); + extraInfo = ( + + + + ); + + submit = this.handleSubmit(); + } else { + inputs.push( +
+ +
+ ); + } return ( @@ -345,14 +363,21 @@ class NotificationsTab extends React.Component { } else if (this.state.notifyPushLevel === 'none') { describe = ( ); + } else if (global.window.mm_config.SendPushNotifications === 'false') { + describe = ( + + ); } else { describe = ( ); @@ -364,7 +389,7 @@ class NotificationsTab extends React.Component { return ( @@ -911,10 +936,7 @@ class NotificationsTab extends React.Component { ); } - let pushNotificationSection; - if (global.window.mm_config.SendPushNotifications === 'true') { - pushNotificationSection = this.createPushNotificationSection(); - } + const pushNotificationSection = this.createPushNotificationSection(); return (
-- cgit v1.2.3-1-g7c22