@kiwicom/smart-faq
Version:
Smart FAQ
44 lines (39 loc) • 969 B
JavaScript
// @flow
import React from 'react';
import Head from 'next/head';
import { Switch, Route, withRouter } from 'react-router-dom';
import Article from '../shared/StaticFAQ/ArticleDetail/Article';
import FAQCategoryList from '../shared/StaticFAQ/FAQCategoryList';
const ArticlePage = ({ match }) => (
<>
<Head>
<title>My page title</title>
</Head>
<div>
<Article match={match} />
</div>
</>
);
const Index = ({ history }) => (
<>
<Switch location={history.location}>
<Route exact path="/faq" component={FAQCategoryList} />
<Route
exact
path="/faq/:categoryId"
component={() => <div>just a category</div>}
/>
<Route
exact
path="/faq/:categoryId/article/:articleId"
component={ArticlePage}
/>
<Route
component={() => {
return <div>404 - Not found</div>;
}}
/>
</Switch>
</>
);
export default withRouter(Index);