1
0
mirror of https://github.com/stolksdorf/homebrewery.git synced 2025-12-12 23:45:57 +00:00

Stubbed out a userpage

This commit is contained in:
Scott Tolksdorf
2016-11-23 23:59:57 -05:00
parent 750f5c1330
commit 9e14872f06
6 changed files with 55 additions and 8 deletions

View File

@@ -135,7 +135,7 @@ const MetadataEditor = React.createClass({
<label>publish</label>
<div className='value'>
{this.renderPublish()}
<small>Published homebrews will be publicly searchable (eventually...)</small>
<small>Published homebrews will be publicly viewable and searchable (eventually...)</small>
</div>
</div>

View File

@@ -6,6 +6,7 @@ const CreateRouter = require('pico-router').createRouter;
const HomePage = require('./pages/homePage/homePage.jsx');
const EditPage = require('./pages/editPage/editPage.jsx');
const UserPage = require('./pages/userPage/userPage.jsx');
const SharePage = require('./pages/sharePage/sharePage.jsx');
const NewPage = require('./pages/newPage/newPage.jsx');
const ErrorPage = require('./pages/errorPage/errorPage.jsx');
@@ -50,9 +51,11 @@ const Homebrew = React.createClass({
id={args.id}
brew={this.props.brew} />
},
'/changelog' : (args) => {
return <SharePage
brew={{title : 'Changelog', text : this.props.changelog}} />
'/user/:username' : (args) => {
return <UserPage
username={args.username}
brews={this.props.brews}
/>
},
'/print/:id' : (args, query) => {
return <PrintPage brew={this.props.brew} query={query}/>;
@@ -63,6 +66,10 @@ const Homebrew = React.createClass({
'/new' : (args) => {
return <NewPage />
},
'/changelog' : (args) => {
return <SharePage
brew={{title : 'Changelog', text : this.props.changelog}} />
},
'*' : <HomePage
welcomeText={this.props.welcomeText} />,
});

View File

@@ -49,12 +49,14 @@ const NewPage = React.createClass({
handleControlKeys : function(e){
if(!(e.ctrlKey || e.metaKey)) return;
e.stopPropagation();
e.preventDefault();
const S_KEY = 83;
const P_KEY = 80;
if(e.keyCode == S_KEY) this.save();
if(e.keyCode == P_KEY) this.print();
if(e.keyCode == P_KEY || e.keyCode == S_KEY){
e.stopPropagation();
e.preventDefault();
}
},
handleSplitMove : function(){

View File

@@ -0,0 +1,35 @@
const React = require('react');
const _ = require('lodash');
const cx = require('classnames');
const Nav = require('naturalcrit/nav/nav.jsx');
const Navbar = require('../../navbar/navbar.jsx');
const UserPage = React.createClass({
getDefaultProps: function() {
return {
username : '',
brews : []
};
},
render : function(){
console.log(this.props.brews);
return <div className='userPage page'>
<Navbar>
<Nav.section>
holla
</Nav.section>
</Navbar>
<div className='content'>
<div className='phb'>
<h1>{this.props.username}</h1>
</div>
</div>
</div>
}
});
module.exports = UserPage;

View File

@@ -0,0 +1,5 @@
.userPage{
.content .phb{
margin: 20px auto;
}
}

View File

@@ -117,8 +117,6 @@ app.get('/print/:id', (req, res, next)=>{
//Render Page
app.use((req, res) => {
console.log('user', req.account);
vitreumRender({
page: './build/homebrew/bundle.dot',
globals:{