Hide the footer if a route has the `hideFooter` attribute

This commit is contained in:
Brett Sun 2016-02-01 14:49:48 +01:00
parent 764f81925b
commit e616576fa5
6 changed files with 14 additions and 4 deletions

View File

@ -4,7 +4,6 @@ import React from 'react';
import classNames from 'classnames';
import { History } from 'react-router';
import Footer from './footer';
import GlobalNotification from './global_notification';
import AppConstants from '../constants/application_constants';
@ -48,7 +47,6 @@ export default function AppBase(App) {
return (
<div>
<Footer />
<App
{...this.props}
activeRoute={activeRoute} />

View File

@ -3,6 +3,7 @@
import React from 'react';
import AppBase from './app_base';
import Footer from './footer';
import Header from './header';
@ -23,6 +24,7 @@ let AscribeApp = React.createClass({
{/* Routes are injected here */}
{children}
</div>
<Footer activeRoute={activeRoute} />
</div>
);
}

View File

@ -5,8 +5,12 @@ import React from 'react';
import { getLangText } from '../utils/lang_utils';
let Footer = React.createClass({
propTypes: {
activeRoute: React.PropTypes.object.isRequired
},
render() {
return (
return !this.props.activeRoute.hideFooter ? (
<div className="ascribe-footer hidden-print">
<p className="ascribe-sub-sub-statement">
<br />
@ -24,7 +28,7 @@ let Footer = React.createClass({
<a href="https://www.linkedin.com/company/4816284?trk=vsrp_companies_res_name&trkInfo=VSRPsearchId%3A122827941425632318075%2CVSRPtargetId%3A4816284%2CVSRPcmpt%3Aprimary" className="social social-linked-in" target="_blank"></a>
</p>
</div>
);
) : null;
}
});

View File

@ -11,6 +11,7 @@ import UserActions from '../../../../actions/user_actions';
import Hero from './components/pr_hero';
import AppBase from '../../../app_base';
import Footer from '../../../footer';
import Header from '../../../header';
import { getSubdomain } from '../../../../utils/general_utils';
@ -85,6 +86,7 @@ let PRApp = React.createClass({
{/* Routes are injected here */}
{children}
</div>
<Footer activeRoute={activeRoute} />
</div>
);
}

View File

@ -6,6 +6,7 @@ import classNames from 'classnames';
import Hero from './components/prize_hero';
import AppBase from '../../../app_base';
import Footer from '../../../footer';
import Header from '../../../header';
import { getSubdomain } from '../../../../utils/general_utils';
@ -42,6 +43,7 @@ let PrizeApp = React.createClass({
{/* Routes are injected here */}
{children}
</div>
<Footer activeRoute={activeRoute} />
</div>
);
}

View File

@ -4,6 +4,7 @@ import React from 'react';
import classNames from 'classnames';
import AppBase from '../../app_base';
import Footer from '../../footer';
import Header from '../../header';
import { getSubdomain } from '../../../utils/general_utils';
@ -43,6 +44,7 @@ let WalletApp = React.createClass({
{/* Routes are injected here */}
{children}
</div>
<Footer activeRoute={activeRoute} />
</div>
);
}