diff --git a/res/css/views/rooms/_MemberDeviceInfo.scss b/res/css/views/rooms/_MemberDeviceInfo.scss index 6ccc4c7ae3..f780c50410 100644 --- a/res/css/views/rooms/_MemberDeviceInfo.scss +++ b/res/css/views/rooms/_MemberDeviceInfo.scss @@ -20,6 +20,25 @@ limitations under the License. align-items: start; } +.mx_MemberDeviceInfo_icon { + margin-top: 4px; + width: 12px; + height: 12px; + mask-repeat: no-repeat; +} +.mx_MemberDeviceInfo_icon_blacklisted { + mask-image: url('$(res)/img/feather-icons/e2e/blacklisted.svg'); + background-color: $warning-color; +} +.mx_MemberDeviceInfo_icon_verified { + mask-image: url('$(res)/img/feather-icons/e2e/verified.svg'); + background-color: $accent-color; +} +.mx_MemberDeviceInfo_icon_unverified { + mask-image: url('$(res)/img/feather-icons/e2e/warning.svg'); + background-color: $warning-color; +} + .mx_MemberDeviceInfo > .mx_DeviceVerifyButtons { display: flex; flex-direction: column; diff --git a/res/img/feather-icons/e2e/blacklisted.svg b/res/img/feather-icons/e2e/blacklisted.svg new file mode 100644 index 0000000000..63897c2227 --- /dev/null +++ b/res/img/feather-icons/e2e/blacklisted.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/res/img/feather-icons/e2e/verified.svg b/res/img/feather-icons/e2e/verified.svg new file mode 100644 index 0000000000..f143f854e6 --- /dev/null +++ b/res/img/feather-icons/e2e/verified.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/components/views/rooms/MemberDeviceInfo.js b/src/components/views/rooms/MemberDeviceInfo.js index b9c276f0d1..67f99e4d1d 100644 --- a/src/components/views/rooms/MemberDeviceInfo.js +++ b/src/components/views/rooms/MemberDeviceInfo.js @@ -18,32 +18,18 @@ import React from 'react'; import PropTypes from 'prop-types'; import sdk from '../../../index'; import { _t } from '../../../languageHandler'; +import classNames from 'classnames'; export default class MemberDeviceInfo extends React.Component { render() { - let indicator = null; const DeviceVerifyButtons = sdk.getComponent('elements.DeviceVerifyButtons'); - - if (this.props.device.isBlocked()) { - indicator = ( -
- {_t("Blacklisted")} -
- ); - } else if (this.props.device.isVerified()) { - indicator = ( -
- {_t("Verified")} -
- ); - } else { - indicator = ( -
- {_t("Unverified")} -
- ); - } - + const iconClasses = classNames({ + mx_MemberDeviceInfo_icon: true, + mx_MemberDeviceInfo_icon_blacklisted: this.props.device.isBlocked(), + mx_MemberDeviceInfo_icon_verified: this.props.device.isVerified(), + mx_MemberDeviceInfo_icon_unverified: this.props.device.isUnverified(), + }); + const indicator = (
); const deviceName = this.props.device.ambiguous ? (this.props.device.getDisplayName() ? this.props.device.getDisplayName() : "") + " (" + this.props.device.deviceId + ")" : this.props.device.getDisplayName(); @@ -52,10 +38,10 @@ export default class MemberDeviceInfo extends React.Component { return (
+ { indicator }
{ deviceName } - { indicator }