From dab707a8938dc442c7caacf544de7a613ec0db97 Mon Sep 17 00:00:00 2001 From: wmwragg Date: Wed, 27 Jul 2016 11:26:36 +0100 Subject: [PATCH] Additional refactor to further modularise the context menus --- .../views/context_menus/MessageContextMenu.js | 12 +++++----- .../NotificationStateContextMenu.js | 8 +++---- .../structures/ContextualMenu.css | 20 ++++++++++++---- .../context_menus/MessageContextMenu.css | 24 +++++++++++++++++++ .../NotificationStateContextMenu.css | 24 +++++++++++++++++++ 5 files changed, 74 insertions(+), 14 deletions(-) create mode 100644 src/skins/vector/css/vector-web/views/context_menus/MessageContextMenu.css create mode 100644 src/skins/vector/css/vector-web/views/context_menus/NotificationStateContextMenu.css diff --git a/src/components/views/context_menus/MessageContextMenu.js b/src/components/views/context_menus/MessageContextMenu.js index 91c59bd0..401c0c6c 100644 --- a/src/components/views/context_menus/MessageContextMenu.js +++ b/src/components/views/context_menus/MessageContextMenu.js @@ -95,7 +95,7 @@ module.exports = React.createClass({ if (eventStatus === 'not_sent') { resendButton = ( -
+
Resend
); @@ -103,7 +103,7 @@ module.exports = React.createClass({ if (!eventStatus) { // sent redactButton = ( -
+
Redact
); @@ -111,14 +111,14 @@ module.exports = React.createClass({ if (eventStatus === "queued" || eventStatus === "not_sent") { cancelButton = ( -
+
Cancel Sending
); } viewSourceButton = ( -
+
View Source
); @@ -126,7 +126,7 @@ module.exports = React.createClass({ if (this.props.eventTileOps) { if (this.props.eventTileOps.isWidgetHidden()) { unhidePreviewButton = ( -
+
Unhide Preview
) @@ -136,7 +136,7 @@ module.exports = React.createClass({ // XXX: this should be https://matrix.to. // XXX: if we use room ID, we should also include a server where the event can be found (other than in the domain of the event ID) permalinkButton = ( -
+ diff --git a/src/components/views/context_menus/NotificationStateContextMenu.js b/src/components/views/context_menus/NotificationStateContextMenu.js index 7859f810..1813e201 100644 --- a/src/components/views/context_menus/NotificationStateContextMenu.js +++ b/src/components/views/context_menus/NotificationStateContextMenu.js @@ -98,13 +98,13 @@ module.exports = React.createClass({ var cli = MatrixClientPeg.get(); var allNotifsClasses = classNames({ - 'mx_ContextualMenu_field': true, - 'mx_ContextualMenu_fieldSet': !this.state.areNotifsMuted, + 'mx_NotificationStateContextMenu_field': true, + 'mx_NotificationStateContextMenu_fieldSet': !this.state.areNotifsMuted, }); var muteNotifsClasses = classNames({ - 'mx_ContextualMenu_field': true, - 'mx_ContextualMenu_fieldSet': this.state.areNotifsMuted, + 'mx_NotificationStateContextMenu_field': true, + 'mx_NotificationStateContextMenu_fieldSet': this.state.areNotifsMuted, }); return ( diff --git a/src/skins/vector/css/matrix-react-sdk/structures/ContextualMenu.css b/src/skins/vector/css/matrix-react-sdk/structures/ContextualMenu.css index 95282e35..1d4f51ea 100644 --- a/src/skins/vector/css/matrix-react-sdk/structures/ContextualMenu.css +++ b/src/skins/vector/css/matrix-react-sdk/structures/ContextualMenu.css @@ -1,3 +1,19 @@ +/* +Copyright 2015, 2016 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. +*/ + .mx_ContextualMenu_background { position: fixed; top: 0; @@ -70,10 +86,6 @@ cursor: pointer; } -.mx_ContextualMenu_field.mx_ContextualMenu_fieldSet { - font-weight: bold; -} - .mx_ContextualMenu_spinner { display: block; margin: 0 auto; diff --git a/src/skins/vector/css/vector-web/views/context_menus/MessageContextMenu.css b/src/skins/vector/css/vector-web/views/context_menus/MessageContextMenu.css new file mode 100644 index 00000000..881b11a6 --- /dev/null +++ b/src/skins/vector/css/vector-web/views/context_menus/MessageContextMenu.css @@ -0,0 +1,24 @@ +/* +Copyright 2015, 2016 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. +*/ + +.mx_MessageContextMenu_field { + padding: 3px 6px 3px 6px; + cursor: pointer; +} + +.mx_MessageContextMenu_field.mx_MessageContextMenu_fieldSet { + font-weight: bold; +} diff --git a/src/skins/vector/css/vector-web/views/context_menus/NotificationStateContextMenu.css b/src/skins/vector/css/vector-web/views/context_menus/NotificationStateContextMenu.css new file mode 100644 index 00000000..57994d46 --- /dev/null +++ b/src/skins/vector/css/vector-web/views/context_menus/NotificationStateContextMenu.css @@ -0,0 +1,24 @@ +/* +Copyright 2015, 2016 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. +*/ + +.mx_NotificationStateContextMenu_field { + padding: 3px 6px 3px 6px; + cursor: pointer; +} + +.mx_NotificationStateContextMenu_field.mx_NotificationStateContextMenu_fieldSet { + font-weight: bold; +}