From 88ad780b6b24e5231f72c1600c69befd8ed31bbf Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 1 Feb 2019 16:43:12 +0100 Subject: [PATCH] update message e2e icons also remove encrypted icon as header/composer already indicate encryption --- res/css/views/rooms/_EventTile.scss | 17 +++++++- res/img/feather-icons/e2e/warning.svg | 6 +++ src/components/views/rooms/EventTile.js | 52 +++++++------------------ 3 files changed, 36 insertions(+), 39 deletions(-) create mode 100644 res/img/feather-icons/e2e/warning.svg diff --git a/res/css/views/rooms/_EventTile.scss b/res/css/views/rooms/_EventTile.scss index c920d6e390..7c9a6babea 100644 --- a/res/css/views/rooms/_EventTile.scss +++ b/res/css/views/rooms/_EventTile.scss @@ -281,9 +281,24 @@ limitations under the License. .mx_EventTile_e2eIcon { display: block; position: absolute; - top: 9px; + top: 8px; left: 46px; + width: 15px; + height: 15px; cursor: pointer; + mask-size: 14px; + mask-repeat: no-repeat; + mask-position: 0; +} + +.mx_EventTile_e2eIcon_undecryptable, .mx_EventTile_e2eIcon_unverified { + mask-image: url('$(res)/img/feather-icons/e2e/warning.svg'); + background-color: $warning-color; +} + +.mx_EventTile_e2eIcon_unencrypted { + mask-image: url('$(res)/img/feather-icons/e2e/warning.svg'); + background-color: $composer-e2e-icon-color; } .mx_EventTile_e2eIcon_hidden { diff --git a/res/img/feather-icons/e2e/warning.svg b/res/img/feather-icons/e2e/warning.svg new file mode 100644 index 0000000000..e6c246dba9 --- /dev/null +++ b/res/img/feather-icons/e2e/warning.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js index acb122ad4e..e4a6695ff5 100644 --- a/src/components/views/rooms/EventTile.js +++ b/src/components/views/rooms/EventTile.js @@ -459,17 +459,21 @@ module.exports = withMatrixClient(React.createClass({ // event is encrypted, display padlock corresponding to whether or not it is verified if (ev.isEncrypted()) { - return this.state.verified ? : ; + if (this.state.verified) { + return; // no icon for verified + } else { + return (); + } } if (this.props.matrixClient.isRoomEncrypted(ev.getRoomId())) { // else if room is encrypted // and event is being encrypted or is not_sent (Unknown Devices/Network Error) if (ev.status === EventStatus.ENCRYPTING) { - return ; + return; } if (ev.status === EventStatus.NOT_SENT) { - return ; + return; } // if the event is not encrypted, but it's an e2e room, show the open padlock return ; @@ -767,57 +771,29 @@ module.exports.haveTileForEvent = function(e) { function E2ePadlockUndecryptable(props) { return ( - - ); -} - -function E2ePadlockEncrypting(props) { - return ( - - ); -} - -function E2ePadlockNotSent(props) { - return ( - - ); -} - -function E2ePadlockVerified(props) { - return ( - + ); } function E2ePadlockUnverified(props) { return ( - + ); } function E2ePadlockUnencrypted(props) { return ( - + ); } function E2ePadlock(props) { if (SettingsStore.getValue("alwaysShowEncryptionIcons")) { - return ; + return
; } else { - return ; + return
; } }