Skip to content

Commit

Permalink
add search box and logo
Browse files Browse the repository at this point in the history
  • Loading branch information
h0ngcha0 committed Oct 27, 2018
1 parent 9d82dd7 commit df842a4
Show file tree
Hide file tree
Showing 8 changed files with 115 additions and 11 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Table of Content
* [Rest API](#rest-api)
* [How to use](#how-to-use)


Parse bitcoin script
--------------------

Expand Down Expand Up @@ -145,4 +144,4 @@ with the following resolver

```scala
resolvers += Resolver.bintrayRepo("liuhongchao", "maven")
```
```
51 changes: 51 additions & 0 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"classnames": "^2.2.5",
"flexboxgrid": "^6.3.1",
"lodash": "^4.17.10",
"material-ui-search-bar": "^1.0.0-beta.13",
"moment": "^2.22.2",
"prop-types": "^15.6.0",
"react": "^16.4.2",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions client/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,26 @@ a {
transform-origin: 50% 50%;
}

.img-responsive.mobile {
display: none;
}

@media only screen and (max-device-width: 480px) {
.img-responsive.desktop {
display: none;
}
.img-responsive.mobile {
display: block;
}
}

.logo-image {
display: block;
margin-left: auto;
margin-right: auto;
margin-bottom: 10px;
}

.ScriptOpCodeList {
margin: 0;
border-radius: 2px;
Expand Down
43 changes: 34 additions & 9 deletions client/src/modules/interpreter/InterpreterContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@ import {TextField, Button, Paper} from '@material-ui/core';
import InterpreterComponent from "./InterpreterComponent";
import URI from 'urijs';
import {interpretTransactionInput} from '../../api';
import desktopLogoImage from '../../assets/images/bitcoin-playground-desktop.png';
import mobileLogoImage from '../../assets/images/bitcoin-playground-mobile.png';
import Loading from '../Loading';
import SearchBar from 'material-ui-search-bar'
/*import InputAdornment from "@material-ui/core/InputAdornment/InputAdornment";
import AccountCircle from '@material-ui/icons/AccountCircle';*/

class InterpreterContainer extends React.Component {
static propTypes = {};

state = {
interpretResult: undefined,
inputIndex: 0,
transactionId: "85db1042f083a8fd6f96fd1a76dc7b8373df9f434979bdcf2432ecf9e0c212ac",
transactionId: "", // 85db1042f083a8fd6f96fd1a76dc7b8373df9f434979bdcf2432ecf9e0c212ac
loading: false,
executingScript: false
};
Expand Down Expand Up @@ -99,9 +104,24 @@ class InterpreterContainer extends React.Component {
render() {
return (
<div className="container">
<Paper className={'application-definition'}>
<h3>Bitcoin Script Interpreter</h3>
<form
<div className={'application-definition'}>


<img src={ mobileLogoImage } className={`logo-image img-responsive mobile`}/>
<img src={ desktopLogoImage } className={`logo-image img-responsive desktop`}/>
<SearchBar
value={this.state.transactionId}
placeholder="BTC transaction id"
onChange={(newValue) => this.handleSetTransactionId(newValue)}
disabled={ this.state.executingScript }
onRequestSearch={() => {
//event.preventDefault();
//event.stopPropagation();
this.interpretScriptWebsocket();
}}
/>

{/* <form
className="container"
onSubmit={ (event) => {
event.preventDefault();
Expand All @@ -117,10 +137,15 @@ class InterpreterContainer extends React.Component {
label="Transaction Id"
value={this.state.transactionId}
onChange={ (event) => {this.handleSetTransactionId(event.target.value)} }
InputLabelProps={{
shrink: true,
}}
margin="normal"
variant="outlined"
InputProps={{
startAdornment: (
<InputAdornment position="start">
<AccountCircle />
</InputAdornment>
),
}}
/>
</div>
<div>
Expand All @@ -146,12 +171,12 @@ class InterpreterContainer extends React.Component {
}
</div>
</form>
</form>*/}
{
this.state.interpretResult ?
<InterpreterComponent interpretResult={this.state.interpretResult} /> : null
}
</Paper>
</div>
</div>
);
}
Expand Down
8 changes: 8 additions & 0 deletions client/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5347,6 +5347,14 @@ map-visit@^1.0.0:
dependencies:
object-visit "^1.0.0"

material-ui-search-bar@^1.0.0-beta.13:
version "1.0.0-beta.13"
resolved "https://registry.yarnpkg.com/material-ui-search-bar/-/material-ui-search-bar-1.0.0-beta.13.tgz#08c246431666f91c3ca52df78987b86352783ee1"
integrity sha512-ETZiBvza26+0dyHamUO1Nmh5oRymdzmMM1Z6QH+wraQ6e+0GQdwuJjX4T0eL+nKYDBQB4UpSbFhkBs5ECN2QwA==
dependencies:
classnames "^2.2.5"
prop-types "^15.5.8"

math-expression-evaluator@^1.2.14:
version "1.2.17"
resolved "https://registry.yarnpkg.com/math-expression-evaluator/-/math-expression-evaluator-1.2.17.tgz#de819fdbcd84dccd8fae59c6aeb79615b9d266ac"
Expand Down

0 comments on commit df842a4

Please sign in to comment.