mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-06 12:12:42 +00:00
Add tooltip and classNames to UserPage and BrewItem
This commit is contained in:
@@ -99,11 +99,18 @@ const BrewItem = createClass({
|
|||||||
</span>;
|
</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(){
|
render : function(){
|
||||||
const brew = this.props.brew;
|
const brew = this.props.brew;
|
||||||
return <div className='brewItem'>
|
return <div className='brewItem' title={this.getTooltipData()}>
|
||||||
<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'>
|
||||||
|
|||||||
@@ -140,11 +140,11 @@ const UserPage = createClass({
|
|||||||
<div className='content V3'>
|
<div className='content V3'>
|
||||||
<div className='phb'>
|
<div className='phb'>
|
||||||
{this.renderSortOptions()}
|
{this.renderSortOptions()}
|
||||||
<div>
|
<div className='published'>
|
||||||
<h1>{this.getUsernameWithS()} brews</h1>
|
<h1>{this.getUsernameWithS()} brews</h1>
|
||||||
{this.renderBrews(brews.published)}
|
{this.renderBrews(brews.published)}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div className='unpublished'>
|
||||||
<h1>{this.getUsernameWithS()} unpublished brews</h1>
|
<h1>{this.getUsernameWithS()} unpublished brews</h1>
|
||||||
{this.renderBrews(brews.private)}
|
{this.renderBrews(brews.private)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user