0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-19 07:42:42 +00:00

Modify how data is passed to UIPage

This commit is contained in:
G.Ambatte
2022-10-03 20:27:34 +13:00
parent 93918bc26c
commit 1d8781da90
2 changed files with 12 additions and 28 deletions

View File

@@ -43,26 +43,28 @@ const AccountPage = createClass({
renderUiItems : function() {
// console.log(this.props.uiItems);
return [
<>
return <>
<div className='dataGroup'>
<h1>Account Information <i className='fas fa-user'></i></h1>
<p><strong>Username: </strong> {this.props.uiItems.username || 'No user currently logged in'}</p>
<p><strong>Last Login: </strong> {moment(this.props.uiItems.issued).format('dddd, MMMM Do YYYY, h:mm:ss a ZZ') || '-'}</p>
</>,
<>
</div>
<div className='dataGroup'>
<h3>Homebrewery Information <NaturalCritIcon /></h3>
<p><strong>Brews on Homebrewery: </strong> {this.props.uiItems.mongoCount || '-'}</p>
</>,
<>
</div>
<div className='dataGroup'>
<h3>Google Information <i className='fab fa-google-drive'></i></h3>
<p><strong>Linked to Google: </strong> {this.props.uiItems.googleId ? 'YES' : 'NO'}</p>
{this.props.uiItems.googleId ? <p><strong>Brews on Google Drive: </strong> {this.props.uiItems.fileCount || '-'}</p> : '' }
</>
];
</div>
</>;
},
render : function(){
return <UIPage brew={this.props.brew} renderUiItems={this.renderUiItems} ></UIPage>;
return <UIPage brew={this.props.brew}>
{this.renderUiItems()}
</UIPage>;
}
});