Skip to content

Instantly share code, notes, and snippets.

@dvtng
Created June 12, 2017 12:04
Show Gist options
  • Save dvtng/a7daa221c018a3b74dbb61d79340e6e8 to your computer and use it in GitHub Desktop.
Save dvtng/a7daa221c018a3b74dbb61d79340e6e8 to your computer and use it in GitHub Desktop.
class Comment extends React.Component {
render() {
const metadata = this.props.publishTime ?
<PublishTime time={this.props.publishTime} /> :
<span>Saving...</span>;
const actions = [];
if (this.props.isSignedIn) {
actions.push(<LikeAction />);
actions.push(<ReplyAction />);
}
if (this.props.isAuthor) {
actions.push(<DeleteAction />);
}
return <CommentTemplate metadata={metadata} actions={actions} />;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment