New React component: ConversationListItem, installed in left pane

When collecting a conversation's last message, we grab that message's
status as well (if outgoing) and show it.
This commit is contained in:
Scott Nonnenberg 2018-07-17 20:25:55 -07:00
parent 7e2d7b5e60
commit 675e34fc8d
17 changed files with 713 additions and 303 deletions

View file

@ -8,9 +8,10 @@ import { Localizer } from '../../types/Util';
interface Props {
timestamp: number;
withImageNoCaption: boolean;
direction: 'incoming' | 'outgoing';
extended: boolean;
module?: string;
withImageNoCaption?: boolean;
direction?: 'incoming' | 'outgoing';
i18n: Localizer;
}
@ -47,6 +48,7 @@ export class Timestamp extends React.Component<Props> {
module,
timestamp,
withImageNoCaption,
extended,
} = this.props;
const moduleName = module || 'module-timestamp';
@ -54,12 +56,12 @@ export class Timestamp extends React.Component<Props> {
<span
className={classNames(
moduleName,
`${moduleName}--${direction}`,
direction ? `${moduleName}--${direction}` : null,
withImageNoCaption ? `${moduleName}--with-image-no-caption` : null
)}
title={moment(timestamp).format('llll')}
>
{formatRelativeTime(timestamp, { i18n, extended: true })}
{formatRelativeTime(timestamp, { i18n, extended })}
</span>
);
}