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