From 66a371466dc64d44624e256a256262259d0ff0b4 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Wed, 17 Oct 2018 09:50:02 -0400 Subject: [PATCH] conflict in explorer layout --- embark-ui/src/components/Console.js | 16 ++++---- embark-ui/src/components/ExplorerLayout.js | 1 + embark-ui/src/components/SearchBar.js | 46 ++++++++++++++++++++++ embark-ui/src/components/search.css | 14 +++++++ 4 files changed, 69 insertions(+), 8 deletions(-) create mode 100644 embark-ui/src/components/SearchBar.js create mode 100644 embark-ui/src/components/search.css diff --git a/embark-ui/src/components/Console.js b/embark-ui/src/components/Console.js index c87115653..3ac2b796a 100644 --- a/embark-ui/src/components/Console.js +++ b/embark-ui/src/components/Console.js @@ -4,7 +4,7 @@ import Convert from 'ansi-to-html'; import { Col, Row, Card, CardBody, CardFooter, TabContent, TabPane, Nav, NavItem, NavLink } from 'reactstrap'; import classnames from 'classnames'; -import {AsyncTypeahead} from 'react-bootstrap-typeahead' +import {AsyncTypeahead} from 'react-bootstrap-typeahead'; import ReactJson from 'react-json-view'; import Logs from "./Logs"; @@ -23,7 +23,7 @@ class Console extends Component { event.preventDefault(); this.props.postCommand(this.state.value); this.setState({value: ''}); - this.typeahead.getInstance().clear() + this.typeahead.getInstance().clear(); } handleChange(value, cb) { @@ -54,7 +54,7 @@ class Console extends Component { ))} - ) + ); } isJsonObject(item) { @@ -119,7 +119,7 @@ class Console extends Component { {this.props.isEmbark() && this.handleChange(text)} onChange={(text) => { if (text && text[0]) { - this.handleChange(text[0].value) + this.handleChange(text[0].value); } }} ref={(typeahead) => this.typeahead = typeahead} @@ -136,12 +136,12 @@ class Console extends Component { onKeyDown={(e) => { if (e.keyCode === 13) { this.handleChange(e.target.value, () => { - this.handleSubmit(e) - }) + this.handleSubmit(e); + }); } }} onSearch={(value) => { - this.props.postCommandSuggestions(value) + this.props.postCommandSuggestions(value); }} filterBy={['value', 'description']} maxHeight="200px" diff --git a/embark-ui/src/components/ExplorerLayout.js b/embark-ui/src/components/ExplorerLayout.js index 360a42c53..1a1a69659 100644 --- a/embark-ui/src/components/ExplorerLayout.js +++ b/embark-ui/src/components/ExplorerLayout.js @@ -14,6 +14,7 @@ import BlocksContainer from '../containers/BlocksContainer'; import BlockContainer from '../containers/BlockContainer'; import TransactionsContainer from '../containers/TransactionsContainer'; import TransactionContainer from '../containers/TransactionContainer'; +import SearchBar from '../components/SearchBar'; const groupItems = [ {to: "/embark/explorer/overview", icon: "signal", value: "Overview"}, diff --git a/embark-ui/src/components/SearchBar.js b/embark-ui/src/components/SearchBar.js new file mode 100644 index 000000000..72aa5fa1b --- /dev/null +++ b/embark-ui/src/components/SearchBar.js @@ -0,0 +1,46 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import {Form, FormGroup, Input, Button, Row, Col} from 'reactstrap'; +import FontAwesome from 'react-fontawesome'; + +import './search.css'; + +class SearchBar extends React.Component { + constructor(props) { + super(props); + + this.state = { + searchValue: '' + }; + } + + onChange(e) { + this.setState({ + searchValue: e.target.value + }); + } + + render() { + return ( + + +
+ + this.onChange(e)} + value={this.state.searchValue}/> + + +
+ +
+ ); + } +} + +SearchBar.propTypes = { + searchSubmit: PropTypes.func.isRequired +}; + +export default SearchBar; diff --git a/embark-ui/src/components/search.css b/embark-ui/src/components/search.css new file mode 100644 index 000000000..53e1acc65 --- /dev/null +++ b/embark-ui/src/components/search.css @@ -0,0 +1,14 @@ +.search-bar { + margin-top: 10px; +} + +.search-bar input { + border-top-right-radius: 0; + border-bottom-right-radius: 0; + border: 0; +} + +.search-bar button { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +}