Removed tabler-react, clean up

Removed tabler-react from the page structure.

Changed sub nav to reactstrap.

Added the overview child item on LHS nav and the sub nav on the page.

Adjusted width of the sub nav and page contents.
This commit is contained in:
emizzle 2018-10-16 11:22:51 +11:00 committed by Pascal Precht
parent b27caad7a4
commit 5a6a70e226
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D
4 changed files with 51 additions and 49 deletions

View File

@ -1,8 +1,8 @@
import React from 'react'; import React from 'react';
import { import {
Page, Col,
Grid Row
} from "tabler-react"; } from "reactstrap";
import AccountsContainer from '../containers/AccountsContainer'; import AccountsContainer from '../containers/AccountsContainer';
import BlocksContainer from '../containers/BlocksContainer'; import BlocksContainer from '../containers/BlocksContainer';
@ -10,24 +10,24 @@ import TransactionsContainer from '../containers/TransactionsContainer';
const ExplorerDashboardLayout = () => ( const ExplorerDashboardLayout = () => (
<React.Fragment> <React.Fragment>
<Grid.Row md={12}> <Row>
<Grid.Col> <Col>
<Page.Title className="my-5">Explorer</Page.Title> <h1 className="my-5">Explorer</h1>
</Grid.Col> </Col>
</Grid.Row> </Row>
<Grid.Row> <Row>
<Grid.Col className="pl-md-0 pr-md-0 ml-md-0 mr-md-0 pr-lg-3 mr-lg-3 pl-lg-2 ml-lg-2"> <Col>
<AccountsContainer /> <AccountsContainer />
</Grid.Col> </Col>
</Grid.Row> </Row>
<Grid.Row> <Row>
<Grid.Col md={6}> <Col md={6}>
<BlocksContainer /> <BlocksContainer />
</Grid.Col> </Col>
<Grid.Col md={6}> <Col md={6}>
<TransactionsContainer /> <TransactionsContainer />
</Grid.Col> </Col>
</Grid.Row> </Row>
</React.Fragment> </React.Fragment>
); );

View File

@ -1,10 +1,12 @@
import React from 'react'; import React from 'react';
import {NavLink, Route, Switch} from 'react-router-dom'; import {NavLink as RouterNavLink, Route, Switch} from 'react-router-dom';
import { import {
Page, Row,
Grid, Col,
List Nav,
} from "tabler-react"; NavItem,
NavLink
} from "reactstrap";
import AccountsContainer from '../containers/AccountsContainer'; import AccountsContainer from '../containers/AccountsContainer';
import AccountContainer from '../containers/AccountContainer'; import AccountContainer from '../containers/AccountContainer';
@ -14,36 +16,36 @@ import TransactionsContainer from '../containers/TransactionsContainer';
import TransactionContainer from '../containers/TransactionContainer'; import TransactionContainer from '../containers/TransactionContainer';
const groupItems = [ const groupItems = [
{to: "/embark/explorer", icon: "compass", value: "Overview", exact: true}, {to: "/embark/explorer/overview", icon: "signal", value: "Overview"},
{to: "/embark/explorer/accounts", icon: "users", value: "Accounts"}, {to: "/embark/explorer/accounts", icon: "users", value: "Accounts"},
{to: "/embark/explorer/blocks", icon: "book-open", value: "Blocks"}, {to: "/embark/explorer/blocks", icon: "stop", value: "Blocks"},
{to: "/embark/explorer/transactions", icon: "activity", value: "Transactions"} {to: "/embark/explorer/transactions", icon: "tree", value: "Transactions"}
]; ];
const className = "d-flex align-items-center"; const className = "d-flex align-items-center";
const ExplorerLayout = () => ( const ExplorerLayout = (props) => (
<Grid.Row> <Row>
<Grid.Col md={3}> <Col md={2}>
<Page.Title className="my-5">Explorer</Page.Title> <h1 className="my-5">Explorer</h1>
<div> <div>
<List.Group transparent={true}> <Nav vertical pills>
{groupItems.map((groupItem) => ( {groupItems.map((groupItem) => (
<List.GroupItem <NavItem
key={groupItem.value} key={groupItem.value}>
<NavLink
className={className} className={className}
to={groupItem.to} to={groupItem.to}
icon={groupItem.icon} tag={RouterNavLink}
RootComponent={NavLink}
exact={groupItem.exact || false}
> >
{groupItem.value} <i className={`fa fa-${groupItem.icon} mr-3`} />{groupItem.value}
</List.GroupItem> </NavLink>
</NavItem>
))} ))}
</List.Group> </Nav>
</div> </div>
</Grid.Col> </Col>
<Grid.Col md={9}> <Col md={10}>
<Switch> <Switch>
<Route exact path="/embark/explorer/accounts" component={AccountsContainer} /> <Route exact path="/embark/explorer/accounts" component={AccountsContainer} />
<Route exact path="/embark/explorer/accounts/:address" component={AccountContainer} /> <Route exact path="/embark/explorer/accounts/:address" component={AccountContainer} />
@ -52,8 +54,8 @@ const ExplorerLayout = () => (
<Route exact path="/embark/explorer/transactions" component={TransactionsContainer} /> <Route exact path="/embark/explorer/transactions" component={TransactionsContainer} />
<Route exact path="/embark/explorer/transactions/:hash" component={TransactionContainer} /> <Route exact path="/embark/explorer/transactions/:hash" component={TransactionContainer} />
</Switch> </Switch>
</Grid.Col> </Col>
</Grid.Row> </Row>
); );
export default ExplorerLayout; export default ExplorerLayout;

View File

@ -23,8 +23,8 @@ const sidebarNavItems = {items: [
{name: "Dashboard", url: "/embark", icon: 'fa fa-tachometer'}, {name: "Dashboard", url: "/embark", icon: 'fa fa-tachometer'},
{name: "Deployment", url: "/embark/deployment", icon: "fa fa-arrow-up"}, {name: "Deployment", url: "/embark/deployment", icon: "fa fa-arrow-up"},
{name: "Contracts", url: "/embark/contracts", icon: "fa fa-file-text"}, {name: "Contracts", url: "/embark/contracts", icon: "fa fa-file-text"},
{name: "Explorer", url: "/embark/explorer", icon: "fa fa-signal", children: [ {name: "Explorer", url: "/embark/explorer", icon: "fa fa-compass", children: [
{url: "/embark/explorer", icon: "fa fa-compass", name: "Overview", exact: true}, {url: "/embark/explorer/overview", icon: "fa fa-signal", name: "Overview"},
{url: "/embark/explorer/accounts", icon: "fa fa-users", name: "Accounts"}, {url: "/embark/explorer/accounts", icon: "fa fa-users", name: "Accounts"},
{url: "/embark/explorer/blocks", icon: "fa fa-stop", name: "Blocks"}, {url: "/embark/explorer/blocks", icon: "fa fa-stop", name: "Blocks"},
{url: "/embark/explorer/transactions", icon: "fa fa-tree", name: "Transactions"}, {url: "/embark/explorer/transactions", icon: "fa fa-tree", name: "Transactions"},

View File

@ -15,7 +15,7 @@ const routes = (
<React.Fragment> <React.Fragment>
<Switch> <Switch>
<Route exact path="/embark/" component={HomeContainer} /> <Route exact path="/embark/" component={HomeContainer} />
<Route exact path="/embark/explorer" component={ExplorerDashboardLayout} /> <Route exact path="/embark/explorer/overview" component={ExplorerDashboardLayout} />
<Route path="/embark/explorer" component={ExplorerLayout} /> <Route path="/embark/explorer" component={ExplorerLayout} />
<Route path="/embark/deployment/" component={DeploymentContainer} /> <Route path="/embark/deployment/" component={DeploymentContainer} />
<Route path="/embark/contracts/:contractName" component={ContractLayoutContainer} /> <Route path="/embark/contracts/:contractName" component={ContractLayoutContainer} />