From 35ee9c9ddd3e6e07c7c8b065aa4182f68ab3780a Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Thu, 26 Nov 2015 15:10:49 +0000 Subject: [PATCH] Move and merge EnableNotificationsButton to react SDK --- src/skins/vector/skindex.js | 2 +- .../views/atoms/EnableNotificationsButton.js | 38 ------------------- .../vector/views/organisms/UserSettings.js | 2 +- 3 files changed, 2 insertions(+), 40 deletions(-) delete mode 100644 src/skins/vector/views/atoms/EnableNotificationsButton.js diff --git a/src/skins/vector/skindex.js b/src/skins/vector/skindex.js index ed409c04..41ee39e1 100644 --- a/src/skins/vector/skindex.js +++ b/src/skins/vector/skindex.js @@ -31,10 +31,10 @@ skin['messages.MessageTimestamp'] = require('../../components/views/messages/Mes // TODO: Fix this so matrix-react-sdk stuff is in react SDK skindex? skin['avatars.RoomAvatar'] = require('matrix-react-sdk/lib/components/views/avatars/RoomAvatar'); skin['avatars.MemberAvatar'] = require('matrix-react-sdk/lib/components/views/avatars/MemberAvatar'); +skin['settings.EnableNotificationsButton'] = require('matrix-react-sdk/lib/components/views/settings/EnableNotificationsButton'); // Old style stuff skin['atoms.EditableText'] = require('./views/atoms/EditableText'); -skin['atoms.EnableNotificationsButton'] = require('./views/atoms/EnableNotificationsButton'); skin['atoms.create_room.CreateRoomButton'] = require('./views/atoms/create_room/CreateRoomButton'); skin['atoms.create_room.Presets'] = require('./views/atoms/create_room/Presets'); skin['atoms.create_room.RoomAlias'] = require('./views/atoms/create_room/RoomAlias'); diff --git a/src/skins/vector/views/atoms/EnableNotificationsButton.js b/src/skins/vector/views/atoms/EnableNotificationsButton.js deleted file mode 100644 index edef9edc..00000000 --- a/src/skins/vector/views/atoms/EnableNotificationsButton.js +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright 2015 OpenMarket Ltd - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -'use strict'; - -var React = require('react'); - -var EnableNotificationsButtonController = require('matrix-react-sdk/lib/controllers/atoms/EnableNotificationsButton') - -module.exports = React.createClass({ - displayName: 'EnableNotificationsButton', - mixins: [EnableNotificationsButtonController], - - render: function() { - if (this.enabled()) { - return ( - - ); - } else { - return ( - - ); - } - } -}); diff --git a/src/skins/vector/views/organisms/UserSettings.js b/src/skins/vector/views/organisms/UserSettings.js index 2cb4244d..f2ce3b84 100644 --- a/src/skins/vector/views/organisms/UserSettings.js +++ b/src/skins/vector/views/organisms/UserSettings.js @@ -72,7 +72,7 @@ module.exports = React.createClass({ return case this.Phases.Display: var ChangeDisplayName = sdk.getComponent('molecules.ChangeDisplayName'); - var EnableNotificationsButton = sdk.getComponent('atoms.EnableNotificationsButton'); + var EnableNotificationsButton = sdk.getComponent('settings.EnableNotificationsButton'); return (