UNPKG

@kiwicom/smart-faq

Version:

36 lines (30 loc) 864 B
// @flow import { Route, Switch } from 'react-router-dom'; import * as React from 'react'; import Intro from './IntroPage/index'; import ContentPage from './common/layout/ContentPage'; import QueryParamRouter from './helpers/QueryParamRouter'; type Props = {| isOpen: boolean, onToggle: (shouldBeOpened: boolean) => void, openArticle: ?string, |}; const Routes = ({ isOpen, onToggle, openArticle }: Props) => { return ( <QueryParamRouter isOpen={isOpen} onToggle={onToggle} openArticle={openArticle} > <Switch> <Route exact path="/" component={Intro} /> <Route exact path="/faq/:categoryId?" component={ContentPage} /> <Route path="/faq/:categoryId/article/:articleId" component={ContentPage} /> </Switch> </QueryParamRouter> ); }; export default Routes;