forked from naturalcrit/homebrewery
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into addUserInfo-naturalcrit#1908
- Loading branch information
Showing
7 changed files
with
236 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
const React = require('react'); | ||
const createClass = require('create-react-class'); | ||
const _ = require('lodash'); | ||
const cx = require('classnames'); | ||
const moment = require('moment'); | ||
|
||
const UIPage = require('../basePages/uiPage/uiPage.jsx'); | ||
|
||
const Nav = require('naturalcrit/nav/nav.jsx'); | ||
const Navbar = require('../../navbar/navbar.jsx'); | ||
|
||
const RecentNavItem = require('../../navbar/recent.navitem.jsx').both; | ||
const Account = require('../../navbar/account.navitem.jsx'); | ||
const NewBrew = require('../../navbar/newbrew.navitem.jsx'); | ||
const HelpNavItem = require('../../navbar/help.navitem.jsx'); | ||
|
||
const NaturalCritIcon = require('naturalcrit/svg/naturalcrit.svg.jsx'); | ||
|
||
const AccountPage = createClass({ | ||
displayName : 'AccountPage', | ||
getDefaultProps : function() { | ||
return { | ||
brew : {}, | ||
uiItems : {} | ||
}; | ||
}, | ||
getInitialState : function() { | ||
return { | ||
uiItems : this.props.uiItems | ||
}; | ||
}, | ||
|
||
renderNavItems : function() { | ||
return <Navbar> | ||
<Nav.section> | ||
<NewBrew /> | ||
<HelpNavItem /> | ||
<RecentNavItem /> | ||
<Account /> | ||
</Nav.section> | ||
</Navbar>; | ||
}, | ||
|
||
renderUiItems : function() { | ||
// console.log(this.props.uiItems); | ||
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}> | ||
{this.renderUiItems()} | ||
</UIPage>; | ||
} | ||
}); | ||
|
||
module.exports = AccountPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
require('./uiPage.less'); | ||
const React = require('react'); | ||
const createClass = require('create-react-class'); | ||
|
||
const Nav = require('naturalcrit/nav/nav.jsx'); | ||
const Navbar = require('../../../navbar/navbar.jsx'); | ||
const NewBrewItem = require('../../../navbar/newbrew.navitem.jsx'); | ||
const HelpNavItem = require('../../../navbar/help.navitem.jsx'); | ||
const RecentNavItem = require('../../../navbar/recent.navitem.jsx').both; | ||
const Account = require('../../../navbar/account.navitem.jsx'); | ||
|
||
|
||
const UIPage = createClass({ | ||
displayName : 'UIPage', | ||
|
||
render : function(){ | ||
return <div className='uiPage sitePage'> | ||
<Navbar> | ||
<Nav.section> | ||
<Nav.item className='brewTitle'>{this.props.brew.title}</Nav.item> | ||
</Nav.section> | ||
|
||
<Nav.section> | ||
<NewBrewItem /> | ||
<HelpNavItem /> | ||
<RecentNavItem /> | ||
<Account /> | ||
</Nav.section> | ||
</Navbar> | ||
|
||
<div className='content'> | ||
{this.props.children} | ||
</div> | ||
</div>; | ||
} | ||
}); | ||
|
||
module.exports = UIPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
.uiPage{ | ||
.content{ | ||
overflow-y : hidden; | ||
width : 90vw; | ||
background-color: #f0f0f0; | ||
font-family: 'Open Sans'; | ||
margin-left: auto; | ||
margin-right: auto; | ||
margin-top: 25px; | ||
padding: 2% 4%; | ||
font-size: 0.8em; | ||
line-height: 1.8em; | ||
.dataGroup{ | ||
padding: 6px 20px 15px; | ||
border: 2px solid black; | ||
border-radius: 5px; | ||
margin: 5px 0px; | ||
} | ||
h1, h2, h3, h4{ | ||
font-weight: 900; | ||
text-transform: uppercase; | ||
margin: 0.5em 30% 0.25em 0; | ||
border-bottom: 2px solid slategrey; | ||
} | ||
h1 { | ||
font-size: 2em; | ||
border-bottom: 2px solid darkslategrey; | ||
margin-bottom: 0.5em; | ||
margin-right: 0; | ||
} | ||
h2 { | ||
font-size: 1.75em; | ||
} | ||
h3 { | ||
font-size: 1.5em; | ||
svg { | ||
width: 19px; | ||
} | ||
} | ||
h4 { | ||
font-size: 1.25em; | ||
} | ||
strong { | ||
font-weight: bold; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters