mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
Block explorer nav bar button/tabs are dynamic with active highlights
This commit is contained in:
parent
1fc10ba082
commit
0e574a7696
3 changed files with 36 additions and 36 deletions
|
|
@ -33,6 +33,18 @@
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
button.btnActive {
|
||||||
|
color: #4f2e7e;
|
||||||
|
background-color: white;
|
||||||
|
font-size: 8px;
|
||||||
|
letter-spacing: 1.6px;
|
||||||
|
font-family: 'Open Sans', sans-serif;
|
||||||
|
width: 120px;
|
||||||
|
height: 32px;
|
||||||
|
margin-right: 1%;
|
||||||
|
font-weight: 300;
|
||||||
|
}
|
||||||
|
|
||||||
.btn:hover {
|
.btn:hover {
|
||||||
color: #4f2e7e;
|
color: #4f2e7e;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
|
|
|
||||||
|
|
@ -7,13 +7,13 @@ class navBar extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
selected: ""
|
active: "blocks"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// updateSelected = (page) => {
|
updateActive = (page) => {
|
||||||
// this.setState({ selected });
|
this.setState({ active: page });
|
||||||
// }
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
|
|
@ -21,40 +21,35 @@ class navBar extends React.Component {
|
||||||
<div className={classes.navHeader}>
|
<div className={classes.navHeader}>
|
||||||
<h5 className={classes.headerText}> Block Explorer </h5>
|
<h5 className={classes.headerText}> Block Explorer </h5>
|
||||||
<div className={classes.buttonContainer}>
|
<div className={classes.buttonContainer}>
|
||||||
|
|
||||||
<Link to="/blocks">
|
<Link to="/blocks">
|
||||||
<button className={classes.btn} > BLOCKS </button>
|
<button
|
||||||
|
className={this.state.active === "blocks" ? classes.btnActive : classes.btn}
|
||||||
|
onClick={ ()=>this.updateActive("blocks") } >
|
||||||
|
BLOCKS
|
||||||
|
</button>
|
||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
<Link to="/transactions">
|
<Link to="/transactions">
|
||||||
<button className={classes.btn} > TRANSACTIONS </button>
|
<button
|
||||||
|
className={this.state.active === "transactions" ? classes.btnActive : classes.btn}
|
||||||
|
onClick={ ()=>this.updateActive("transactions") }>
|
||||||
|
TRANSACTIONS
|
||||||
|
</button>
|
||||||
</Link>
|
</Link>
|
||||||
|
<button
|
||||||
<button className={classes.btn}> INTERNAL TX </button>
|
className={this.state.active === "internal" ? classes.btnActive : classes.btn}
|
||||||
|
onClick={ ()=> this.updateActive("internal") }>
|
||||||
|
INTERNAL TX
|
||||||
|
</button>
|
||||||
<Link to="/accounts">
|
<Link to="/accounts">
|
||||||
<button className={classes.btn}> ACCOUNTS </button>
|
<button
|
||||||
|
className={this.state.active === "accounts" ? classes.btnActive : classes.btn}
|
||||||
|
onClick={ ()=>this.updateActive("accounts") }>
|
||||||
|
ACCOUNTS
|
||||||
|
</button>
|
||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
/* <nav className="navbar navbar-light justify-content-between">
|
|
||||||
<a className={combinedClasses.join(" ")}>Block Explorer Test UI</a>
|
|
||||||
<form className="form-inline">
|
|
||||||
<input
|
|
||||||
className="form-control mr-sm-2"
|
|
||||||
type="search"
|
|
||||||
placeholder="Search"ls
|
|
||||||
|
|
||||||
aria-label="Search"
|
|
||||||
/>
|
|
||||||
<button className="btn btn-outline-success my-2 my-sm-0" type="submit">
|
|
||||||
Search
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
</nav>*/
|
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -8,13 +8,6 @@
|
||||||
position: absolute;
|
position: absolute;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* .tHead {
|
|
||||||
font-size: 7pt;
|
|
||||||
background-color: white;
|
|
||||||
font-family: 'Open Sans', sans-serif;
|
|
||||||
color: #593c83;
|
|
||||||
} */
|
|
||||||
|
|
||||||
th {
|
th {
|
||||||
background-color: white;
|
background-color: white;
|
||||||
padding: 15pt 30pt ;
|
padding: 15pt 30pt ;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue