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:
@@ -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>
|
||||
|
||||
|
||||
@@ -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} />,
|
||||
});
|
||||
|
||||
@@ -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(){
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user