Disable time conditions in Tx UI #6445

This commit is contained in:
maciejhirsz
2017-09-25 17:08:09 +02:00
parent b74065a471
commit 0e43ce6e07
8 changed files with 68 additions and 27 deletions

View File

@@ -66,6 +66,7 @@ class DeployContract extends Component {
};
static propTypes = {
availability: PropTypes.string.isRequired,
accounts: PropTypes.object.isRequired,
abi: PropTypes.string,
code: PropTypes.string,
@@ -331,6 +332,7 @@ class DeployContract extends Component {
return (
<Extras
availability={ this.props.availability }
gasStore={ this.gasStore }
hideData
isEth
@@ -490,9 +492,11 @@ class DeployContract extends Component {
}
function mapStateToProps (state) {
const { gasLimit } = state.nodeStatus;
const { gasLimit, nodeKind = {} } = state.nodeStatus;
const { availability = 'unknown' } = nodeKind;
return {
availability,
gasLimit
};
}

View File

@@ -22,15 +22,19 @@ import styles from '../executeContract.css';
export default class AdvancedStep extends Component {
static propTypes = {
availability: PropTypes.string.isRequired,
gasStore: PropTypes.object.isRequired
};
render () {
const { gasStore } = this.props;
const { availability, gasStore } = this.props;
return (
<div className={ styles.gaseditor }>
<GasPriceEditor store={ gasStore } />
<GasPriceEditor
availability={ availability }
store={ gasStore }
/>
</div>
);
}

View File

@@ -57,6 +57,7 @@ class ExecuteContract extends Component {
};
static propTypes = {
availability: PropTypes.string.isRequired,
accounts: PropTypes.object,
contract: PropTypes.object.isRequired,
fromAddress: PropTypes.string,
@@ -198,7 +199,7 @@ class ExecuteContract extends Component {
}
renderStep () {
const { accounts, contract, fromAddress, onFromAddressChange } = this.props;
const { availability, accounts, contract, fromAddress, onFromAddressChange } = this.props;
const { step } = this.state;
if (step === STEP_DETAILS) {
@@ -218,7 +219,10 @@ class ExecuteContract extends Component {
}
return (
<AdvancedStep gasStore={ this.gasStore } />
<AdvancedStep
availability={ availability }
gasStore={ this.gasStore }
/>
);
}
@@ -337,9 +341,10 @@ class ExecuteContract extends Component {
}
function mapStateToProps (state) {
const { gasLimit } = state.nodeStatus;
const { gasLimit, nodeKind = {} } = state.nodeStatus;
const { availability = 'unknown' } = nodeKind;
return { gasLimit };
return { availability, gasLimit };
}
export default connect(

View File

@@ -23,6 +23,7 @@ import styles from '../transfer.css';
export default class Extras extends Component {
static propTypes = {
availability: PropTypes.string.isRequired,
data: PropTypes.string,
dataError: PropTypes.string,
hideData: PropTypes.bool,
@@ -38,13 +39,14 @@ export default class Extras extends Component {
};
render () {
const { gasStore, onChange } = this.props;
const { availability, gasStore, onChange } = this.props;
return (
<Form>
{ this.renderData() }
<div className={ styles.gaseditor }>
<GasPriceEditor
availability={ availability }
store={ gasStore }
onChange={ onChange }
/>

View File

@@ -42,6 +42,7 @@ class Transfer extends Component {
}
static propTypes = {
availability: PropTypes.string.isRequired,
newError: PropTypes.func.isRequired,
gasLimit: PropTypes.object.isRequired,
@@ -186,6 +187,7 @@ class Transfer extends Component {
onChange={ this.store.onUpdateDetails }
total={ total }
totalError={ totalError }
availability={ this.props.availability }
/>
);
}
@@ -291,13 +293,14 @@ function mapStateToProps (initState, initProps) {
: null;
return (state) => {
const { gasLimit } = state.nodeStatus;
const { gasLimit, nodeKind = {} } = state.nodeStatus;
const { balances } = state;
const { availability = 'unknown' } = nodeKind;
const balance = balances[address];
const sendersBalances = senders ? pick(balances, Object.keys(senders)) : null;
return { balance, gasLimit, senders, sendersBalances, tokens, wallet };
return { availability, balance, gasLimit, senders, sendersBalances, tokens, wallet };
};
}