From 7a2a7d8d59f8afeb1911887a8aa200a44dfd6d19 Mon Sep 17 00:00:00 2001 From: Jori Lallo Date: Fri, 30 Jun 2017 00:51:22 -0700 Subject: [PATCH] Only show creator or recent updater info per document --- .../PublishingInfo/PublishingInfo.js | 41 +++++++++++-------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/frontend/components/PublishingInfo/PublishingInfo.js b/frontend/components/PublishingInfo/PublishingInfo.js index 166c23fc4..ed0428b50 100644 --- a/frontend/components/PublishingInfo/PublishingInfo.js +++ b/frontend/components/PublishingInfo/PublishingInfo.js @@ -35,7 +35,13 @@ class PublishingInfo extends Component { }; render() { - const { collaborators } = this.props; + const { + collaborators, + createdAt, + updatedAt, + createdBy, + updatedBy, + } = this.props; return ( @@ -45,23 +51,22 @@ class PublishingInfo extends Component { ))} } - - {this.props.createdBy.name} - {' '} - published - {' '} - {moment(this.props.createdAt).fromNow()} - {this.props.createdAt !== this.props.updatedAt - ? -  and  - {this.props.createdBy.id !== this.props.updatedBy.id && - ` ${this.props.updatedBy.name} `} - modified - {' '} - {moment(this.props.updatedAt).fromNow()} - - : null} - + + {createdAt == updatedAt + ? + {createdBy.name} + {' '} + published + {' '} + {moment(createdAt).fromNow()} + + : + {updatedBy.name} + {' '} + modified + {' '} + {moment(updatedAt).fromNow()} + } ); }