0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 20:42:43 +00:00
Add tooltip and classNames to UserPage and BrewItem
This commit is contained in:
Trevor Buckner
2021-08-08 00:00:16 -04:00
committed by GitHub
2 changed files with 11 additions and 4 deletions

View File

@@ -99,11 +99,18 @@ const BrewItem = createClass({
</span>;
},
getTooltipData : function(){
const dateFormatString = 'YYYY-MM-DD HH:mm:ss';
let outputString = `Created: ${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(){
const brew = this.props.brew;
return <div className='brewItem'>
return <div className='brewItem' title={this.getTooltipData()}>
<h2>{brew.title}</h2>
<p className='description' >{brew.description}</p>
<p className='description'>{brew.description}</p>
<hr />
<div className='info'>

View File

@@ -141,11 +141,11 @@ const UserPage = createClass({
<div className='content V3'>
<div className='phb'>
{this.renderSortOptions()}
<div>
<div className='published'>
<h1>{this.getUsernameWithS()} brews</h1>
{this.renderBrews(brews.published)}
</div>
<div>
<div className='unpublished'>
<h1>{this.getUsernameWithS()} unpublished brews</h1>
{this.renderBrews(brews.private)}
</div>