Message / Context Menu: Better icons (#1734)

This commit is contained in:
Alexander Zinchuk 2022-02-28 17:59:00 +02:00
parent 3608538ae2
commit ac9c9ffbca
6 changed files with 181 additions and 149 deletions

Binary file not shown.

Binary file not shown.

View File

@ -234,8 +234,8 @@ const MessageContextMenu: FC<OwnProps> = ({
{canUnfaveSticker && (
<MenuItem icon="favorite" onClick={onUnfaveSticker}>{lang('Stickers.RemoveFromFavorites')}</MenuItem>
)}
{canCopy && copyOptions.map((options) => (
<MenuItem key={options.label} icon="copy" onClick={options.handler}>{lang(options.label)}</MenuItem>
{canCopy && copyOptions.map((option) => (
<MenuItem key={option.label} icon={option.icon} onClick={option.handler}>{lang(option.label)}</MenuItem>
))}
{canPin && <MenuItem icon="pin" onClick={onPin}>{lang('DialogPin')}</MenuItem>}
{canUnpin && <MenuItem icon="unpin" onClick={onUnpin}>{lang('DialogUnpin')}</MenuItem>}

View File

@ -15,6 +15,7 @@ import getMessageIdsForSelectedText from '../../../../util/getMessageIdsForSelec
type ICopyOptions = {
label: string;
icon: string;
handler: () => void;
}[];
@ -35,6 +36,7 @@ export function getMessageCopyOptions(
if (canImageBeCopied) {
options.push({
label: 'lng_context_copy_image',
icon: 'copy-media',
handler: () => {
Promise.resolve(mediaHash ? mediaLoader.fetch(mediaHash, ApiMediaFormat.BlobUrl) : photo!.blobUrl)
.then(copyImageToClipboard);
@ -56,6 +58,7 @@ export function getMessageCopyOptions(
options.push({
label: getCopyLabel(hasSelection),
icon: 'copy',
handler: () => {
const messageIds = getMessageIdsForSelectedText();
if (messageIds?.length && onCopyMessages) {
@ -75,6 +78,7 @@ export function getMessageCopyOptions(
if (onCopyLink) {
options.push({
label: 'lng_context_copy_message_link',
icon: 'link',
handler: () => {
onCopyLink();

File diff suppressed because it is too large Load Diff

View File

@ -51,6 +51,9 @@
.icon-volume-3:before {
content: "\e991";
}
.icon-copy-media:before {
content: "\e995";
}
.icon-reaction-filled:before {
content: "\e994";
}