diff --git a/embark-ui/src/components/Account.js b/embark-ui/src/components/Account.js index 548df2c31..77cff7343 100644 --- a/embark-ui/src/components/Account.js +++ b/embark-ui/src/components/Account.js @@ -1,14 +1,15 @@ import React from 'react'; -import { - Page -} from "tabler-react"; +import {Row, Col} from 'reactstrap'; import PropTypes from 'prop-types'; const Account = ({account}) => ( - -

Balance: {account.balance}

-

Tx count: {account.transactionCount}

-
+ + +

{account.address}

+

Balance: {account.balance}

+

Tx count: {account.transactionCount}

+ +
); Account.propTypes = { diff --git a/embark-ui/src/components/Accounts.js b/embark-ui/src/components/Accounts.js index 09b6810bb..b02b1aa85 100644 --- a/embark-ui/src/components/Accounts.js +++ b/embark-ui/src/components/Accounts.js @@ -1,49 +1,38 @@ import React from 'react'; -import { - Page, - Grid, - Card, - Table -} from "tabler-react"; +import {Row, Col, Table} from 'reactstrap'; import {Link} from 'react-router-dom'; import PropTypes from 'prop-types'; const Accounts = ({accounts}) => ( - - - - - - - - Address - Balance - TX count - Index - - - - { - accounts.map((account) => { - return ( - - {account.address} - {account.balance} - {account.transactionCount} - {account.index} - - ); - }) - } - -
-
-
-
-
+ + +

Accounts

+ + + + + + + + + + + { + accounts.map((account) => { + return ( + + + + + + + ); + }) + } + +
AddressBalanceTX countIndex
{account.address}{account.balance}{account.transactionCount}{account.index}
+ +
); Accounts.propTypes = { diff --git a/embark-ui/src/components/Block.js b/embark-ui/src/components/Block.js index 2c69a3520..785dc1599 100644 --- a/embark-ui/src/components/Block.js +++ b/embark-ui/src/components/Block.js @@ -1,14 +1,15 @@ import React from 'react'; -import { - Page -} from "tabler-react"; +import {Row, Col} from 'reactstrap'; import PropTypes from 'prop-types'; const Block = ({block}) => ( - -

Timestamp: {block.timestamp}

-

Gas used: {block.gasUsed}

-
+ + +

Block {block.number}

+

Timestamp: {block.timestamp}

+

Gas used: {block.gasUsed}

+ +
); Block.propTypes = { diff --git a/embark-ui/src/components/Blocks.js b/embark-ui/src/components/Blocks.js index 3673e5eeb..72f850772 100644 --- a/embark-ui/src/components/Blocks.js +++ b/embark-ui/src/components/Blocks.js @@ -1,50 +1,39 @@ import React from 'react'; import {Link} from "react-router-dom"; -import { - Page, - Grid, - Card, - Table -} from "tabler-react"; +import {Row, Col, Table} from 'reactstrap'; + import PropTypes from 'prop-types'; const Blocks = ({blocks}) => ( - - - - - - - - Number - Mined On - Gas Used - TX Count - - - - { - blocks.map((block) => { - return ( - - {block.number} - {new Date(block.timestamp * 1000).toLocaleString()} - {block.gasUsed} - {block.transactions.length} - - ); - }) - } - -
-
-
-
-
+ + +

Blocks

+ + + + + + + + + + + { + blocks.map((block) => { + return ( + + + + + + + ); + }) + } + +
NumberMined OnGas UsedTX Count
{block.number}{new Date(block.timestamp * 1000).toLocaleString()}{block.gasUsed}{block.transactions.length}
+ +
); Blocks.propTypes = { diff --git a/embark-ui/src/components/Console.js b/embark-ui/src/components/Console.js index a509f7bf2..6731b5c6e 100644 --- a/embark-ui/src/components/Console.js +++ b/embark-ui/src/components/Console.js @@ -1,17 +1,19 @@ import PropTypes from "prop-types"; import React, {Component} from 'react'; import Convert from 'ansi-to-html'; -import {Grid, Card, Form, Tab, TabbedHeader, TabbedContainer} from 'tabler-react'; -import Logs from "./Logs"; +import { Form, Col, Row, Card, CardBody, Input, CardFooter, TabContent, TabPane, Nav, NavItem, NavLink } from 'reactstrap'; +import classnames from 'classnames'; +import Logs from "./Logs"; import "./Console.css"; +import {EMBARK_PROCESS_NAME} from '../constants'; const convert = new Convert(); class Console extends Component { constructor(props) { super(props); - this.state = {value: ''}; + this.state = {value: '', activeTab: EMBARK_PROCESS_NAME}; } handleSubmit(event) { @@ -25,55 +27,75 @@ class Console extends Component { this.setState({value: event.target.value}); } + toggle(tab) { + if (this.state.activeTab !== tab) { + this.setState({ + activeTab: tab + }); + this.props.updateTab(tab); + } + } + + renderNav() { + return ( + + ) + } + renderTabs() { const {processLogs, processes} = this.props; - return processes.map(process => ( - - - { - processLogs - .filter((item) => item.name === process.name) - .reverse() - .map((item, i) =>

) - } -
-
- )); + + return ( + + {processes.map(process => ( + + + {processLogs + .filter((item) => item.name === process.name) + .reverse() + .map((item, i) =>

)} +
+
+ ))} +
+ ); } render() { - const tabs = this.renderTabs(); const {value} = this.state; return ( - - + + - - - - {tabs} - - - {tabs} - - - - {this.props.isEmbark() && -
this.handleSubmit(event)} autoComplete="off"> - + {this.renderNav()} + {this.renderTabs()} + + {this.props.isEmbark() && + this.handleSubmit(event)} autoComplete="off"> + this.handleChange(event)} name="command" placeholder="Type a command (e.g help)"/> - -
} + + }
-
-
+ + ); } } diff --git a/embark-ui/src/components/ContractFunctions.js b/embark-ui/src/components/ContractFunctions.js index 9444df971..6032fd94e 100644 --- a/embark-ui/src/components/ContractFunctions.js +++ b/embark-ui/src/components/ContractFunctions.js @@ -1,13 +1,20 @@ import PropTypes from "prop-types"; import React, {Component} from 'react'; import { - Page, - Grid, - Form, + Row, + Col, + FormGroup, + Label, + Input, Button, - List, - Card -} from "tabler-react"; + Card, + CardBody, + CardHeader, + CardTitle, + CardFooter, + ListGroup, + ListGroupItem +} from "reactstrap"; class ContractFunction extends Component { constructor(props) { @@ -51,40 +58,40 @@ class ContractFunction extends Component { render() { return ( - - - - - {this.props.method.name} - - - {this.props.method.inputs.map(input => ( - - this.handleChange(e, input.name)}/> - + + + + {this.props.method.name} + + + {this.props.method.inputs.map(input => ( + + + this.handleChange(e, input.name)}/> + + ))} + {!ContractFunction.isPureCall(this.props.method) && + + + this.handleChange(e, 'gasPrice')}/> + + } + + + {this.props.contractFunctions && this.props.contractFunctions.length > 0 && + + {this.props.contractFunctions.map(contractFunction => ( + + {contractFunction.inputs.length > 0 &&

Inputs: {contractFunction.inputs.join(', ')}

} + Result: {contractFunction.result} +
))} - {!ContractFunction.isPureCall(this.props.method) && - - this.handleChange(e, 'gasPrice')}/> - - } - -
- {this.props.contractFunctions && this.props.contractFunctions.length > 0 && - - {this.props.contractFunctions.map(contractFunction => ( - - {contractFunction.inputs.length > 0 &&

Inputs: {contractFunction.inputs.join(', ')}

} - Result: {contractFunction.result} -
- ))} -
-
} -
-
-
+ + } + + ); } } @@ -106,7 +113,8 @@ const ContractFunctions = (props) => { const {contractProfile} = props; return ( - + +

{contractProfile.name} Functions

{contractProfile.methods .filter((method) => { return props.onlyConstructor ? method.type === 'constructor' : method.type !== 'constructor'; @@ -116,7 +124,7 @@ const ContractFunctions = (props) => { contractFunctions={filterContractFunctions(props.contractFunctions, contractProfile.name, method.name)} contractProfile={contractProfile} postContractFunction={props.postContractFunction}/>)} -
+ ); }; diff --git a/embark-ui/src/components/ContractLayout.js b/embark-ui/src/components/ContractLayout.js index 96d161bd7..fc4ae06c8 100644 --- a/embark-ui/src/components/ContractLayout.js +++ b/embark-ui/src/components/ContractLayout.js @@ -23,6 +23,7 @@ class ContractLayout extends React.Component { }); } } + render() { return ( diff --git a/embark-ui/src/components/ContractLogger.js b/embark-ui/src/components/ContractLogger.js index 7bf47bf7f..c1b91c624 100644 --- a/embark-ui/src/components/ContractLogger.js +++ b/embark-ui/src/components/ContractLogger.js @@ -14,30 +14,30 @@ const ContractLogger = ({contractName, contractLogs}) => ( cards verticalAlign="center" className="text-nowrap"> - - - call - Transaction hash - Gas Used - Block number - Status - - - + + + call + Transaction hash + Gas Used + Block number + Status + + + { contractLogs.map((log, index) => { return ( - - {`${log.name}.${log.functionName}(${log.paramString})`} - {log.transactionHash} - {log.gasUsed} - {log.blockNumber} - {log.status} - + + {`${log.name}.${log.functionName}(${log.paramString})`} + {log.transactionHash} + {log.gasUsed} + {log.blockNumber} + {log.status} + ); }) } - + diff --git a/embark-ui/src/components/ContractOverview.js b/embark-ui/src/components/ContractOverview.js index 75bff768e..fb4adbb76 100644 --- a/embark-ui/src/components/ContractOverview.js +++ b/embark-ui/src/components/ContractOverview.js @@ -1,60 +1,44 @@ import PropTypes from "prop-types"; import React from 'react'; -import { - Page, - Grid, - Card, - Table -} from "tabler-react"; +import {Row, Col, Table} from "reactstrap"; import JSONTree from 'react-json-tree'; import {formatContractForDisplay} from '../utils/presentation'; const Contract = ({contract, match}) => { const contractDisplay = formatContractForDisplay(contract); return ( - - - - - - - - Name - Address - State - - - - - {contract.className} - {contractDisplay.address} - {contractDisplay.state} - - -
-
- - - ABI - - - {contract.abiDefinition && } - - - - - Bytecode - - - {contract.runtimeBytecode} - - -
-
-
+ + +

{contract.className} Overview

+ + + + + + + + + + + + + + + +
NameAddressState
{contract.className}{contractDisplay.address}{contractDisplay.state}
+

ABI

+
+ {contract.abiDefinition && } +
+

Bytecode

+
+ {contract.runtimeBytecode} +
+ +
); }; diff --git a/embark-ui/src/components/Contracts.js b/embark-ui/src/components/Contracts.js index 71ea925d7..08da18b85 100644 --- a/embark-ui/src/components/Contracts.js +++ b/embark-ui/src/components/Contracts.js @@ -1,16 +1,15 @@ import PropTypes from "prop-types"; import React from 'react'; -import {Page, Grid} from "tabler-react"; +import {Row, Col} from "reactstrap"; import ContractsList from './ContractsList'; const Contracts = ({contracts, title = "Contracts"}) => ( - - - + + +

{title}

-
-
-
+ + ); Contracts.propTypes = { diff --git a/embark-ui/src/components/ContractsList.js b/embark-ui/src/components/ContractsList.js index c0f317a60..d1581a432 100644 --- a/embark-ui/src/components/ContractsList.js +++ b/embark-ui/src/components/ContractsList.js @@ -1,39 +1,33 @@ import PropTypes from "prop-types"; import React from 'react'; -import {Card, Table} from "tabler-react"; +import {Table} from "reactstrap"; import {Link} from 'react-router-dom'; import {formatContractForDisplay} from '../utils/presentation'; const ContractsList = ({contracts}) => ( - - - - - Name - Address - State - - - - { - contracts.map((contract) => { - const contractDisplay = formatContractForDisplay(contract); - return ( - - {contract.className} - {contractDisplay.address} - {contractDisplay.state} - - ); - }) - } - -
-
+ + + + + + + + + + { + contracts.map((contract) => { + const contractDisplay = formatContractForDisplay(contract); + return ( + + + + + + ); + }) + } + +
NameAddressState
{contract.className}{contractDisplay.address}{contractDisplay.state}
) ContractsList.propTypes = { diff --git a/embark-ui/src/components/Error.js b/embark-ui/src/components/Error.js index 4875504ac..df498aec1 100644 --- a/embark-ui/src/components/Error.js +++ b/embark-ui/src/components/Error.js @@ -1,15 +1,15 @@ import PropTypes from "prop-types"; import React from 'react'; -import {Grid} from 'tabler-react'; +import {Row, Col} from 'reactstrap'; const Error = ({error}) => ( - - + +

{error}

-
-
+ + ); Error.propTypes = { diff --git a/embark-ui/src/components/ExplorerLayout.js b/embark-ui/src/components/ExplorerLayout.js index 2b085595c..ec7835335 100644 --- a/embark-ui/src/components/ExplorerLayout.js +++ b/embark-ui/src/components/ExplorerLayout.js @@ -1,10 +1,5 @@ import React from 'react'; -import {NavLink, Route, Switch} from 'react-router-dom'; -import { - Page, - Grid, - List -} from "tabler-react"; +import {Route, Switch} from 'react-router-dom'; import AccountsContainer from '../containers/AccountsContainer'; import AccountContainer from '../containers/AccountContainer'; @@ -13,45 +8,15 @@ import BlockContainer from '../containers/BlockContainer'; import TransactionsContainer from '../containers/TransactionsContainer'; import TransactionContainer from '../containers/TransactionContainer'; -const groupItems = [ - {to: "/embark/explorer/accounts", icon: "users", value: "Accounts"}, - {to: "/embark/explorer/blocks", icon: "book-open", value: "Blocks"}, - {to: "/embark/explorer/transactions", icon: "activity", value: "Transactions"} -]; - -const className = "d-flex align-items-center"; - const ExplorerLayout = () => ( - - - Explorer -
- - {groupItems.map((groupItem) => ( - - {groupItem.value} - - ))} - -
-
- - - - - - - - - - -
+ + + + + + + + ); export default ExplorerLayout; diff --git a/embark-ui/src/components/FileExplorer.js b/embark-ui/src/components/FileExplorer.js index 9eacaf060..313b42525 100644 --- a/embark-ui/src/components/FileExplorer.js +++ b/embark-ui/src/components/FileExplorer.js @@ -1,7 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import {Treebeard, decorators} from 'react-treebeard'; -import {Form} from 'tabler-react'; +import {Input, Label, FormGroup} from 'reactstrap'; const style = { tree: { @@ -178,7 +178,12 @@ class FileExplorer extends React.Component { render() { return (
- + + + - + return + - - Gas Price Estimator - + + + Gas Price Estimator this.setState({copied: true})} title="Copy gas price to clipboard"> - + - - + + - + {this.state.copied &&

Copied Gas Price

} - - - + + + + {this.getFormattedPrice(currentGasStep.gasPrice)} - - - - + + + + + {this.getFormattedWait(currentGasStep.wait)} - - - + + +
- - this.gasSliderChange(e, 'gasOracleSliderIndex')} - /> - + /> - - - + + + + Average Price: {this.getFormattedPrice(this.averagePrice)} - - - - + + + + + Average Wait: {this.getFormattedWait(this.averageWait)} - - - - + + + + + Last Block: {this.props.lastBlock.number} - - - - + + + + -
- ; + + ; } } diff --git a/embark-ui/src/components/LoadMore.js b/embark-ui/src/components/LoadMore.js index 39876f82e..3475686e7 100644 --- a/embark-ui/src/components/LoadMore.js +++ b/embark-ui/src/components/LoadMore.js @@ -1,13 +1,13 @@ import React from 'react'; -import {Grid, Button} from 'tabler-react'; +import {Row, Col, Button} from 'reactstrap'; import PropTypes from 'prop-types'; const LoadMore = ({loadMore}) => ( - - + + - - + + ); LoadMore.propTypes = { diff --git a/embark-ui/src/components/Loading.js b/embark-ui/src/components/Loading.js index b899533e7..f04ac9726 100644 --- a/embark-ui/src/components/Loading.js +++ b/embark-ui/src/components/Loading.js @@ -1,14 +1,14 @@ import React from 'react'; -import {Grid, Loader} from 'tabler-react'; +import {Row, Col} from 'reactstrap'; import "./Loading.css"; const Loading = () => ( - - - - - + + + + + ); export default Loading; diff --git a/embark-ui/src/components/Preview.js b/embark-ui/src/components/Preview.js index 876d9590a..fc7530db3 100644 --- a/embark-ui/src/components/Preview.js +++ b/embark-ui/src/components/Preview.js @@ -1,5 +1,5 @@ import React from 'react'; -import {Form, Button} from 'tabler-react'; +import {Button, InputGroup, Input, InputGroupAddon} from 'reactstrap'; class Preview extends React.Component { constructor(props) { @@ -28,15 +28,14 @@ class Preview extends React.Component { render() { return (
- - this.handlePreviewUrlChange(e)} /> - - - - + + this.handlePreviewUrlChange(e)} /> + + + +