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 { return {
text: this.createNonBreakingLastSeparator(this.get('body')), text: this.createNonBreakingLastSeparator(this.get('body')),
timestamp: this.get('sent_at'),
status: this.getMessagePropStatus(), status: this.getMessagePropStatus(),
direction, direction,
friendStatus, friendStatus,

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

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

Loading…
Cancel
Save