conflict in editor

This commit is contained in:
Jonathan Rainville 2018-10-28 15:02:03 +01:00
parent 19ad229dbb
commit 8b1f970f74
8 changed files with 97 additions and 83 deletions

View File

@ -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;

View File

@ -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";
@ -95,17 +97,22 @@ class ContractFunction extends Component {
render() {
return (
<Card className="contract-function-container">
<CardHeader className="collapsable" onClick={() => this.toggleFunction()}>
<CardHeader className={classnames({collapsable: !ContractFunction.isEvent(this.props.method), closed: !this.state.functionCollapse})}
onClick={() => this.toggleFunction()}>
<CardTitle>
{ContractFunction.isPureCall(this.props.method) &&
<button className="btn btn-warning btn-sm float-right" onClick={(e) => this.handleCall(e)}>call</button>
{ContractFunction.isPureCall(this.props.method) && Boolean(this.props.method.inputs.length) &&
<Badge color="warning" className="float-right p-2">call</Badge>
}
{ContractFunction.isPureCall(this.props.method) && !this.props.method.inputs.length &&
<Button color="warning" size="sm" className="float-right" onClick={(e) => this.handleCall(e)}>call</Button>
}
{ContractFunction.isEvent(this.props.method) &&
<button className="btn btn-info btn-sm float-right">event</button>
<Badge color="info" className="float-right p-2">event</Badge>
}
{this.props.method.name}({this.props.method.inputs.map(input => input.name).join(', ')})
</CardTitle>
</CardHeader>
{!ContractFunction.isEvent(this.props.method) &&
<Collapse isOpen={this.state.functionCollapse} className="relative">
<CardBody>
<Form method="post" inline>
@ -133,7 +140,8 @@ class ContractFunction extends Component {
<Input name="gasPrice" id="gasPrice" placeholder="uint256"
value={this.state.inputs.gasPrice || ''}
onChange={(e) => this.handleChange(e, 'gasPrice')}/>
<Button onClick={(e) => this.autoSetGasPrice(e)} title="Automatically set the gas price to what is currently in the estimator (default: safe low)">
<Button onClick={(e) => this.autoSetGasPrice(e)}
title="Automatically set the gas price to what is currently in the estimator (default: safe low)">
Auto-set
</Button>
</FormGroup>
@ -151,12 +159,12 @@ class ContractFunction extends Component {
</Row>
</Col>
}
<Button className="contract-function-button" color="primary" disabled={this.callDisabled()}
<Button className="contract-function-button float-right" color="primary" disabled={this.callDisabled()}
onClick={(e) => this.handleCall(e)}>
{this.buttonTitle()}
</Button>
<div className="clearfix"/>
</CardBody>
</Collapse>
{this.props.contractFunctions && this.props.contractFunctions.length > 0 && <CardFooter>
<ListGroup>
{this.props.contractFunctions.map(contractFunction => (
@ -167,6 +175,8 @@ class ContractFunction extends Component {
))}
</ListGroup>
</CardFooter>}
</Collapse>}
</Card>
);
}

View File

@ -54,7 +54,7 @@ class SearchBar extends React.Component {
value={this.state.searchValue}
onBlur={() => this.hideForm()}
onKeyPress={e => this.onKeyPress(e)}/>
<Button className='search-bar__button' color="secondary" onClick={(e) => this.onSubmit(e)}>
<Button className="search-bar__button" color="secondary" onClick={(e) => this.onSubmit(e)}>
<FontAwesome name="search"/>
</Button>
</div>

View File

@ -1,4 +0,0 @@
.text-editor__debuggerLine {
opacity: 0.4;
background-color: #20a8d8;
}

View File

@ -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';

View File

@ -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;
}

View File

@ -71,7 +71,7 @@ class EditorContainer extends React.Component {
<Col xs={this.textEditorXsSize()} md={this.textEditorMdSize()} style={{overflow: 'hidden'}}>
<TextEditorContainer currentFile={this.props.currentFile} onFileContentChange={(newContent) => this.onFileContentChange(newContent)} />
</Col>
{this.state.currentAsideTab && <Col xs={6} md={3}>
{this.state.currentAsideTab && <Col xs={6} md={3} className="editor-aside">
<TextEditorAsideContainer currentAsideTab={this.state.currentAsideTab} currentFile={this.props.currentFile} />
</Col>}
</Row>

View File

@ -56,7 +56,7 @@ class TextEditorAsideContainer extends Component {
render() {
return this.props.contracts.map((contract, index) => {
return (
<Card key={'contract-' + index}>
<Card key={'contract-' + index} className="explorer-aside-card">
<CardBody>
{this.renderContent(contract, index)}
</CardBody>