mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-29 19:52:43 +00:00
Update following Gitter conversation
This commit is contained in:
@@ -99,29 +99,29 @@ const BrewItem = createClass({
|
|||||||
</span>;
|
</span>;
|
||||||
},
|
},
|
||||||
|
|
||||||
getTooltipData : function(){
|
|
||||||
const dateFormatString = 'YYYY-MM-DD HH:mm:ss';
|
|
||||||
let outputString = `Title: ${this.props.brew.title}\nCreated: ${this.props.brew.createdAt ? moment(this.props.brew.createdAt).local().format(dateFormatString) : 'UNKNOWN'}\n`;
|
|
||||||
outputString += `Last updated: ${this.props.brew.updatedAt ? moment(this.props.brew.updatedAt).local().format(dateFormatString) : 'UNKNOWN'}`;
|
|
||||||
return outputString;
|
|
||||||
},
|
|
||||||
|
|
||||||
render : function(){
|
render : function(){
|
||||||
const brew = this.props.brew;
|
const brew = this.props.brew;
|
||||||
return <div className='brewItem' title={this.getTooltipData()}>
|
const dateFormatString = 'YYYY-MM-DD HH:mm:ss';
|
||||||
|
|
||||||
|
return <div className='brewItem'>
|
||||||
<h2>{brew.title}</h2>
|
<h2>{brew.title}</h2>
|
||||||
<p className='description'>{brew.description}</p>
|
<p className='description'>{brew.description}</p>
|
||||||
<hr />
|
<hr />
|
||||||
|
|
||||||
<div className='info'>
|
<div className='info'>
|
||||||
<span>
|
<span title={`Authors:\n${brew.authors.join('\n')}`}>
|
||||||
<i className='fas fa-user' /> {brew.authors.join(', ')}
|
<i className='fas fa-user'/> {brew.authors.join(', ')}
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span title={`Last viewed: ${brew.lastViewed}`}>
|
||||||
<i className='fas fa-eye' /> {brew.views}
|
<i className='fas fa-eye'/> {brew.views}
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span
|
||||||
<i className='fas fa-sync-alt' /> {moment(brew.updatedAt).fromNow()}
|
title={
|
||||||
|
`Created: ${this.props.brew.createdAt ? moment(this.props.brew.createdAt).local().format(dateFormatString) : 'UNKNOWN'}\n` +
|
||||||
|
`Last updated: ${this.props.brew.updatedAt ? moment(this.props.brew.updatedAt).local().format(dateFormatString) : 'UNKNOWN'}`
|
||||||
|
}>
|
||||||
|
<i className='fas fa-sync-alt' />
|
||||||
|
{moment(brew.updatedAt).fromNow()}
|
||||||
</span>
|
</span>
|
||||||
{this.renderGoogleDriveIcon()}
|
{this.renderGoogleDriveIcon()}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user