index.tsx 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Copyright 2017-2019 @polkadot/app-democracy authors & contributors
  2. // This software may be modified and distributed under the terms
  3. // of the Apache-2.0 license. See the LICENSE file for details.
  4. import { AppProps, BareProps, I18nProps } from '@polkadot/react-components/types';
  5. import React from 'react';
  6. import { Route, Switch } from 'react-router';
  7. import { Tabs } from '@polkadot/react-components';
  8. import Overview from './Overview';
  9. import Motions from './Motions';
  10. import translate from './translate';
  11. interface Props extends AppProps, BareProps, I18nProps {}
  12. function App ({ basePath, t }: Props): React.ReactElement<Props> {
  13. return (
  14. <main>
  15. <header>
  16. <Tabs
  17. basePath={basePath}
  18. items={[
  19. {
  20. isRoot: true,
  21. name: 'overview',
  22. text: t('Council overview')
  23. },
  24. {
  25. name: 'motions',
  26. text: t('Motions')
  27. }
  28. ]}
  29. />
  30. </header>
  31. <Switch>
  32. <Route path={`${basePath}/motions`} component={Motions} />
  33. <Route component={Overview} />
  34. </Switch>
  35. </main>
  36. );
  37. }
  38. export default translate(App);