index.tsx 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. import React from "react";
  2. import { BrowserRouter, Switch, Route } from "react-router-dom";
  3. import {
  4. AppBar,
  5. Calendar,
  6. Councils,
  7. Curation,
  8. Dashboard,
  9. Forum,
  10. Member,
  11. Members,
  12. Mint,
  13. Proposals,
  14. Proposal,
  15. Timeline,
  16. Tokenomics,
  17. Validators,
  18. Spending,
  19. Storage,
  20. Transactions,
  21. Bounties,
  22. Burners,
  23. ValidatorReport,
  24. } from "..";
  25. import { IState } from "../../types";
  26. interface IProps extends IState {
  27. toggleStar: (a: string) => void;
  28. toggleFooter: () => void;
  29. }
  30. const Routes = (props: IProps) => {
  31. const { reports, tokenomics } = props;
  32. return (
  33. <div>
  34. <BrowserRouter>
  35. <div style={{ flexGrow: 1 }}>
  36. <AppBar />
  37. </div>
  38. <div>
  39. <Switch>
  40. <Route
  41. path="/tokenomics"
  42. render={(routeprops) => (
  43. <Tokenomics
  44. {...routeprops}
  45. reports={reports}
  46. tokenomics={tokenomics}
  47. />
  48. )}
  49. />
  50. <Route
  51. path="/spending"
  52. render={(routeprops) => <Spending {...routeprops} {...props} />}
  53. />
  54. <Route
  55. path="/proposals/:id"
  56. render={(routeprops) => <Proposal {...routeprops} {...props} />}
  57. />
  58. <Route path="/proposals" render={() => <Proposals {...props} />} />
  59. <Route
  60. path="/councils"
  61. render={(routeprops) => <Councils {...routeprops} {...props} />}
  62. />
  63. <Route
  64. path="/curation"
  65. render={(routeprops) => <Curation {...routeprops} {...props} />}
  66. />
  67. <Route
  68. path="/forum/threads/:thread"
  69. render={(routeprops) => <Forum {...routeprops} {...props} />}
  70. />
  71. <Route path="/forum" render={() => <Forum {...props} />} />
  72. <Route
  73. path="/mint"
  74. render={(routeprops) => <Mint {...routeprops} {...props} />}
  75. />
  76. <Route
  77. path="/members/:handle"
  78. render={(routeprops) => <Member {...routeprops} {...props} />}
  79. />
  80. <Route
  81. path="/members"
  82. render={(routeprops) => <Members {...routeprops} {...props} />}
  83. />
  84. <Route
  85. path="/calendar"
  86. render={(routeprops) => <Calendar {...routeprops} {...props} />}
  87. />
  88. <Route
  89. path="/timeline"
  90. render={(routeprops) => <Timeline {...routeprops} {...props} />}
  91. />
  92. <Route
  93. path="/validators"
  94. render={(routeprops) => <Validators {...routeprops} {...props} />}
  95. />
  96. <Route
  97. path="/validator-report"
  98. render={(routeprops) => (
  99. <ValidatorReport {...routeprops} {...props} />
  100. )}
  101. />
  102. <Route
  103. path="/storage"
  104. render={(routeprops) => <Storage {...routeprops} {...props} />}
  105. />
  106. <Route
  107. path="/transactions"
  108. render={(routeprops) => (
  109. <Transactions {...routeprops} {...props} />
  110. )}
  111. />
  112. <Route
  113. path="/bounties"
  114. render={(routeprops) => <Bounties {...routeprops} {...props} />}
  115. />
  116. <Route
  117. path="/burners"
  118. render={(routeprops) => <Burners {...routeprops} {...props} />}
  119. />
  120. <Route path="/" render={() => <Dashboard {...props} />} />
  121. </Switch>
  122. </div>
  123. </BrowserRouter>
  124. </div>
  125. );
  126. };
  127. export default Routes;