trc-client-core
Version:
The core of the TRC Client
68 lines (59 loc) • 3.53 kB
JSX
import React from 'react';
import {Route, IndexRoute} from 'react-router';
import ToyotaLinkHomeView from 'react-router-proxy!trc-client-core/src/product/ToyotaLinkHomeView';
import ToyotaLinkVideoPageView from 'react-router-proxy!trc-client-core/src/product/ToyotaLinkVideoPageView';
import ToyotaLinkFAQPageView from 'react-router-proxy!trc-client-core/src/product/ToyotaLinkFAQPageView';
import ProductHomeView from 'react-router-proxy!trc-client-core/src/product/ProductHomeView';
import LexusEnform from 'react-router-proxy!trc-client-core/src/product/LexusEnform';
import ToyotaEdge from 'react-router-proxy!trc-client-core/src/product/ToyotaEdge';
import ProductTrainers from 'react-router-proxy!trc-client-core/src/product/ProductTrainers';
import ProductMainHandler from 'react-router-proxy!trc-client-core/src/product/ProductMainHandler';
import ProductVehicles from 'react-router-proxy!trc-client-core/src/product/ProductVehicles';
import ProductVehicle from 'react-router-proxy!trc-client-core/src/product/ProductVehicle';
import ProductVehicleHandler from 'react-router-proxy!trc-client-core/src/product/ProductVehicleHandler';
import ProductFactSheetHandler from 'react-router-proxy!trc-client-core/src/product/ProductFactSheetHandler';
import ProductFactSheet from 'react-router-proxy!trc-client-core/src/product/ProductFactSheet';
import ProductFactSheetHome from 'react-router-proxy!trc-client-core/src/product/ProductFactSheetHome';
import QuestionsTable from 'react-router-proxy!trc-client-core/src/qanda/QuestionsTable';
import QandaHomeView from 'react-router-proxy!trc-client-core/src/qanda/QandaHomeView';
import QuestionPage from 'react-router-proxy!trc-client-core/src/qanda/QuestionPage';
import EditQuestion from 'react-router-proxy!trc-client-core/src/qanda/editQuestion';
import UserStore from 'trc-client-core/src/user/UserStore';
import VideoView from 'trc-client-core/src/media/VideoView';
function LexusEnformRoutes() {
if (UserStore.get('site') === 'LEXUS') {
return <Route path="lexus-enform" component={LexusEnform}>
<Route path=":id" component={VideoView} />
</Route>
}
}
export default <Route path="product">
<Route component={ProductMainHandler}>
<Route path="trainers" components={ProductTrainers}/>
<Route path="vehicles" components={ProductVehicleHandler}>
<IndexRoute components={ProductVehicles}/>
</Route>
<Route path="factsheet" components={ProductFactSheetHandler}>
<Route path=":id" components={ProductFactSheet}/>
<IndexRoute component={ProductFactSheetHome}/>
</Route>
<IndexRoute component={ProductHomeView}/>
</Route>
<Route path="vehicles/:id" components={ProductVehicleHandler}>
<IndexRoute components={ProductVehicle}/>
<Route path="/product/the-toyota-edge" component={ToyotaEdge}/>
<Route path="/product/toyotalink">
<Route path="videos/:pageId" component={ToyotaLinkVideoPageView}/>
<Route path="faq/:pageId" component={ToyotaLinkFAQPageView}/>
<IndexRoute component={ToyotaLinkHomeView}/>
</Route>
</Route>
{LexusEnformRoutes()}
<Route path="qanda">
<Route path="edit" component={QuestionsTable}/>
<Route path="edit/:id" component={EditQuestion}/>
<Route path="new_question" component={EditQuestion}/>
<Route path=":id" component={QuestionPage}/>
<IndexRoute component={QandaHomeView}/>
</Route>
</Route>