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