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

Shift renderUiItems to function

This commit is contained in:
G.Ambatte
2022-09-26 00:35:12 +13:00
parent be25e90009
commit ed5bef27e0
2 changed files with 16 additions and 14 deletions

View File

@@ -18,7 +18,7 @@ const AccountPage = createClass({
getDefaultProps : function() {
return {
brew : {},
uiItems : []
uiItems : {}
};
},
getInitialState : function() {
@@ -39,14 +39,14 @@ const AccountPage = createClass({
},
renderUiItems : function() {
// console.log(JSON.stringify(this.props.uiItems));
// console.log(this.props.uiItems);
return <>
<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> {this.props.uiItems.issued || '-'}</p>
<p><strong>Last Login: </strong> {this.props.uiItems.issued.toString() || '-'}</p>
<p></p>
<h3>MongoDB Information</h3>
<p><strong>Brews on MongoDB: </strong> {this.props.uiItems.mongoCount || '-'}</p>
<h3>Homebrewery Information</h3>
<p><strong>Brews on Homebrewery: </strong> {this.props.uiItems.mongoCount || '-'}</p>
<p></p>
<h3>Google Information <i className='fa-brands fa-google-drive'></i></h3>
<p><strong>Linked to Google: </strong> {this.props.uiItems.googleId ? 'YES' : 'NO'}</p>
@@ -55,7 +55,7 @@ const AccountPage = createClass({
},
render : function(){
return <UIPage brew={this.props.brew} uiItems={this.renderUiItems()} ></UIPage>;
return <UIPage brew={this.props.brew} renderUiItems={this.renderUiItems} ></UIPage>;
}
});