Forgot to add this part

This commit is contained in:
Beaudan 2019-07-23 12:16:11 +10:00
parent 21f0149e22
commit 1d0067e6e5
2 changed files with 22 additions and 4 deletions

View file

@ -517,10 +517,20 @@
color: $color-gray-60;
text-transform: uppercase;
}
.module-message__metadata__public {
font-size: 11px;
line-height: 16px;
letter-spacing: 0.3px;
color: $color-gray-60;
text-transform: uppercase;
}
.module-message__metadata__date--incoming,
.module-message__metadata__p2p--incoming {
color: $color-white-08;
}
.module-message__metadata__public--incoming {
color: $color-white-08;
}
.module-message__metadata__date--with-image-no-caption {
color: $color-white;
}
@ -528,6 +538,9 @@
.module-message__metadata__p2p {
font-weight: bold;
}
.module-message__metadata__public {
font-weight: bold;
}
.module-message__metadata__spacer {
flex-grow: 1;

View file

@ -86,6 +86,7 @@ export interface Props {
expirationLength?: number;
expirationTimestamp?: number;
isP2p?: boolean;
isPublic?: boolean;
onClickAttachment?: (attachment: AttachmentType) => void;
onClickLinkPreview?: (url: string) => void;
@ -203,6 +204,7 @@ export class Message extends React.PureComponent<Props, State> {
textPending,
timestamp,
isP2p,
isPublic,
} = this.props;
if (collapseMetadata) {
@ -212,6 +214,9 @@ export class Message extends React.PureComponent<Props, State> {
const isShowingImage = this.isShowingImage();
const withImageNoCaption = Boolean(!text && isShowingImage);
const showError = status === 'error' && direction === 'outgoing';
const hasBadge = isP2p || isPublic;
const badgeText = isPublic ? 'Public' : isP2p ? 'P2p' : '';
const badgeType = badgeText.toLowerCase();
return (
<div
@ -244,14 +249,14 @@ export class Message extends React.PureComponent<Props, State> {
module="module-message__metadata__date"
/>
)}
{isP2p ? (
{hasBadge ? (
<span
className={classNames(
'module-message__metadata__p2p',
`module-message__metadata__p2p--${direction}`
`module-message__metadata__${badgeType}`,
`module-message__metadata__${badgeType}--${direction}`
)}
>
&nbsp;&nbsp;P2P
&nbsp;&nbsp;${badgeText}
</span>
) : null}
{expirationLength && expirationTimestamp ? (