index.tsx 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import { Link as RouterLink, Route, Switch } from 'react-router-dom';
  2. import { MemoryRouter as Router } from 'react-router';
  3. import React from 'react';
  4. import ReactDOM from 'react-dom';
  5. import LiveStatsWS from './LiveStatsWS';
  6. import './index.css';
  7. import reportWebVitals from './reportWebVitals';
  8. import ValidatorReport from './ValidatorReport';
  9. import { AppBar, Button, Toolbar } from "@material-ui/core";
  10. import joystream from './joystream.svg';
  11. ReactDOM.render(
  12. <React.StrictMode>
  13. <Router>
  14. <div style={{ flexGrow: 1 }}>
  15. <AppBar position="static" style={{ flexDirection: 'row', backgroundColor: '#4138ff' }}>
  16. <Toolbar style={{ paddingLeft: '12px', backgroundColor: '#4138ff' }}>
  17. <Button color="inherit" component={RouterLink} to="/">
  18. <img style={{ width: 50, height: 50 }} src={joystream} className="App-logo" alt="Joystream logo" />
  19. </Button>
  20. <Button color="inherit" component={RouterLink} to="/">Validator Report</Button>
  21. <Button color="inherit" component={RouterLink} to="/live">WS Live Stats</Button>
  22. </Toolbar>
  23. </AppBar>
  24. </div>
  25. <div>
  26. <Switch>
  27. <Route path="/live">
  28. <LiveStatsWS />
  29. </Route>
  30. <Route path="/">
  31. <ValidatorReport />
  32. </Route>
  33. </Switch>
  34. </div>
  35. </Router>
  36. </React.StrictMode>,
  37. document.getElementById('root')
  38. );
  39. // If you want to start measuring performance in your app, pass a function
  40. // to log results (for example: reportWebVitals(console.log))
  41. // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
  42. reportWebVitals();