UI block explorer changes started

This commit is contained in:
Chris Fenos 2018-08-17 17:23:28 -04:00
parent 05ebc5899b
commit 6791890c21
8 changed files with 196 additions and 103 deletions

View file

@ -9,6 +9,7 @@
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/ homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
--> -->
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<link rel="manifest" href="%PUBLIC_URL%/manifest.json"> <link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico"> <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">

View file

@ -6,21 +6,23 @@ const home = props => {
const combinedClasses = ["btn", "btn-primary", classes.BlockButton] const combinedClasses = ["btn", "btn-primary", classes.BlockButton]
const conjoinecdClasses = ["btn", "btn-primary", classes.AccountButton] const conjoinecdClasses = ["btn", "btn-primary", classes.AccountButton]
return ( return (
<div className={classes.Home}> <div></div>
<span className={classes.Greeting}>THIS IS A WIP</span> // <div className={classes.Home}>
<div> // <span className={classes.Greeting}>THIS IS A WIP</span>
<div className={classes.Transactions}> // <div>
<Link to="/transactions"><button className="btn btn-primary">Transactions</button></Link> // <div className={classes.Transactions}>
</div> // <Link to="/transactions"><button className="btn btn-primary">Transactions</button></Link>
<div className={classes.Blocks}> // </div>
<Link to="/blocks"><button className={combinedClasses.join(" ")}>Blocks</button></Link> // <div className={classes.Blocks}>
</div> // <Link to="/blocks"><button className={combinedClasses.join(" ")}>Blocks</button></Link>
<div className={classes.Accounts}> // </div>
<Link to="/accounts"><button className={conjoinecdClasses.join(" ")}>Accounts</button></Link> // <div className={classes.Accounts}>
</div> // <Link to="/accounts"><button className={conjoinecdClasses.join(" ")}>Accounts</button></Link>
</div> // </div>
</div> // </div>
// </div>
); );
}; };

View file

@ -1,21 +1,51 @@
.Secondary { .navHeader {
display: block; height: 25vh;
background-color: #4f2e7e;
padding-top: 30pt;
padding-left: 2.5%;
z-index: -10000;
width: 100%; width: 100%;
height: 100px;
background-color: rgb(244, 244, 244);
} }
.Transactions { .headerText {
font-size: 20px; color: white;
padding-top: 25px; letter-spacing: 1.7px;
padding-left: 15px; font-family: 'Open Sans', sans-serif;
float: left; font-size: 15px;
text-transform: uppercase;
} }
.bg-light { .buttonContainer {
background-color: #fff !important; flex: 1;
flex-direction: row;
padding-top: 20pt;
} }
.TopBar { .btn {
font-size: 1.5rem; color: white;
background-color: transparent;
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 {
color: #4f2e7e;
background-color: #ffffff;
font-size: 8px;
}
/*
button:active{
background-color: white;
}
button:focus {
background-color: white;
} */

View file

@ -1,24 +1,63 @@
import React from "react"; import React from "react";
import classes from './nav.css'; import classes from './nav.css';
import { Link } from 'react-router-dom'
const navBar = props => { class navBar extends React.Component {
let combinedClasses = ["navbar-brand", classes.TopBar];
constructor(props) {
super(props);
this.state = {
selected: ""
};
}
// updateSelected = (page) => {
// this.setState({ selected });
// }
render() {
return ( return (
<nav className="navbar navbar-light justify-content-between"> <div>
<div className={classes.navHeader}>
<h5 className={classes.headerText}> Block Explorer </h5>
<div className={classes.buttonContainer}>
<Link to="/blocks">
<button className={classes.btn} > BLOCKS </button>
</Link>
<Link to="/transactions">
<button className={classes.btn} > TRANSACTIONS </button>
</Link>
<button className={classes.btn}> INTERNAL TX </button>
<Link to="/accounts">
<button className={classes.btn}> ACCOUNTS </button>
</Link>
</div>
</div>
</div>
/* <nav className="navbar navbar-light justify-content-between">
<a className={combinedClasses.join(" ")}>Block Explorer Test UI</a> <a className={combinedClasses.join(" ")}>Block Explorer Test UI</a>
{/* <form className="form-inline"> <form className="form-inline">
<input <input
className="form-control mr-sm-2" className="form-control mr-sm-2"
type="search" type="search"
placeholder="Search" placeholder="Search"ls
aria-label="Search" aria-label="Search"
/> />
<button className="btn btn-outline-success my-2 my-sm-0" type="submit"> <button className="btn btn-outline-success my-2 my-sm-0" type="submit">
Search Search
</button> </button>
</form> */} </form>
</nav> </nav>*/
); )
};
}; };
export default navBar; export default navBar;

View file

@ -21,7 +21,6 @@ class BlocksTable extends Component {
} }
} }
render() { render() {
const table = this.state.data.map((data, i) => { const table = this.state.data.map((data, i) => {
const conversion = data.Rewards / 10000000000000000000; const conversion = data.Rewards / 10000000000000000000;
@ -43,23 +42,25 @@ class BlocksTable extends Component {
let combinedClasses = ['responsive-table', classes.table]; let combinedClasses = ['responsive-table', classes.table];
return ( return (
<div className={classes.tableContainer} >
<table className={combinedClasses.join(' ')}> <table className={combinedClasses.join(' ')}>
<thead className={classes.tHead}> <thead>
<tr> <tr>
<th scope="col">Height</th> <th scope="col" style={{fontSize: "8pt", backgroundColor: "white", color: "#4f2e7e"}} >Height</th>
<th scope="col">Block Hash</th> <th scope="col" style={{fontSize: "8pt", backgroundColor: "white", color: "#4f2e7e"}} >Block Hash</th>
<th scope="col">Age</th> <th scope="col" style={{fontSize: "8pt", backgroundColor: "white", color: "#4f2e7e"}} >Age</th>
<th scope="col">Txn</th> <th scope="col" style={{fontSize: "8pt", backgroundColor: "white", color: "#4f2e7e"}} >Txn</th>
<th scope="col">Uncles</th> <th scope="col" style={{fontSize: "8pt", backgroundColor: "white", color: "#4f2e7e"}} >Uncles</th>
<th scope="col">Coinbase</th> <th scope="col" style={{fontSize: "8pt", backgroundColor: "white", color: "#4f2e7e"}} >Coinbase</th>
<th scope="col">GasUsed</th> <th scope="col" style={{fontSize: "8pt", backgroundColor: "white", color: "#4f2e7e"}}>GasUsed</th>
<th scope="col">GasLimit</th> <th scope="col" style={{fontSize: "8pt", backgroundColor: "white", color: "#4f2e7e"}}>GasLimit</th>
<th scope="col">Avg.GasPrice</th> <th scope="col" style={{fontSize: "8pt", backgroundColor: "white", color: "#4f2e7e"}}>Avg.GasPrice</th>
<th scope="col">Reward</th> <th scope="col" style={{fontSize: "8pt", backgroundColor: "white", color: "#4f2e7e"}}>Reward</th>
</tr> </tr>
</thead> </thead>
{table} {table}
</table> </table>
</div>
); );
} }
} }

View file

@ -6,18 +6,18 @@ const BlockTable = (props) => {
return ( return (
<tbody> <tbody>
<tr> <tr>
<td><Link to="/blocks/detail" onClick={() => props.detailBlockHandler(props.Number)}> <td style={{paddingLeft: '30pt' }} ><Link to="/blocks/detail" onClick={() => props.detailBlockHandler(props.Number)}>
{props.Number} {props.Number}
</Link></td> </Link></td>
<td className={classes.addressTag}>{props.Hash}</td> <td style={{paddingLeft: '30pt' }} className={classes.addressTag}>{props.Hash}</td>
<td>{props.AgeGet}</td> <td style={{paddingLeft: '30pt' }}>{props.AgeGet}</td>
<td>{props.TxCount}</td> <td style={{paddingLeft: '30pt' }}>{props.TxCount}</td>
<td>{props.UncleCount}</td> <td style={{paddingLeft: '30pt' }}>{props.UncleCount}</td>
<td className={classes.addressTag}><Link to="/mined/blocks" onClick={() => props.getBlocksMined(props.Coinbase)}>{props.Coinbase}</Link></td> <td style={{paddingLeft: '30pt' }} className={classes.addressTag}><Link to="/mined/blocks" onClick={() => props.getBlocksMined(props.Coinbase)}>{props.Coinbase}</Link></td>
<td>{props.GasUsed}</td> <td style={{paddingLeft: '30pt' }}>{props.GasUsed}</td>
<td>{props.GasLimit}</td> <td style={{paddingLeft: '30pt' }}>{props.GasLimit}</td>
<td>TBD</td> <td style={{paddingLeft: '30pt' }}>TBD</td>
<td>{props.Reward}</td> <td style={{paddingLeft: '30pt' }}>{props.Reward}</td>
</tr> </tr>
</tbody> </tbody>
) )

View file

@ -1,21 +1,34 @@
.table { .table {
border-spacing: 100rem; border-spacing: 100rem;
width: 100%; width: 95%;
margin-top: 50px; margin: 0 auto;
margin-top: -4%;
background-color: white;
} }
.tHead { thead {
font-size: 1rem; font-size: 7pt;
background-color: white;
font-family: 'Open Sans', sans-serif;
color: #593c83;
} }
th { th {
background-color: aliceblue; background-color: white;
padding-right: 10px; padding-right: 10px;
padding: 25pt 30pt ;
color: #593c83;
font-family: 'Open Sans', sans-serif;
} }
td { td {
padding-left: 5px; font-size: 6pt;
font-size: .5rem; background-color: white;
font-family: 'Open Sans', sans-serif;
/* padding: 25px;
margin-left: 25px; */
} }
.addressTag { .addressTag {
@ -23,7 +36,7 @@ td {
vertical-align: bottom; vertical-align: bottom;
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
width: 132px; width: 100px;
} }
.ageTag{ .ageTag{

View file

@ -3,6 +3,9 @@ import axios from 'axios';
import Nav from "../components/nav/nav"; import Nav from "../components/nav/nav";
import { BrowserRouter, Route } from 'react-router-dom' import { BrowserRouter, Route } from 'react-router-dom'
import { Link } from 'react-router-dom'
///**LANDING PAGE**/// ///**LANDING PAGE**///
import Home from '../components/home/home'; import Home from '../components/home/home';
@ -26,6 +29,7 @@ import DetailAccountsTable from "../components/table/accounts/detailAccountsRow"
import AccountHeader from "../components/nav/accountHeaders/accountHeader"; import AccountHeader from "../components/nav/accountHeaders/accountHeader";
import AccountDetailHeader from "../components/nav/accountHeaders/accountDetailHeader"; import AccountDetailHeader from "../components/nav/accountHeaders/accountDetailHeader";
import classes from './App.css';
class App extends Component { class App extends Component {
constructor(props) { constructor(props) {
@ -93,7 +97,8 @@ class App extends Component {
render() { render() {
return ( return (
<BrowserRouter> <BrowserRouter>
<div className="container">
<div style={{backgroundColor:"#f7f8f9", paddingBottom:"5%" }}>
<Nav /> <Nav />
<Route path="/" exact render={({ match }) => <Route path="/" exact render={({ match }) =>
@ -112,11 +117,13 @@ class App extends Component {
<Route path="/blocks" exact render={({match}) => <Route path="/blocks" exact render={({match}) =>
<div> <div>
<BlockHeader/> {/* <BlockHeader/> */}
<BlocksRow <BlocksRow
getBlocksMined={this.getBlocksMined} getBlocksMined={this.getBlocksMined}
getBlockTransactions={this.getBlockTransactions} getBlockTransactions={this.getBlockTransactions}
detailBlockHandler={this.detailBlockHandler}/> detailBlockHandler={this.detailBlockHandler}/>
</div>} </div>}
/> />