You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

AppRoutes.js 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import React from 'react';
  2. import { Redirect, Route, Switch } from 'react-router-dom';
  3. import {
  4. LOGIN_PAGE,
  5. HOME_PAGE,
  6. FORGOT_PASSWORD_PAGE,
  7. NOT_FOUND_PAGE,
  8. ERROR_PAGE,
  9. BASE_PAGE,
  10. FORGOT_PASSWORD_MAIL_SENT,
  11. REGISTER_PAGE,
  12. REGISTER_SUCCESSFUL_PAGE,
  13. RESET_PASSWORD_PAGE,
  14. CREATE_OFFER_PAGE,
  15. ITEM_DETAILS_PAGE
  16. } from './constants/pages';
  17. import LoginPage from './pages/LoginPage/LoginPageMUI';
  18. import HomePage from './pages/HomePage/HomePageMUI';
  19. import NotFoundPage from './pages/ErrorPages/NotFoundPage';
  20. import ErrorPage from './pages/ErrorPages/ErrorPage';
  21. import ForgotPasswordPage from './pages/ForgotPasswordPage/ForgotPasswordPageMUI';
  22. import PrivateRoute from './components/Router/PrivateRoute';
  23. import MailSent from './pages/ForgotPasswordPage/ForgotPasswordMailSent/MailSent';
  24. import Register from './pages/RegisterPages/Register/Register';
  25. import RegisterSuccessful from './pages/RegisterPages/RegisterSuccessful.js/RegisterSuccessful';
  26. import ResetPasswordPage from './pages/ResetPasswordPage/ResetPasswordPage';
  27. import CreateOffer from './pages/CreateOffer/CreateOffer';
  28. import ItemDetailsPage from './pages/ItemDetailsPage/ItemDetailsPageMUI';
  29. const AppRoutes = () => {
  30. return (
  31. <Switch>
  32. <Route exact path={BASE_PAGE} component={LoginPage} />
  33. <Route exact path={LOGIN_PAGE} component={LoginPage} />
  34. <Route path={NOT_FOUND_PAGE} component={NotFoundPage} />
  35. <Route path={REGISTER_SUCCESSFUL_PAGE} component={RegisterSuccessful} />
  36. <Route path={REGISTER_PAGE} component={Register} />
  37. <Route path={ERROR_PAGE} component={ErrorPage} />
  38. <Route path={FORGOT_PASSWORD_MAIL_SENT} component={MailSent} />
  39. <Route path={FORGOT_PASSWORD_PAGE} component={ForgotPasswordPage} />
  40. <Route path={RESET_PASSWORD_PAGE} component={ResetPasswordPage}/>
  41. <Route path={CREATE_OFFER_PAGE} component={CreateOffer}/>
  42. <Route path={ITEM_DETAILS_PAGE} component={ItemDetailsPage} />
  43. <PrivateRoute
  44. exact
  45. path={HOME_PAGE}
  46. component={HomePage}
  47. />
  48. <Redirect from="*" to={NOT_FOUND_PAGE} />
  49. </Switch>
  50. )};
  51. export default AppRoutes;