Skip to content
This repository was archived by the owner on Jun 8, 2026. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions BOILERPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@ To match a URL to a specific page (i.e. you want to add a contacts page), you mu

React Router Docs : https://reacttraining.com/react-router/web/guides/quick-start



```js
export default withRouter(connect(mapStateToProps, mapActionsToProps)(TopButtonBar));
```

> From `/src/components/HomePage/TopButtonBar.js`

## Material UI

The Visual components used in this project come from `material-ui` framework, which provides many web elements and utilities to allow an easier and more responsive development of an UI/UX with Material Design styles.
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 19 additions & 11 deletions src/AppRouter.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
import React from "react";
/* istanbul ignore file */
// ReactDOMServer does not support Suspense for now, so ignoring coverage

import React, { Suspense } from "react";
import { BrowserRouter, Switch, Route } from "react-router-dom";
import HomePage from "./pages/HomePage";
import NotFound from "./pages/NotFound";
import { LinearProgress } from "@material-ui/core";

const HomePage = React.lazy(() => import("./pages/HomePage"));
const NotFound = React.lazy(() => import("./pages/NotFound"));

const AppRouter = () => (
<BrowserRouter basename={`${process.env.REACT_APP_BASE_ROUTE || "/"}`}>
<Switch>
<Route
exact
path="/"
component={HomePage}
/>
<Route component={NotFound} />
</Switch>
<Suspense fallback={<LinearProgress color="secondary"/>}>
<Switch>
<Route exact path="/">
<HomePage />
</Route>
<Route>
<NotFound />
</Route>
</Switch>
</Suspense>
</BrowserRouter>
);


export default AppRouter;
3 changes: 1 addition & 2 deletions src/AppRouter.spec.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import React from "react";
import AppRouter from "./AppRouter";
import { Route } from "react-router-dom";
import HomePage from "./pages/HomePage";

describe("AppRouter", () => {
it("should have a landing route", () => {
const firstRoute = shallow(<AppRouter />).find(Route).first();
expect(firstRoute.prop("path")).toEqual("/");
expect(firstRoute.prop("exact")).toBe(true);
expect(firstRoute.prop("component")).toEqual(HomePage);
// expect(firstRoute.find(HomePage).exists()).toBe(true);
});
});