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:
parent
f8b87a8849
commit
b52d000ac7
@ -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>;
|
||||
|
@ -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 (
|
||||
|
Loading…
Reference in New Issue
Block a user