From e032a8ff63bb10a9f49b4699297ce320f5e930c7 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Tue, 20 Jul 2021 15:47:52 +0300 Subject: [PATCH] Sticker Modal: Support interactive author username (#1298) --- src/components/common/StickerSetModal.tsx | 3 ++- src/components/ui/Modal.tsx | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/common/StickerSetModal.tsx b/src/components/common/StickerSetModal.tsx index e3c88aa2..27c54107 100644 --- a/src/components/common/StickerSetModal.tsx +++ b/src/components/common/StickerSetModal.tsx @@ -11,6 +11,7 @@ import { pick } from '../../util/iteratees'; import { selectStickerSet } from '../../modules/selectors'; import { useIntersectionObserver } from '../../hooks/useIntersectionObserver'; import useLang from '../../hooks/useLang'; +import renderText from './helpers/renderText'; import Modal from '../ui/Modal'; import Button from '../ui/Button'; @@ -78,7 +79,7 @@ const StickerSetModal: FC = ({ isOpen={isOpen} onClose={onClose} hasCloseButton - title={stickerSet ? stickerSet.title : lang('AccDescrStickerSet')} + title={stickerSet ? renderText(stickerSet.title, ['emoji', 'links']) : lang('AccDescrStickerSet')} > {stickerSet && stickerSet.stickers ? ( <> diff --git a/src/components/ui/Modal.tsx b/src/components/ui/Modal.tsx index 985025f7..27bbd4a8 100644 --- a/src/components/ui/Modal.tsx +++ b/src/components/ui/Modal.tsx @@ -2,6 +2,8 @@ import React, { FC, useEffect, useRef, } from '../../lib/teact/teact'; +import { TextPart } from '../common/helpers/renderMessageText'; + import captureKeyboardListeners from '../../util/captureKeyboardListeners'; import trapFocus from '../../util/trapFocus'; import buildClassName from '../../util/buildClassName'; @@ -19,10 +21,10 @@ import './Modal.scss'; const ANIMATION_DURATION = 200; type OwnProps = { - title?: string; + title?: string | TextPart[]; className?: string; isOpen?: boolean; - header?: FC; + header?: any; hasCloseButton?: boolean; noBackdrop?: boolean; children: any;