App.js 801 B

12345678910111213141516171819202122232425
  1. import './App.scss';
  2. import {Router, Route, Link, Redirect} from 'react-router-dom';
  3. import createHistory from "history/createBrowserHistory";
  4. import MainPage from "./pages/MainPage";
  5. import Page404 from "./pages/404Page";
  6. import ContactPage from "./pages/ContactPage";
  7. import Switch from "react-router-dom/es/Switch";
  8. import PrivacyPolicy from "./pages/PrivacyPolicyPage";
  9. const history = createHistory();
  10. function App() {
  11. return (
  12. <Router history={history}>
  13. <Switch>
  14. <Route path="/" component={MainPage} exact/>
  15. <Route path="/contact" component={ContactPage} />
  16. <Route path="/privacy-policy" component={PrivacyPolicy} />
  17. <Route path="*" component={Page404} />
  18. </Switch>
  19. </Router>
  20. )
  21. }
  22. export default App;