diff --git a/src/components/appSearchSuper..ts b/src/components/appSearchSuper..ts index b3f69c9b..ccd2ea39 100644 --- a/src/components/appSearchSuper..ts +++ b/src/components/appSearchSuper..ts @@ -1235,7 +1235,7 @@ export default class AppSearchSuper { this.afterPerforming(1, mediaTab.contentTab); } - const peerIds = participants.map((participant) => { + const peerIds: {peerId: PeerId, rank: ReturnType}[] = participants.map((participant) => { const peerId = userId ? (participant as Chat.chat).id.toPeerId(true) : getParticipantPeerId(participant as ChannelParticipant); if(chatId ? peerId.isAnyChat() : peerId.isUser()) { return; @@ -1243,7 +1243,7 @@ export default class AppSearchSuper { return { peerId, - rank: getParticipantRank(participant as ChannelParticipant) + rank: getParticipantRank(participant as ChannelParticipant) as any }; }).filter(Boolean); diff --git a/src/components/chat/bubbles.ts b/src/components/chat/bubbles.ts index da1a52ef..02fcb8f7 100644 --- a/src/components/chat/bubbles.ts +++ b/src/components/chat/bubbles.ts @@ -135,6 +135,7 @@ import wrapLocalSticker from '../wrappers/localSticker'; import {LottieAssetName} from '../../lib/rlottie/lottieLoader'; import clamp from '../../helpers/number/clamp'; import getParticipantRank from '../../lib/appManagers/utils/chats/getParticipantRank'; +import wrapParticipantRank from '../wrappers/participantRank'; export const USER_REACTIONS_INLINE = false; const USE_MEDIA_TAILS = false; @@ -5415,9 +5416,7 @@ export default class ChatBubbles { private createBubbleNameRank(rank: ReturnType | 0) { const span = document.createElement('span'); span.classList.add('bubble-name-rank'); - span.append(typeof(rank) === 'number' ? - i18n(!rank ? 'Chat.ChannelBadge' : (rank === 1 ? 'Chat.OwnerBadge' : 'ChatAdmin')) : - rank); + span.append(wrapParticipantRank(rank)); return span; } diff --git a/src/components/popups/stickers.ts b/src/components/popups/stickers.ts index a942db76..dce52156 100644 --- a/src/components/popups/stickers.ts +++ b/src/components/popups/stickers.ts @@ -28,6 +28,8 @@ import replaceContent from '../../helpers/dom/replaceContent'; import rootScope from '../../lib/rootScope'; import wrapCustomEmoji from '../wrappers/customEmoji'; import emoticonsDropdown from '../emoticonsDropdown'; +import ButtonMenuToggle from '../buttonMenuToggle'; +import {copyTextToClipboard} from '../../helpers/clipboard'; const ANIMATION_GROUP: AnimationItemGroup = 'STICKERS-POPUP'; @@ -251,6 +253,21 @@ export default class PopupStickers extends PopupElement { setInnerHTML(this.title, i18n('Emoji')); } + const btnMenu = ButtonMenuToggle({ + listenerSetter: this.listenerSetter, + buttons: [{ + icon: 'copy', + text: 'CopyLink', + onClick: () => { + const prefix = `https://t.me/${this.isEmojis ? 'addemoji' : 'addstickers'}/`; + const text = sets.map((set) => prefix + set.set.short_name).join('\n'); + copyTextToClipboard(text); + } + }], + direction: 'bottom-left' + }); + this.title.after(btnMenu); + this.stickersFooter.textContent = ''; this.stickersFooter.append(button); diff --git a/src/components/sortedUserList.ts b/src/components/sortedUserList.ts index 3d5f25b4..514fc687 100644 --- a/src/components/sortedUserList.ts +++ b/src/components/sortedUserList.ts @@ -4,6 +4,7 @@ * https://github.com/morethanwords/tweb/blob/master/LICENSE */ +import type LazyLoadQueue from './lazyLoadQueue'; import appDialogsManager, {AppDialogsManager, DialogDom, DialogElementSize} from '../lib/appManagers/appDialogsManager'; import {getHeavyAnimationPromise} from '../hooks/useHeavyAnimationCheck'; import isInDOM from '../helpers/dom/isInDOM'; @@ -14,9 +15,9 @@ import SortedList, {SortedElementBase} from '../helpers/sortedList'; import safeAssign from '../helpers/object/safeAssign'; import {AppManagers} from '../lib/appManagers/managers'; import getUserStatusString from './wrappers/getUserStatusString'; -import type LazyLoadQueue from './lazyLoadQueue'; import getChatMembersString from './wrappers/getChatMembersString'; -import {i18n} from '../lib/langPack'; +import wrapParticipantRank from './wrappers/participantRank'; +import getParticipantRank from '../lib/appManagers/utils/chats/getParticipantRank'; interface SortedUser extends SortedElementBase { dom: DialogDom @@ -25,7 +26,7 @@ interface SortedUser extends SortedElementBase { export default class SortedUserList extends SortedList { protected static SORT_INTERVAL = 30e3; public list: HTMLUListElement; - public ranks: Map = new Map(); + public ranks: Map> = new Map(); protected lazyLoadQueue: LazyLoadQueue; protected avatarSize: DialogElementSize = 'abitbigger'; @@ -87,9 +88,7 @@ export default class SortedUserList extends SortedList { const rank = this.ranks.get(base.id); if(rank) { - dialogElement.titleRight.replaceChildren(typeof(rank) === 'number' ? - i18n(rank === 1 ? 'Chat.OwnerBadge' : 'ChatAdmin') : - rank); + dialogElement.titleRight.replaceChildren(wrapParticipantRank(rank)); } (base as SortedUser).dom = dialogElement.dom; diff --git a/src/components/wrappers/participantRank.ts b/src/components/wrappers/participantRank.ts new file mode 100644 index 00000000..1a21dec1 --- /dev/null +++ b/src/components/wrappers/participantRank.ts @@ -0,0 +1,9 @@ +import getParticipantRank from '../../lib/appManagers/utils/chats/getParticipantRank'; +import {i18n} from '../../lib/langPack'; +import wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText'; + +export default function wrapParticipantRank(rank: ReturnType | 0) { + return typeof(rank) === 'number' ? + i18n(!rank ? 'Chat.ChannelBadge' : (rank === 1 ? 'Chat.OwnerBadge' : 'ChatAdmin')) : + wrapEmojiText(rank); +} diff --git a/src/scss/partials/_rightSidebar.scss b/src/scss/partials/_rightSidebar.scss index 165a557d..72a43640 100644 --- a/src/scss/partials/_rightSidebar.scss +++ b/src/scss/partials/_rightSidebar.scss @@ -404,6 +404,7 @@ &-border { border-color: var(--message-checkbox-border-color); + z-index: 1 !important; } &-background { diff --git a/src/scss/partials/popups/_stickers.scss b/src/scss/partials/popups/_stickers.scss index f4b9af49..0c5d5708 100644 --- a/src/scss/partials/popups/_stickers.scss +++ b/src/scss/partials/popups/_stickers.scss @@ -46,11 +46,10 @@ &-close { font-size: 1.5rem; - margin-inline-start: 1rem; } &-header { - margin: .625rem 0; + margin: .625rem 1rem; flex: 0 0 auto; } }