Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

AppRoutes.js 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. } from './constants/pages';
  14. import LoginPage from './pages/LoginPage/LoginPageMUI';
  15. import HomePage from './pages/HomePage/HomePageMUI';
  16. import NotFoundPage from './pages/ErrorPages/NotFoundPage';
  17. import ErrorPage from './pages/ErrorPages/ErrorPage';
  18. import ForgotPasswordPage from './pages/ForgotPasswordPage/ForgotPasswordPageMUI';
  19. import PrivateRoute from './components/Router/PrivateRoute';
  20. import MailSent from './pages/ForgotPasswordPage/ForgotPasswordMailSent/MailSent';
  21. import Register from './pages/RegisterPages/Register/Register';
  22. import RegisterSuccessful from './pages/RegisterPages/RegisterSuccessful.js/RegisterSuccessful';
  23. const AppRoutes = () => {
  24. return (
  25. <Switch>
  26. <Route exact path={BASE_PAGE} component={LoginPage} />
  27. <Route exact path={LOGIN_PAGE} component={LoginPage} />
  28. <Route path={NOT_FOUND_PAGE} component={NotFoundPage} />
  29. <Route path={REGISTER_SUCCESSFUL_PAGE} component={RegisterSuccessful} />
  30. <Route path={REGISTER_PAGE} component={Register} />
  31. <Route path={ERROR_PAGE} component={ErrorPage} />
  32. <Route path={FORGOT_PASSWORD_MAIL_SENT} component={MailSent} />
  33. <Route path={FORGOT_PASSWORD_PAGE} component={ForgotPasswordPage} />
  34. <PrivateRoute
  35. exact
  36. path={HOME_PAGE}
  37. component={HomePage}
  38. />
  39. <Redirect from="*" to={NOT_FOUND_PAGE} />
  40. </Switch>
  41. )};
  42. export default AppRoutes;