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()) {
|
if(!UserStore.isLoading()) {
|
||||||
const { currentUser } = this.state;
|
const { currentUser } = this.state;
|
||||||
const { query } = this.props.location;
|
const { query } = this.props.location;
|
||||||
|
|
||||||
for(let i = 0; i < redirectFunctions.length; i++) {
|
for(let i = 0; i < redirectFunctions.length; i++) {
|
||||||
// if a redirectFunction redirects the user,
|
// if a redirectFunction redirects the user,
|
||||||
// it should return `true` and therefore
|
// it should return `true` and therefore
|
||||||
|
@ -55,10 +55,11 @@ let Header = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
UserActions.fetchCurrentUser();
|
|
||||||
UserStore.listen(this.onChange);
|
UserStore.listen(this.onChange);
|
||||||
WhitelabelActions.fetchWhitelabel();
|
UserActions.fetchCurrentUser.defer();
|
||||||
|
|
||||||
WhitelabelStore.listen(this.onChange);
|
WhitelabelStore.listen(this.onChange);
|
||||||
|
WhitelabelActions.fetchWhitelabel.defer();
|
||||||
|
|
||||||
// react-bootstrap 0.25.1 has a bug in which it doesn't
|
// react-bootstrap 0.25.1 has a bug in which it doesn't
|
||||||
// close the mobile expanded navigation after a click by itself.
|
// close the mobile expanded navigation after a click by itself.
|
||||||
@ -223,7 +224,7 @@ let Header = React.createClass({
|
|||||||
{this.getPoweredBy()}
|
{this.getPoweredBy()}
|
||||||
</Nav>
|
</Nav>
|
||||||
<Nav navbar right>
|
<Nav navbar right>
|
||||||
<HeaderNotificationDebug show = {false}/>
|
<HeaderNotificationDebug show={false}/>
|
||||||
{account}
|
{account}
|
||||||
{signup}
|
{signup}
|
||||||
</Nav>
|
</Nav>
|
||||||
|
@ -41,7 +41,7 @@ let PRApp = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { history, children } = this.props;
|
const { history, children, routes } = this.props;
|
||||||
const { currentUser } = this.state;
|
const { currentUser } = this.state;
|
||||||
let style = {};
|
let style = {};
|
||||||
let subdomain = getSubdomain();
|
let subdomain = getSubdomain();
|
||||||
@ -51,8 +51,8 @@ let PRApp = React.createClass({
|
|||||||
if (currentUser && currentUser.email && history.isActive(`/pieces/${getCookie(currentUser.email)}`)) {
|
if (currentUser && currentUser.email && history.isActive(`/pieces/${getCookie(currentUser.email)}`)) {
|
||||||
header = <Hero />;
|
header = <Hero />;
|
||||||
style = { paddingTop: '0 !important' };
|
style = { paddingTop: '0 !important' };
|
||||||
} else if(history.isActive('/collection') || history.isActive('/settings')) {
|
} else if(currentUser && (currentUser.is_admin || currentUser.is_jury || currentUser.is_judge)) {
|
||||||
header = <Header />;
|
header = <Header routes={routes} showAddWork={false} />;
|
||||||
} else {
|
} else {
|
||||||
style = { paddingTop: '0 !important' };
|
style = { paddingTop: '0 !important' };
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user