Update styles for verified icon
This commit is contained in:
parent
03ed42188e
commit
6c38823b50
7 changed files with 111 additions and 8 deletions
|
@ -1,23 +1,32 @@
|
|||
// Copyright 2023 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import type { LocalizerType } from '../types/Util';
|
||||
import type { ConversationAttributesType } from '../model-types';
|
||||
|
||||
export function getAboutText(
|
||||
attributes: ConversationAttributesType
|
||||
export function sanitizeAboutText(
|
||||
text: string | undefined
|
||||
): string | undefined {
|
||||
if (!attributes.about) {
|
||||
return text?.replace(/[✓✔☑√⛉⛊⛛]/g, '');
|
||||
}
|
||||
|
||||
export function getAboutText(
|
||||
attributes: Pick<ConversationAttributesType, 'about' | 'aboutEmoji'>,
|
||||
i18n: LocalizerType = window.i18n
|
||||
): string | undefined {
|
||||
const text = sanitizeAboutText(attributes.about);
|
||||
|
||||
if (!text) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const emoji = attributes.aboutEmoji;
|
||||
const text = attributes.about;
|
||||
|
||||
if (!emoji) {
|
||||
return text;
|
||||
}
|
||||
|
||||
return window.i18n('icu:message--getNotificationText--text-with-emoji', {
|
||||
return i18n('icu:message--getNotificationText--text-with-emoji', {
|
||||
text,
|
||||
emoji,
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue