ModusCreateOrg/budgeting

View on GitHub
app/containers/App/index.js

Summary

Maintainability
A
0 mins
Test Coverage
// @flow
import * as React from 'react';
import { Switch, Route, Redirect } from 'react-router-dom';

import ErrorBoundary from 'components/ErrorBoundary';
import Header from 'components/Header';
import Budget from 'routes/Budget';
import Reports from 'routes/Reports';
import './style.scss';

const AppError = React.lazy(() => import('components/AppError' /* webpackChunkName: "error-msg" */));

const App = () => (
  <ErrorBoundary fallbackComponent={AppError}>
    <main>
      <Header />

      <Switch>
        <Route path="/budget" component={Budget} />
        <Route path="/reports" component={Reports} />
        <Redirect to="/budget" />
      </Switch>
    </main>
  </ErrorBoundary>
);

export default App;