mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-13 21:42:45 +00:00
Stubbed out a userpage
This commit is contained in:
@@ -135,7 +135,7 @@ const MetadataEditor = React.createClass({
|
|||||||
<label>publish</label>
|
<label>publish</label>
|
||||||
<div className='value'>
|
<div className='value'>
|
||||||
{this.renderPublish()}
|
{this.renderPublish()}
|
||||||
<small>Published homebrews will be publicly searchable (eventually...)</small>
|
<small>Published homebrews will be publicly viewable and searchable (eventually...)</small>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ const CreateRouter = require('pico-router').createRouter;
|
|||||||
|
|
||||||
const HomePage = require('./pages/homePage/homePage.jsx');
|
const HomePage = require('./pages/homePage/homePage.jsx');
|
||||||
const EditPage = require('./pages/editPage/editPage.jsx');
|
const EditPage = require('./pages/editPage/editPage.jsx');
|
||||||
|
const UserPage = require('./pages/userPage/userPage.jsx');
|
||||||
const SharePage = require('./pages/sharePage/sharePage.jsx');
|
const SharePage = require('./pages/sharePage/sharePage.jsx');
|
||||||
const NewPage = require('./pages/newPage/newPage.jsx');
|
const NewPage = require('./pages/newPage/newPage.jsx');
|
||||||
const ErrorPage = require('./pages/errorPage/errorPage.jsx');
|
const ErrorPage = require('./pages/errorPage/errorPage.jsx');
|
||||||
@@ -50,9 +51,11 @@ const Homebrew = React.createClass({
|
|||||||
id={args.id}
|
id={args.id}
|
||||||
brew={this.props.brew} />
|
brew={this.props.brew} />
|
||||||
},
|
},
|
||||||
'/changelog' : (args) => {
|
'/user/:username' : (args) => {
|
||||||
return <SharePage
|
return <UserPage
|
||||||
brew={{title : 'Changelog', text : this.props.changelog}} />
|
username={args.username}
|
||||||
|
brews={this.props.brews}
|
||||||
|
/>
|
||||||
},
|
},
|
||||||
'/print/:id' : (args, query) => {
|
'/print/:id' : (args, query) => {
|
||||||
return <PrintPage brew={this.props.brew} query={query}/>;
|
return <PrintPage brew={this.props.brew} query={query}/>;
|
||||||
@@ -63,6 +66,10 @@ const Homebrew = React.createClass({
|
|||||||
'/new' : (args) => {
|
'/new' : (args) => {
|
||||||
return <NewPage />
|
return <NewPage />
|
||||||
},
|
},
|
||||||
|
'/changelog' : (args) => {
|
||||||
|
return <SharePage
|
||||||
|
brew={{title : 'Changelog', text : this.props.changelog}} />
|
||||||
|
},
|
||||||
'*' : <HomePage
|
'*' : <HomePage
|
||||||
welcomeText={this.props.welcomeText} />,
|
welcomeText={this.props.welcomeText} />,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -49,12 +49,14 @@ const NewPage = React.createClass({
|
|||||||
|
|
||||||
handleControlKeys : function(e){
|
handleControlKeys : function(e){
|
||||||
if(!(e.ctrlKey || e.metaKey)) return;
|
if(!(e.ctrlKey || e.metaKey)) return;
|
||||||
e.stopPropagation();
|
|
||||||
e.preventDefault();
|
|
||||||
const S_KEY = 83;
|
const S_KEY = 83;
|
||||||
const P_KEY = 80;
|
const P_KEY = 80;
|
||||||
if(e.keyCode == S_KEY) this.save();
|
if(e.keyCode == S_KEY) this.save();
|
||||||
if(e.keyCode == P_KEY) this.print();
|
if(e.keyCode == P_KEY) this.print();
|
||||||
|
if(e.keyCode == P_KEY || e.keyCode == S_KEY){
|
||||||
|
e.stopPropagation();
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
handleSplitMove : function(){
|
handleSplitMove : function(){
|
||||||
|
|||||||
35
client/homebrew/pages/userPage/userPage.jsx
Normal file
35
client/homebrew/pages/userPage/userPage.jsx
Normal 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;
|
||||||
5
client/homebrew/pages/userPage/userPage.less
Normal file
5
client/homebrew/pages/userPage/userPage.less
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
.userPage{
|
||||||
|
.content .phb{
|
||||||
|
margin: 20px auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -117,8 +117,6 @@ app.get('/print/:id', (req, res, next)=>{
|
|||||||
|
|
||||||
//Render Page
|
//Render Page
|
||||||
app.use((req, res) => {
|
app.use((req, res) => {
|
||||||
|
|
||||||
console.log('user', req.account);
|
|
||||||
vitreumRender({
|
vitreumRender({
|
||||||
page: './build/homebrew/bundle.dot',
|
page: './build/homebrew/bundle.dot',
|
||||||
globals:{
|
globals:{
|
||||||
|
|||||||
Reference in New Issue
Block a user