Merge pull request #492 from sachaaaaa/fix_friend_request_timestamp

Display timestamp for friend requests
pull/494/head
sachaaaaa 6 years ago committed by GitHub
commit 440dc75584
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -483,6 +483,7 @@
return {
text: this.createNonBreakingLastSeparator(this.get('body')),
timestamp: this.get('sent_at'),
status: this.getMessagePropStatus(),
direction,
friendStatus,

@ -5,6 +5,7 @@
| Name | Values |
| -------------------- | -------------------------------------------- |
| text | string |
| timestamp | number |
| direction | 'outgoing' \| 'incoming |
| status | 'sending' \| 'sent' \| 'read' \| 'delivered' |
| friendStatus | 'pending' \| 'accepted' \| 'declined' |
@ -21,6 +22,7 @@
<li>
<FriendRequest
text="This is my friend request message!"
timestamp={1567994022804}
direction="outgoing"
status="sending"
friendStatus="pending"

@ -3,6 +3,7 @@ import classNames from 'classnames';
import { LocalizerType } from '../../types/Util';
import { MessageBody } from './MessageBody';
import { Timestamp } from './Timestamp';
interface Props {
text: string;
@ -11,6 +12,7 @@ interface Props {
friendStatus: 'pending' | 'accepted' | 'declined' | 'expired';
i18n: LocalizerType;
isBlocked: boolean;
timestamp: number;
onAccept: () => void;
onDecline: () => void;
onDeleteConversation: () => void;
@ -142,13 +144,23 @@ export class FriendRequest extends React.Component<Props> {
// Renders 'sending', 'read' icons
public renderStatusIndicator() {
const { direction, status } = this.props;
if (direction !== 'outgoing' || status === 'error') {
const { direction, status, i18n, text, timestamp } = this.props;
if (status === 'error') {
return null;
}
const withImageNoCaption = Boolean(!text);
return (
<div className="module-message__metadata">
<Timestamp
i18n={i18n}
timestamp={timestamp}
extended={true}
direction={direction}
withImageNoCaption={withImageNoCaption}
module="module-message__metadata__date"
/>
<span className="module-message__metadata__spacer" />
<div
className={classNames(

Loading…
Cancel
Save