From 8b1f970f74c5e19a87009881e06f0d2b6a664e10 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Sun, 28 Oct 2018 15:02:03 +0100 Subject: [PATCH] conflict in editor --- embark-ui/src/components/ContractOverview.css | 10 -- embark-ui/src/components/ContractOverview.js | 140 ++++++++++-------- embark-ui/src/components/SearchBar.js | 2 +- embark-ui/src/components/TextEditor.css | 4 - embark-ui/src/components/TextEditor.js | 1 - embark-ui/src/containers/EditorContainer.css | 19 +++ embark-ui/src/containers/EditorContainer.js | 2 +- .../containers/TextEditorAsideContainer.js | 2 +- 8 files changed, 97 insertions(+), 83 deletions(-) delete mode 100644 embark-ui/src/components/TextEditor.css diff --git a/embark-ui/src/components/ContractOverview.css b/embark-ui/src/components/ContractOverview.css index 5f34a49d..d5645d35 100644 --- a/embark-ui/src/components/ContractOverview.css +++ b/embark-ui/src/components/ContractOverview.css @@ -1,13 +1,3 @@ -.contract-function-container .collapse.show .card-body { - min-height: 65px; -} - -.contract-function-container .contract-function-button { - position: absolute; - bottom: 15px; - right: 15px; -} - .contract-function-container .gas-price-form #gasPrice { border-top-right-radius: 0; border-bottom-right-radius: 0; diff --git a/embark-ui/src/components/ContractOverview.js b/embark-ui/src/components/ContractOverview.js index f02b27fb..1c0ed194 100644 --- a/embark-ui/src/components/ContractOverview.js +++ b/embark-ui/src/components/ContractOverview.js @@ -8,6 +8,7 @@ import { Label, Input, Button, + Badge, Card, CardBody, CardHeader, @@ -20,6 +21,7 @@ import { import GasStationContainer from "../containers/GasStationContainer"; import {formatContractForDisplay} from '../utils/presentation'; import FontAwesome from 'react-fontawesome'; +import classnames from 'classnames'; import "./ContractOverview.css"; @@ -94,69 +96,75 @@ class ContractFunction extends Component { render() { return ( - - this.toggleFunction()}> - - {ContractFunction.isPureCall(this.props.method) && - - } - {ContractFunction.isEvent(this.props.method) && - - } - {this.props.method.name}({this.props.method.inputs.map(input => input.name).join(', ')}) - - - - -
- {this.props.method.inputs.map(input => ( - - - this.handleChange(e, input.name)}/> - - ))} -
- {!ContractFunction.isPureCall(this.props.method) && - - - this.toggleOptions()}> - - Advanced Options - - - - -
- - - this.handleChange(e, 'gasPrice')}/> - - -
-

this.toggleGasPrice()}> - - Gas price estimator -

- - { - if (instance) this.gasStation = instance.getWrappedInstance(); - }}/> - + + this.toggleFunction()}> + + {ContractFunction.isPureCall(this.props.method) && Boolean(this.props.method.inputs.length) && + call + } + {ContractFunction.isPureCall(this.props.method) && !this.props.method.inputs.length && + + } + {ContractFunction.isEvent(this.props.method) && + event + } + {this.props.method.name}({this.props.method.inputs.map(input => input.name).join(', ')}) + + + {!ContractFunction.isEvent(this.props.method) && + + +
+ {this.props.method.inputs.map(input => ( + + + this.handleChange(e, input.name)}/> + + ))} +
+ {!ContractFunction.isPureCall(this.props.method) && + + + this.toggleOptions()}> + + Advanced Options + + + + +
+ + + this.handleChange(e, 'gasPrice')}/> + + +
+

this.toggleGasPrice()}> + + Gas price estimator +

+ + { + if (instance) this.gasStation = instance.getWrappedInstance(); + }}/> -
- - } - -
-
+
+
+ + } + +
+ {this.props.contractFunctions && this.props.contractFunctions.length > 0 && {this.props.contractFunctions.map(contractFunction => ( @@ -167,7 +175,9 @@ class ContractFunction extends Component { ))} } - + } + + ); } } @@ -193,7 +203,7 @@ const ContractOverview = (props) => {
{(contractDisplay.state === 'Deployed') &&
Deployed at {contractDisplay.address}
} {(contractDisplay.state !== 'Deployed') &&
{contractDisplay.address}
} -
+
{contractProfile.methods .filter((method) => { return props.onlyConstructor ? method.type === 'constructor' : method.type !== 'constructor'; @@ -202,7 +212,7 @@ const ContractOverview = (props) => { method={method} contractFunctions={filterContractFunctions(props.contractFunctions, contractProfile.name, method.name)} contractProfile={contractProfile} - postContractFunction={props.postContractFunction} />)} + postContractFunction={props.postContractFunction}/>)}
); }; diff --git a/embark-ui/src/components/SearchBar.js b/embark-ui/src/components/SearchBar.js index 9167ef2a..bd6a1466 100644 --- a/embark-ui/src/components/SearchBar.js +++ b/embark-ui/src/components/SearchBar.js @@ -54,7 +54,7 @@ class SearchBar extends React.Component { value={this.state.searchValue} onBlur={() => this.hideForm()} onKeyPress={e => this.onKeyPress(e)}/> -
diff --git a/embark-ui/src/components/TextEditor.css b/embark-ui/src/components/TextEditor.css deleted file mode 100644 index 58a85a79..00000000 --- a/embark-ui/src/components/TextEditor.css +++ /dev/null @@ -1,4 +0,0 @@ -.text-editor__debuggerLine { - opacity: 0.4; - background-color: #20a8d8; -} \ No newline at end of file diff --git a/embark-ui/src/components/TextEditor.js b/embark-ui/src/components/TextEditor.js index 0835adc7..b84c37ac 100644 --- a/embark-ui/src/components/TextEditor.js +++ b/embark-ui/src/components/TextEditor.js @@ -5,7 +5,6 @@ import FontAwesomeIcon from 'react-fontawesome'; import classNames from 'classnames'; import {DARK_THEME, LIGHT_THEME} from '../constants'; -import './TextEditor.css'; const SUPPORTED_LANGUAGES = ['css', 'sol', 'html', 'json']; const DEFAULT_LANGUAGE = 'javascript'; diff --git a/embark-ui/src/containers/EditorContainer.css b/embark-ui/src/containers/EditorContainer.css index 62018117..2e9c73dc 100644 --- a/embark-ui/src/containers/EditorContainer.css +++ b/embark-ui/src/containers/EditorContainer.css @@ -10,3 +10,22 @@ right: 0; left: 0; } + +.text-editor__debuggerLine { + opacity: 0.4; + background-color: #20a8d8; +} + +.explorer-aside-card { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + overflow: auto; +} + +.contract-function-container .card-header.closed { + border-bottom: none; + border-radius: 0.25rem; +} diff --git a/embark-ui/src/containers/EditorContainer.js b/embark-ui/src/containers/EditorContainer.js index cec5950a..2a564bba 100644 --- a/embark-ui/src/containers/EditorContainer.js +++ b/embark-ui/src/containers/EditorContainer.js @@ -71,7 +71,7 @@ class EditorContainer extends React.Component { this.onFileContentChange(newContent)} /> - {this.state.currentAsideTab && + {this.state.currentAsideTab && } diff --git a/embark-ui/src/containers/TextEditorAsideContainer.js b/embark-ui/src/containers/TextEditorAsideContainer.js index 798cbbe2..caafa894 100644 --- a/embark-ui/src/containers/TextEditorAsideContainer.js +++ b/embark-ui/src/containers/TextEditorAsideContainer.js @@ -56,7 +56,7 @@ class TextEditorAsideContainer extends Component { render() { return this.props.contracts.map((contract, index) => { return ( - + {this.renderContent(contract, index)}