fix: show correct shapeshift currency amount
This commit is contained in:
parent
ae5858d656
commit
efc81d8c14
7 changed files with 40 additions and 20 deletions
|
@ -23,7 +23,7 @@ export default class Address extends React.PureComponent<Props> {
|
|||
const { address, doShowSnackBar } = this.props;
|
||||
|
||||
return (
|
||||
<FormRow verticallyCentered padded>
|
||||
<FormRow verticallyCentered padded stretch>
|
||||
<input
|
||||
className="input-copyable form-field__input"
|
||||
readOnly
|
||||
|
|
|
@ -8,6 +8,7 @@ type Props = {
|
|||
children: React.Node,
|
||||
padded?: boolean,
|
||||
verticallyCentered?: boolean,
|
||||
stretch?: boolean,
|
||||
};
|
||||
|
||||
export class FormRow extends React.PureComponent<Props> {
|
||||
|
@ -16,13 +17,14 @@ export class FormRow extends React.PureComponent<Props> {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { centered, children, padded, verticallyCentered } = this.props;
|
||||
const { centered, children, padded, verticallyCentered, stretch } = this.props;
|
||||
return (
|
||||
<div
|
||||
className={classnames('form-row', {
|
||||
'form-row--centered': centered,
|
||||
'form-row--padded': padded,
|
||||
'form-row--vertically-centered': verticallyCentered,
|
||||
'form-row--stretch': stretch,
|
||||
})}
|
||||
>
|
||||
{children}
|
||||
|
|
|
@ -1,18 +1,30 @@
|
|||
// @flow
|
||||
import React from 'react';
|
||||
import QRCodeElement from 'qrcode.react';
|
||||
import classnames from 'classnames';
|
||||
|
||||
type Props = {
|
||||
value: string,
|
||||
paddingRight?: boolean,
|
||||
};
|
||||
|
||||
const QRCode = (props: Props) => {
|
||||
const { value } = props;
|
||||
return (
|
||||
<div className="qr-code">
|
||||
<QRCodeElement value={value} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
class QRCode extends React.Component<Props> {
|
||||
static defaultProps = {
|
||||
paddingRight: false,
|
||||
};
|
||||
|
||||
render() {
|
||||
const { value, paddingRight } = this.props;
|
||||
return (
|
||||
<div
|
||||
className={classnames('qr-code', {
|
||||
'qr-code--right-padding': paddingRight,
|
||||
})}
|
||||
>
|
||||
<QRCodeElement value={value} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default QRCode;
|
||||
|
|
|
@ -16,7 +16,6 @@ type Props = {
|
|||
shiftOrderId: ?string,
|
||||
originCoinDepositMax: ?number,
|
||||
clearShapeShift: Dispatch,
|
||||
doShowSnackBar: Dispatch,
|
||||
getActiveShift: Dispatch,
|
||||
shapeShiftRate: ?number,
|
||||
originCoinDepositMax: ?number,
|
||||
|
@ -25,8 +24,6 @@ type Props = {
|
|||
};
|
||||
|
||||
class ActiveShapeShift extends React.PureComponent<Props> {
|
||||
continousFetch: ?number;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.continousFetch = undefined;
|
||||
|
@ -59,6 +56,8 @@ class ActiveShapeShift extends React.PureComponent<Props> {
|
|||
}
|
||||
}
|
||||
|
||||
continousFetch: ?number;
|
||||
|
||||
render() {
|
||||
const {
|
||||
shiftCoinType,
|
||||
|
@ -68,7 +67,6 @@ class ActiveShapeShift extends React.PureComponent<Props> {
|
|||
shiftState,
|
||||
originCoinDepositMax,
|
||||
clearShapeShift,
|
||||
doShowSnackBar,
|
||||
shapeShiftRate,
|
||||
originCoinDepositFee,
|
||||
originCoinDepositMin,
|
||||
|
@ -95,8 +93,8 @@ class ActiveShapeShift extends React.PureComponent<Props> {
|
|||
|
||||
{shiftDepositAddress && (
|
||||
<FormRow verticallyCentered padded>
|
||||
<Address address={shiftDepositAddress} showCopyButton />
|
||||
<QRCode value={shiftDepositAddress} />
|
||||
<QRCode value={shiftDepositAddress} paddingRight />
|
||||
<Address address={shiftDepositAddress} showCopyButton padded />
|
||||
</FormRow>
|
||||
)}
|
||||
</div>
|
||||
|
|
|
@ -19,7 +19,6 @@ type Props = {
|
|||
isSubmitting: boolean,
|
||||
shiftSupportedCoins: Array<string>,
|
||||
originCoin: string,
|
||||
updating: boolean,
|
||||
getCoinStats: Dispatch,
|
||||
originCoinDepositFee: number,
|
||||
originCoinDepositMin: string,
|
||||
|
@ -38,7 +37,6 @@ export default (props: Props) => {
|
|||
isSubmitting,
|
||||
shiftSupportedCoins,
|
||||
originCoin,
|
||||
updating,
|
||||
getCoinStats,
|
||||
originCoinDepositMax,
|
||||
originCoinDepositMin,
|
||||
|
@ -51,7 +49,7 @@ export default (props: Props) => {
|
|||
prefix={__('Exchange')}
|
||||
postfix={__('for LBC')}
|
||||
type="select"
|
||||
name="origin_coin"
|
||||
name="originCoin"
|
||||
onChange={e => {
|
||||
getCoinStats(e.target.value);
|
||||
handleChange(e);
|
||||
|
@ -76,7 +74,7 @@ export default (props: Props) => {
|
|||
label={__('Return address')}
|
||||
error={touched.returnAddress && !!errors.returnAddress && errors.returnAddress}
|
||||
type="text"
|
||||
name="return_address"
|
||||
name="returnAddress"
|
||||
className="input--address"
|
||||
placeholder={getExampleAddress(originCoin)}
|
||||
onChange={handleChange}
|
||||
|
|
|
@ -338,3 +338,9 @@ p {
|
|||
color: var(--color-meta-light);
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.qr-code {
|
||||
&.qr-code--right-padding {
|
||||
padding-right: $spacing-vertical * 2/3;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,6 +19,10 @@
|
|||
align-items: center;
|
||||
}
|
||||
|
||||
&.form-row--stretch {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.form-field.form-field--stretch {
|
||||
width: 100%;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue