mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 17:33:14 +01:00
Add header to jury, judge and admin role
This commit is contained in:
parent
e427429263
commit
7e5662676c
@ -101,6 +101,7 @@ export function ProxyHandler(...redirectFunctions) {
|
||||
if(!UserStore.isLoading()) {
|
||||
const { currentUser } = this.state;
|
||||
const { query } = this.props.location;
|
||||
|
||||
for(let i = 0; i < redirectFunctions.length; i++) {
|
||||
// if a redirectFunction redirects the user,
|
||||
// it should return `true` and therefore
|
||||
|
@ -55,10 +55,11 @@ let Header = React.createClass({
|
||||
},
|
||||
|
||||
componentDidMount() {
|
||||
UserActions.fetchCurrentUser();
|
||||
UserStore.listen(this.onChange);
|
||||
WhitelabelActions.fetchWhitelabel();
|
||||
UserActions.fetchCurrentUser.defer();
|
||||
|
||||
WhitelabelStore.listen(this.onChange);
|
||||
WhitelabelActions.fetchWhitelabel.defer();
|
||||
|
||||
// react-bootstrap 0.25.1 has a bug in which it doesn't
|
||||
// close the mobile expanded navigation after a click by itself.
|
||||
@ -223,7 +224,7 @@ let Header = React.createClass({
|
||||
{this.getPoweredBy()}
|
||||
</Nav>
|
||||
<Nav navbar right>
|
||||
<HeaderNotificationDebug show = {false}/>
|
||||
<HeaderNotificationDebug show={false}/>
|
||||
{account}
|
||||
{signup}
|
||||
</Nav>
|
||||
|
@ -41,7 +41,7 @@ let PRApp = React.createClass({
|
||||
},
|
||||
|
||||
render() {
|
||||
const { history, children } = this.props;
|
||||
const { history, children, routes } = this.props;
|
||||
const { currentUser } = this.state;
|
||||
let style = {};
|
||||
let subdomain = getSubdomain();
|
||||
@ -51,8 +51,8 @@ let PRApp = React.createClass({
|
||||
if (currentUser && currentUser.email && history.isActive(`/pieces/${getCookie(currentUser.email)}`)) {
|
||||
header = <Hero />;
|
||||
style = { paddingTop: '0 !important' };
|
||||
} else if(history.isActive('/collection') || history.isActive('/settings')) {
|
||||
header = <Header />;
|
||||
} else if(currentUser && (currentUser.is_admin || currentUser.is_jury || currentUser.is_judge)) {
|
||||
header = <Header routes={routes} showAddWork={false} />;
|
||||
} else {
|
||||
style = { paddingTop: '0 !important' };
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user