WebPage: Show user background icon (#4128)

This commit is contained in:
Alexander Zinchuk 2024-01-12 12:59:57 +01:00
parent 44cbadb383
commit 1f029966ae
3 changed files with 16 additions and 2 deletions

View File

@ -1204,7 +1204,7 @@ const Message: FC<OwnProps & StateProps> = ({
theme={theme}
story={webPageStory}
isConnected={isConnected}
noUserColors={isOwn}
backgroundEmojiId={sender?.color?.backgroundEmojiId}
onMediaClick={handleMediaClick}
onCancelMediaTransfer={handleCancelUpload}
/>

View File

@ -59,10 +59,16 @@
}
}
&--background-icons {
color: var(--accent-color);
}
&-text {
display: flex;
flex-direction: column;
flex-grow: 1;
align-items: flex-start;
position: relative;
}
.media-inner {

View File

@ -18,6 +18,7 @@ import useEnsureStory from '../../../hooks/useEnsureStory';
import useLang from '../../../hooks/useLang';
import useLastCallback from '../../../hooks/useLastCallback';
import EmojiIconBackground from '../../common/embedded/EmojiIconBackground';
import SafeLink from '../../common/SafeLink';
import Button from '../../ui/Button';
import BaseStory from './BaseStory';
@ -40,7 +41,7 @@ type OwnProps = {
isDownloading?: boolean;
isProtected?: boolean;
isConnected?: boolean;
noUserColors?: boolean;
backgroundEmojiId?: string;
theme: ISettings['theme'];
story?: ApiTypeStory;
onMediaClick?: () => void;
@ -60,6 +61,7 @@ const WebPage: FC<OwnProps> = ({
isConnected,
story,
theme,
backgroundEmojiId,
onMediaClick,
onCancelMediaTransfer,
}) => {
@ -162,6 +164,12 @@ const WebPage: FC<OwnProps> = ({
)}
{isArticle && (
<div className="WebPage-text">
{backgroundEmojiId && (
<EmojiIconBackground
emojiDocumentId={backgroundEmojiId}
className="WebPage--background-icons"
/>
)}
<SafeLink className="site-name" url={url} text={siteName || displayUrl} />
{!inPreview && title && (
<p className="site-title">{renderText(title)}</p>