0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-16 10:22:42 +00:00

Renamed functions, eliminate unnecessary variable

This commit is contained in:
G.Ambatte
2022-09-25 23:29:45 +13:00
parent 0ac50017c4
commit 57b0af54df

View File

@@ -27,7 +27,7 @@ const AccountPage = createClass({
}; };
}, },
navItems : function() { renderNavItems : function() {
return <Navbar> return <Navbar>
<Nav.section> <Nav.section>
<NewBrew /> <NewBrew />
@@ -38,9 +38,9 @@ const AccountPage = createClass({
</Navbar>; </Navbar>;
}, },
uiItems : function() { renderUiItems : function() {
// console.log(JSON.stringify(this.props.uiItems)); // console.log(JSON.stringify(this.props.uiItems));
const result = <> return <>
<h1>Account Information <i className='fas fa-user'></i></h1> <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>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 || '-'}</p>
@@ -52,12 +52,10 @@ const AccountPage = createClass({
<p><strong>Linked to Google: </strong> {this.props.uiItems.googleId ? 'YES' : 'NO'}</p> <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> : '' } {this.props.uiItems.googleId ? <p><strong>Brews on Google Drive: </strong> {this.props.uiItems.fileCount || '-'}</p> : '' }
</>; </>;
return result;
}, },
render : function(){ render : function(){
return <UIPage brew={this.props.brew} uiItems={this.uiItems()} ></UIPage>; return <UIPage brew={this.props.brew} uiItems={this.renderUiItems()} ></UIPage>;
} }
}); });