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.

48 lines
1.7 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. import React from "react";
  2. import { Switch, Route } from "react-router-dom";
  3. import Home from "./components/views/Home";
  4. import CreateElection from "./components/views/CreateElection";
  5. import Vote from "./components/views/Vote";
  6. import Result from "./components/views/Result";
  7. import UnknownView from "./components/views/UnknownView";
  8. import UnknownElection from "./components/views/UnknownElection";
  9. import CreateSuccess from "./components/views/CreateSuccess";
  10. import VoteSuccess from "./components/views/VoteSuccess";
  11. import LegalNotices from "./components/views/LegalNotices";
  12. import PrivacyPolicy from "./components/views/PrivacyPolicy";
  13. import Faq from "./components/views/Faq";
  14. function Routes() {
  15. return (
  16. <main className="d-flex flex-column justify-content-center">
  17. <Switch>
  18. <Route exact path="/" component={Home} />
  19. <Route path="/create-election" component={CreateElection} />
  20. <Route path="/vote/:slug" component={Vote} />
  21. <Route path="/result/:slug" component={Result} />
  22. <Route
  23. path="/link/:slug"
  24. component={props => (
  25. <CreateSuccess invitationOnly={true} {...props} />
  26. )}
  27. />
  28. <Route
  29. path="/links/:slug"
  30. component={props => (
  31. <CreateSuccess invitationOnly={false} {...props} />
  32. )}
  33. />
  34. <Route path="/vote-success/:slug" component={VoteSuccess} />
  35. <Route path="/unknown-election/:slug" component={UnknownElection} />
  36. <Route path="/legal-notices" component={LegalNotices} />
  37. <Route path="/privacy-policy" component={PrivacyPolicy} />
  38. <Route path="/faq" component={Faq} />
  39. <Route component={UnknownView} />
  40. </Switch>
  41. </main>
  42. );
  43. }
  44. export default Routes;