App.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import {Router, Route} from 'react-router-dom';
  2. import createHistory from "history/createBrowserHistory";
  3. import MainPage from "./pages/MainPage";
  4. import Page404 from "./pages/404Page";
  5. import ContactPage from "./pages/ContactPage";
  6. import Switch from "react-router-dom/es/Switch";
  7. import PrivacyPolicy from "./pages/PrivacyPolicyPage";
  8. import FAQPage from "./pages/FAQPage";
  9. import OurTeamPage from "./pages/OurTeamPage";
  10. import AboutUsPage from "./pages/AboutUsPage";
  11. import {Provider} from "react-redux";
  12. import MyAccountPage from "./pages/MyAccountPage";
  13. import {store} from "./reducers";
  14. import ProfilePage from "./pages/ProfilePage";
  15. import CatalogPage from "./pages/CatalogPage";
  16. import Header from "./components/Header";
  17. import Footer from "./components/Footer";
  18. import ProductPage from "./pages/ProductPage";
  19. const history = createHistory();
  20. function App() {
  21. return (
  22. <Router history={history}>
  23. <Provider store={store}>
  24. <Header/>
  25. <Switch>
  26. <Route path="/" component={MainPage} exact/>
  27. <Route path="/catalog" component={CatalogPage} />
  28. <Route path="/good" component={ProductPage} />
  29. <Route path="/about-us" component={AboutUsPage} />
  30. <Route path="/our-team" component={OurTeamPage} />
  31. <Route path="/faq" component={FAQPage} />
  32. <Route path="/contact" component={ContactPage} />
  33. <Route path="/my-account" component={MyAccountPage} />
  34. <Route path="/privacy-policy" component={PrivacyPolicy} />
  35. <Route path="/profile" component={ProfilePage} />
  36. <Route path="*" component={Page404} />
  37. </Switch>
  38. <Footer/>
  39. </Provider>
  40. </Router>
  41. )
  42. }
  43. export default App;