Modified time to PublishingInfo
This commit is contained in:
@@ -27,9 +27,10 @@ class Document extends React.Component {
|
||||
return (
|
||||
<div className={ styles.container }>
|
||||
<PublishingInfo
|
||||
avatarUrl={ this.props.document.user.avatarUrl }
|
||||
document={ this.props.document }
|
||||
name={ this.props.document.user.name }
|
||||
timestamp={ this.props.document.createdAt }
|
||||
createdAt={ this.props.document.createdAt }
|
||||
updatedAt={ this.props.document.updatedAt }
|
||||
/>
|
||||
<DocumentHtml html={ this.props.document.html } />
|
||||
</div>
|
||||
|
||||
@@ -18,7 +18,7 @@ class Document extends React.Component {
|
||||
<PublishingInfo
|
||||
avatarUrl={ this.props.document.user.avatarUrl }
|
||||
name={ this.props.document.user.name }
|
||||
timestamp={ document.createdAt }
|
||||
createdAt={ document.createdAt }
|
||||
/>
|
||||
|
||||
<Link
|
||||
|
||||
@@ -12,6 +12,11 @@ const PublishingInfo = (props) => {
|
||||
<Avatar src={ props.avatarUrl } size={ 24 } />
|
||||
<span className={ styles.userName }>
|
||||
{ props.name } published { moment(props.timestamp).fromNow() }
|
||||
{ props.createdAt !== props.updatedAt ? (
|
||||
<span>
|
||||
and modified { moment(props.timestamp).fromNow() }
|
||||
</span>
|
||||
) : null }
|
||||
</span>
|
||||
</Flex>
|
||||
);
|
||||
@@ -20,7 +25,8 @@ const PublishingInfo = (props) => {
|
||||
PublishingInfo.propTypes = {
|
||||
avatarUrl: React.PropTypes.string.isRequired,
|
||||
name: React.PropTypes.string.isRequired,
|
||||
timestamp: React.PropTypes.string.isRequired,
|
||||
createdAt: React.PropTypes.string.isRequired,
|
||||
updatedAt: React.PropTypes.string.isRequired,
|
||||
};
|
||||
|
||||
export default PublishingInfo;
|
||||
Reference in New Issue
Block a user