1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-22 09:23:13 +01:00

Add route class names to prize app

This commit is contained in:
Brett Sun 2016-02-01 14:52:05 +01:00
parent 39417f3d11
commit 4e13376d5f
3 changed files with 10 additions and 4 deletions

View File

@ -1,6 +1,7 @@
'use strict';
import React from 'react';
import classNames from 'classnames';
import EventActions from '../../../../actions/event_actions';
@ -63,6 +64,10 @@ let PRApp = React.createClass({
const { currentUser } = this.state;
const subdomain = getSubdomain();
// The second element of routes is always the active component object, where we can
// extract the path.
const path = routes[1] ? routes[1].path : null;
let style = {};
let header;
if (currentUser && currentUser.email && history.isActive(`/pieces/${getCookie(currentUser.email)}`)) {
@ -77,7 +82,7 @@ let PRApp = React.createClass({
return (
<div
style={style}
className={'ascribe-prize-app'}>
className={classNames('ascribe-prize-app', `route--${(path ? path.split('/')[0] : 'landing')}`)}>
{header}
<div className="container ascribe-body">
{/* Routes are injected here */}

View File

@ -1,6 +1,7 @@
'use strict';
import React from 'react';
import classNames from 'classnames';
import Hero from './components/prize_hero';
@ -27,7 +28,7 @@ let PrizeApp = React.createClass({
// The second element of routes is always the active component object, where we can
// extract the path.
let path = routes[1] ? routes[1].path : null;
const path = routes[1] ? routes[1].path : null;
let header = null;
// if the path of the current activeRoute is not defined, then this is the IndexRoute
@ -38,7 +39,7 @@ let PrizeApp = React.createClass({
}
return (
<div className="ascribe-prize-app">
<div className={classNames('ascribe-prize-app', `route--${(path ? path.split('/')[0] : 'landing')}`)}>
{header}
<div className="container ascribe-body">
{/* Routes are injected here */}

View File

@ -26,7 +26,7 @@ let WalletApp = React.createClass({
// The second element of routes is always the active component object, where we can
// extract the path.
let path = routes[1] ? routes[1].path : null;
const path = routes[1] ? routes[1].path : null;
let header = null;
// if the path of the current activeRoute is not defined, then this is the IndexRoute