@@ -6,11 +6,20 @@ import {
66 Container ,
77 IconButton ,
88 Toolbar ,
9- Typography
109} from "@material-ui/core"
1110import { Menu , Home , PieChart } from "@material-ui/icons"
1211import theme from '../../theme/DarkTheme'
1312import Loading from "../genericView/Loading.component"
13+ import Chip from "@material-ui/core/Chip" ;
14+ import Grid from "@material-ui/core/Grid" ;
15+ import { ViewName } from "../../pages" ;
16+
17+ const colorByNetwork = {
18+ "bitcoin" : "f2a900" ,
19+ "testnet" : "4d4d4e" ,
20+ "liquid" : "009688" ,
21+ "litecoin" : "" ,
22+ }
1423
1524class BasicAppBar extends React . Component {
1625 constructor ( props , context ) {
@@ -35,26 +44,44 @@ class BasicAppBar extends React.Component {
3544 }
3645
3746 render ( ) {
38- const { child, value, nameNode, changeValue} = this . props
47+ const { child, value, mappingButton, network, changeValue} = this . props
48+ console . log ( mappingButton ) ;
3949 return (
4050 < Container maxWidth = "xl" >
4151 < AppBar position = "sticky" style = { {
4252 backgroundColor : theme . palette . background . paper
4353 } } >
4454 < Toolbar >
45- < IconButton onClick = { ( ) => console . log ( "Click on menu icon" ) } disabled = { true } edge = "start" color = "inherit" aria-label = "menu" >
46- < Menu />
47- </ IconButton >
48- < Typography color = "textSecondary" variant = "h6" >
49- { nameNode }
50- </ Typography >
55+ < Grid justifyContent = "space-between"
56+ alignItems = "center"
57+ container
58+ >
59+ < Grid item >
60+ < IconButton onClick = { ( ) => console . log ( "Click on menu icon" ) } disabled = { true }
61+ edge = "start"
62+ color = "inherit" aria-label = "menu" >
63+ < Menu />
64+ </ IconButton >
65+ </ Grid >
66+ < Grid item >
67+ < Chip
68+ label = { network }
69+ style = { {
70+ background : "#" + colorByNetwork [ network ] ,
71+ } }
72+ />
73+ </ Grid >
74+ </ Grid >
5175 </ Toolbar >
5276 </ AppBar >
53- { this . state . ready ? child : < Loading /> }
54- < Box mb = { theme . spacing ( 2 ) } />
77+ < Box m = { theme . spacing ( 1 ) } mb = { theme . spacing ( 2 ) } >
78+ { this . state . ready ? child : < Loading /> }
79+ </ Box >
5580 < AppBar position = "fixed" className = "navigation-style"
56- style = { { backgroundColor : theme . palette . background . paper ,
57- top : "auto" , bottom : 0 } } >
81+ style = { {
82+ backgroundColor : theme . palette . background . paper ,
83+ top : "auto" , bottom : 0
84+ } } >
5885 < BottomNavigation
5986 value = { value }
6087 onChange = { ( event , newValue ) => {
@@ -63,8 +90,8 @@ class BasicAppBar extends React.Component {
6390 this . loadDom ( )
6491 } }
6592 >
66- < BottomNavigationAction label = "Home" value = "home" icon = { < Home /> } />
67- < BottomNavigationAction disabled = { true } label = "Metrics" value = "metrics" icon = { < PieChart /> } />
93+ < BottomNavigationAction label = "Home" value = { ViewName . HOME } disabled = { mappingButton [ ViewName . HOME ] === false } icon = { < Home /> } />
94+ < BottomNavigationAction label = "Metrics" value = { ViewName . METRICS } disabled = { mappingButton [ ViewName . METRICS ] === false } icon = { < PieChart /> } />
6895 </ BottomNavigation >
6996 </ AppBar >
7097 </ Container >
0 commit comments