1
0
mirror of https://github.com/ascribe/onion.git synced 2024-06-16 09:33:16 +02:00

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 50d50c66ee
commit 8527627db0
6 changed files with 14 additions and 4 deletions

View File

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

View File

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

View File

@ -5,8 +5,12 @@ import React from 'react';
import { getLangText } from '../utils/lang_utils'; import { getLangText } from '../utils/lang_utils';
let Footer = React.createClass({ let Footer = React.createClass({
propTypes: {
activeRoute: React.PropTypes.object.isRequired
},
render() { render() {
return ( return !this.props.activeRoute.hideFooter ? (
<div className="ascribe-footer hidden-print"> <div className="ascribe-footer hidden-print">
<p className="ascribe-sub-sub-statement"> <p className="ascribe-sub-sub-statement">
<br /> <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> <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> </p>
</div> </div>
); ) : null;
} }
}); });

View File

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

View File

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

View File

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