1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 01:25:17 +01:00

made add work conditional

This commit is contained in:
Tim Daubenschütz 2015-07-14 21:06:11 +02:00
parent f8b87a8849
commit b52d000ac7
2 changed files with 12 additions and 2 deletions

View File

@ -27,8 +27,18 @@ import { getLangText } from '../utils/lang_utils';
let Header = React.createClass({
propTypes: {
showAddWork: React.PropTypes.bool
},
mixins: [Router.Navigation, Router.State],
getDefaultProps() {
return {
showAddWork: true
};
},
getInitialState() {
return mergeOptions(WhitelabelStore.getState(), UserStore.getState());
},
@ -96,7 +106,7 @@ let Header = React.createClass({
);
collection = <NavItemLink to="pieces" query={this.getQuery()}>{getLangText('COLLECTION')}</NavItemLink>;
addNewWork = <NavItemLink to="register_piece">+ {getLangText('NEW WORK')}</NavItemLink>;
addNewWork = this.props.showAddWork ? <NavItemLink to="register_piece">+ {getLangText('NEW WORK')}</NavItemLink> : null;
}
else {
account = <NavItemLink to="login">{getLangText('LOGIN')}</NavItemLink>;

View File

@ -17,7 +17,7 @@ let PrizeApp = React.createClass({
if (this.isActive('landing') || this.isActive('login') || this.isActive('signup')) {
header = <Hero />;
} else {
header = <Header />;
header = <Header showAddWork={false} />;
}
return (