Browse Source

fixed code formatting

all-modes^2^2
pbca26 7 years ago
parent
commit
81de7c5b31
  1. 43
      react/src/components/dashboard/bodyBottom/bodyBottom.js
  2. 19
      react/src/components/dashboard/invoiceModal/invoiceModal.js
  3. 54
      react/src/components/dashboard/invoiceModal/invoiceModal.render.js

43
react/src/components/dashboard/bodyBottom/bodyBottom.js

@ -3,31 +3,30 @@ import ReactDOM from 'react-dom';
import PropTypes from 'prop-types';
export default class BodyEnd extends React.PureComponent {
static propTypes = {
children: PropTypes.node,
};
static propTypes = {
children: PropTypes.node,
};
componentDidMount() {
this._popup = document.createElement('div');
document.body.appendChild(this._popup);
this._render();
}
componentDidMount() {
this._popup = document.createElement('div');
document.body.appendChild(this._popup);
this._render();
}
componentDidUpdate() {
this._render();
}
componentDidUpdate() {
this._render();
}
componentWillUnmount() {
ReactDOM.unmountComponentAtNode(this._popup);
document.body.removeChild(this._popup);
}
componentWillUnmount() {
ReactDOM.unmountComponentAtNode(this._popup);
document.body.removeChild(this._popup);
}
_render() {
ReactDOM.render(this.props.children, this._popup);
}
_render() {
ReactDOM.render(this.props.children, this._popup);
}
render() {
return null;
}
render() {
return null;
}
}

19
react/src/components/dashboard/invoiceModal/invoiceModal.js

@ -37,17 +37,17 @@ class InvoiceModal extends React.Component {
[e.target.name]: e.target.value
}, this.updateQRContent);
}
updateQRContent() {
this.setState({
content: JSON.stringify({
"address": this.state.qrAddress,
"amount": this.state.qrAmount,
"coin": this.props.ActiveCoin.coin,
content: JSON.stringify({
address: this.state.qrAddress,
amount: this.state.qrAmount,
coin: this.props.ActiveCoin.coin,
}),
});
}
closeModal() {
this.setState({
modalIsOpen: false,
@ -99,7 +99,7 @@ class InvoiceModal extends React.Component {
}
items.push(
AddressItemRender.call(this, address, type)
AddressItemRender.call(this, address, type)
);
}
@ -115,7 +115,6 @@ class InvoiceModal extends React.Component {
} else {
return InvoiceModalButtonRender.call(this);
}
}
}
@ -134,10 +133,8 @@ const mapStateToProps = (state) => {
},
Dashboard: {
activeHandle: state.Dashboard.activeHandle,
}
},
};
};
export default connect(mapStateToProps)(InvoiceModal);

54
react/src/components/dashboard/invoiceModal/invoiceModal.render.js

@ -26,37 +26,37 @@ export const InvoiceModalRender = function () {
<div className="col-lg-8 form-group form-material vertical-align-middle">
<form>
<label
className="control-label"
htmlFor="qrAddress">
className="control-label"
htmlFor="qrAddress">
{ translate('INDEX.RECEIVING_ADDRESS') }
</label>
<select
className="form-control"
name="qrAddress"
id="qrAddress"
value={ this.state.qrAddress }
onChange={ this.updateInput }>
<option value="-1">
{ translate('INDEX.CHOOSE_RECEIVING_ADDRESS') }
</option>
{ this.renderAddressList('public') }
{ this.isNativeMode() && this.renderAddressList('private') }
className="form-control"
name="qrAddress"
id="qrAddress"
value={ this.state.qrAddress }
onChange={ this.updateInput }>
<option value="-1">
{ translate('INDEX.CHOOSE_RECEIVING_ADDRESS') }
</option>
{ this.renderAddressList('public') }
{ this.isNativeMode() && this.renderAddressList('private') }
</select>
<label
className="control-label margin-top-20"
htmlFor="qrCoinAmount">
className="control-label margin-top-20"
htmlFor="qrCoinAmount">
{ this.props.ActiveCoin.coin }
</label>
<input
type="number"
min="0"
className="form-control"
id="qrCoinAmount"
name="qrAmount"
placeholder="0"
autoComplete="off"
value={ this.state.qrAmount }
onChange={ this.updateInput } />
type="number"
min="0"
className="form-control"
id="qrCoinAmount"
name="qrAmount"
placeholder="0"
autoComplete="off"
value={ this.state.qrAmount }
onChange={ this.updateInput } />
</form>
</div>
<div className="col-lg-4">
@ -65,10 +65,10 @@ export const InvoiceModalRender = function () {
size={ 198 } />
</div>
</div>
<div className="row">
<div className="row hide">
<div className="col-lg-12">
<p className="help-block">
{ translate('INDEX.QR_CONTENT') }:<br />
{ translate('INDEX.QR_CONTENT') }:<br />
{ this.state.content }
</p>
</div>
@ -87,10 +87,10 @@ export const InvoiceModalRender = function () {
export const InvoiceModalButtonRender = function () {
return (
<span>
<button type="button"
<button type="button"
className="btn btn-success waves-effect waves-light margin-right-10"
onClick={ this.openModal }>
<i className="icon fa-file-text-o"></i>
<i className="icon fa-file-text-o"></i>&nbsp;
{ translate('INDEX.CREATE_INVOICE') }
</button>
</span>

Loading…
Cancel
Save