From 086042f078754d30ac047c389fb169868f663de8 Mon Sep 17 00:00:00 2001 From: Michael Weimann Date: Tue, 22 Jun 2021 20:11:12 +0200 Subject: [PATCH] update message context texts and icons Signed-off-by: Michael Weimann --- .../context_menus/_MessageContextMenu.scss | 7 ++-- res/img/element-icons/warning-badge.svg | 34 ++++++++++++++-- .../views/context_menus/MessageContextMenu.js | 39 +++++++++---------- src/i18n/strings/en_EN.json | 12 +++--- 4 files changed, 60 insertions(+), 32 deletions(-) diff --git a/res/css/views/context_menus/_MessageContextMenu.scss b/res/css/views/context_menus/_MessageContextMenu.scss index 4900488bb8..338841cce4 100644 --- a/res/css/views/context_menus/_MessageContextMenu.scss +++ b/res/css/views/context_menus/_MessageContextMenu.scss @@ -1,4 +1,5 @@ /* +Copyright 2015, 2016 OpenMarket Ltd Copyright 2021 Michael Weimann Licensed under the Apache License, Version 2.0 (the "License"); @@ -42,7 +43,7 @@ limitations under the License. } .mx_MessageContextMenu_iconLink::before { - mask-image: url('$(res)/img/element-icons/message/link.svg'); + mask-image: url('$(res)/img/element-icons/link.svg'); } .mx_MessageContextMenu_iconPermalink::before { @@ -50,7 +51,7 @@ limitations under the License. } .mx_MessageContextMenu_iconUnhidePreview::before { - mask-image: url('$(res)/img/feather-customised/eye.svg'); + mask-image: url('$(res)/img/element-icons/settings/appearance.svg'); } .mx_MessageContextMenu_iconForward::before { @@ -62,7 +63,7 @@ limitations under the License. } .mx_MessageContextMenu_iconResend::before { - mask-image: url('$(res)/img/element-icons/message/repeat.svg'); + mask-image: url('$(res)/img/element-icons/retry.svg'); } .mx_MessageContextMenu_iconSource::before { diff --git a/res/img/element-icons/warning-badge.svg b/res/img/element-icons/warning-badge.svg index 4e2ff75679..1c8da9aa8e 100644 --- a/res/img/element-icons/warning-badge.svg +++ b/res/img/element-icons/warning-badge.svg @@ -1,4 +1,32 @@ - - + + + + + + image/svg+xml + + + + + + + diff --git a/src/components/views/context_menus/MessageContextMenu.js b/src/components/views/context_menus/MessageContextMenu.js index cd7dd91e4a..b61d8b50f0 100644 --- a/src/components/views/context_menus/MessageContextMenu.js +++ b/src/components/views/context_menus/MessageContextMenu.js @@ -22,13 +22,13 @@ import { EventStatus } from 'matrix-js-sdk/src/models/event'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; import dis from '../../../dispatcher/dispatcher'; import * as sdk from '../../../index'; -import {_t} from '../../../languageHandler'; +import { _t } from '../../../languageHandler'; import Modal from '../../../Modal'; import Resend from '../../../Resend'; import SettingsStore from '../../../settings/SettingsStore'; import { isUrlPermitted } from '../../../HtmlUtils'; import { isContentActionable } from '../../../utils/EventUtils'; -import IconizedContextMenu, {IconizedContextMenuOption, IconizedContextMenuOptionList} from "./IconizedContextMenu"; +import IconizedContextMenu, { IconizedContextMenuOption, IconizedContextMenuOptionList } from './IconizedContextMenu'; import { EventType } from "matrix-js-sdk/src/@types/event"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { ReadPinsEventId } from "../right_panel/PinnedMessagesCard"; @@ -306,7 +306,7 @@ export default class MessageContextMenu extends React.Component { const viewSourceButton = ( ); @@ -316,7 +316,7 @@ export default class MessageContextMenu extends React.Component { unhidePreviewButton = ( ); @@ -351,8 +351,7 @@ export default class MessageContextMenu extends React.Component { } // Bridges can provide a 'external_url' to link back to the source. - if (true || - typeof (mxEvent.event.content.external_url) === "string" && + if (typeof (mxEvent.event.content.external_url) === "string" && isUrlPermitted(mxEvent.event.content.external_url) ) { externalURLButton = ( @@ -372,7 +371,7 @@ export default class MessageContextMenu extends React.Component { collapseReplyThread = ( ); @@ -383,7 +382,7 @@ export default class MessageContextMenu extends React.Component { reportEventButton = ( ); @@ -391,23 +390,23 @@ export default class MessageContextMenu extends React.Component { optionLists.push(( - {quoteButton} - {forwardButton} - {pinButton} - {permalinkButton} - {reportEventButton} - {externalURLButton} - {viewSourceButton} - {unhidePreviewButton} - {resendReactionsButton} - {collapseReplyThread} + { quoteButton } + { forwardButton } + { pinButton } + { permalinkButton } + { reportEventButton } + { externalURLButton } + { unhidePreviewButton } + { viewSourceButton } + { resendReactionsButton } + { collapseReplyThread } )); if (redactButton) { optionLists.push(( - {redactButton} + { redactButton } )); } @@ -418,7 +417,7 @@ export default class MessageContextMenu extends React.Component { className="mx_MessageContextMenu" compact={true} > - {optionLists} + { optionLists } ); } diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index f95caeff71..7e1237f1cf 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -2252,7 +2252,7 @@ "Sending": "Sending", "Sent": "Sent", "Open link": "Open link", - "Forward": "Forward", + "Forward message": "Forward message", "Message preview": "Message preview", "Search for rooms or people": "Search for rooms or people", "Confirm abort of host creation": "Confirm abort of host creation", @@ -2525,12 +2525,12 @@ "Are you sure you want to reject the invitation?": "Are you sure you want to reject the invitation?", "Unable to reject invite": "Unable to reject invite", "Resend %(unsentCount)s reaction(s)": "Resend %(unsentCount)s reaction(s)", - "Forward Message": "Forward", - "Unpin Message": "Unpin Message", - "Pin Message": "Pin Message", - "Unhide Preview": "Unhide Preview", + "Forward": "Forward", + "View source": "View source", + "Show preview": "Show preview", "Source URL": "Source URL", - "Collapse Reply Thread": "Collapse Reply Thread", + "Collapse reply thread": "Collapse reply thread", + "Report": "Report", "Clear status": "Clear status", "Update status": "Update status", "Set status": "Set status",