Common.jsx 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // @flow
  2. // Copyright 2017 The go-ethereum Authors
  3. // This file is part of the go-ethereum library.
  4. //
  5. // The go-ethereum library is free software: you can redistribute it and/or modify
  6. // it under the terms of the GNU Lesser General Public License as published by
  7. // the Free Software Foundation, either version 3 of the License, or
  8. // (at your option) any later version.
  9. //
  10. // The go-ethereum library is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. // GNU Lesser General Public License for more details.
  14. //
  15. // You should have received a copy of the GNU Lesser General Public License
  16. // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
  17. type ProvidedMenuProp = {|title: string, icon: string|};
  18. const menuSkeletons: Array<{|id: string, menu: ProvidedMenuProp|}> = [
  19. {
  20. id: 'home',
  21. menu: {
  22. title: 'Home',
  23. icon: 'home',
  24. },
  25. }, {
  26. id: 'chain',
  27. menu: {
  28. title: 'Chain',
  29. icon: 'link',
  30. },
  31. }, {
  32. id: 'txpool',
  33. menu: {
  34. title: 'TxPool',
  35. icon: 'credit-card',
  36. },
  37. }, {
  38. id: 'network',
  39. menu: {
  40. title: 'Network',
  41. icon: 'globe',
  42. },
  43. }, {
  44. id: 'system',
  45. menu: {
  46. title: 'System',
  47. icon: 'tachometer',
  48. },
  49. }, {
  50. id: 'logs',
  51. menu: {
  52. title: 'Logs',
  53. icon: 'list',
  54. },
  55. },
  56. ];
  57. export type MenuProp = {|...ProvidedMenuProp, id: string|};
  58. // The sidebar menu and the main content are rendered based on these elements.
  59. // Using the id is circumstantial in some cases, so it is better to insert it also as a value.
  60. // This way the mistyping is prevented.
  61. export const MENU: Map<string, {...MenuProp}> = new Map(menuSkeletons.map(({id, menu}) => ([id, {id, ...menu}])));
  62. export const DURATION = 200;