trc-client-core
Version:
The core of the TRC Client
51 lines (46 loc) • 1.76 kB
JSX
import React from 'react';
import ModalManagerView from 'trc-client-core/src/Modal/ModalManagerView';
import LoadingManagerView from 'trc-client-core/src/components/LoadingManagerView';
import Footer from 'trc-client-core/src/components/Footer';
import Navigation from 'trc-client-core/src/components/Navigation';
import Wrapper from 'trc-client-core/src/components/Wrapper';
import NavigationHeadingUser from 'trc-client-core/src/components/NavigationHeadingUser';
import UserStore from 'trc-client-core/src/user/UserStore';
import Permissions from 'trc-client-core/src/user/Permissions';
import Page from 'trc-client-core/src/components/Page';
var AppHandler = React.createClass({
displayName: 'AppHandler',
getName() {
return (UserStore.get('site') === 'TOYOTA') ? 'TIA' : 'Lexus Academy';
},
render() {
return (
<div>
<ModalManagerView/>
<LoadingManagerView/>
{this.renderViewModes()}
</div>
);
},
renderViewModes() {
var {routes} = this.props;
switch(routes[routes.length - 1].view) {
case 'distractionFree':
return <div>
{this.props.children}
</div>
default:
return <Wrapper pathname={this.props.location.pathname}>
<div className="NavigationView">
<NavigationHeadingUser/>
<Navigation/>
</div>
<div className="l-content content-main">
{this.props.children}
</div>
<Footer/>
</Wrapper>
}
}
});
export default AppHandler;