mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-01-12 12:04:21 +00:00
9ef1920fe0
* Align footer to bottom * Fix request payment offset padding * Update request payment padding * Add new Input and Dropdown components * Fix offset margins in equiv vals * Update all send tx inputs & dropdowns * Update generate wallet dropdowns * Update inputs & dropdowns for contracts tab * Add inputs & dropdowns for all but swap tab * amend * Fix imports * inputs are invalid when not disabled or readonly * Fix offset refresh button * Add togglable password back to wallet generation * Update swap inputs, textareas, and dropdowns * Update any outstanding inputs * Make UnitDropDown searchable * unitdropdown searchanble if options > 10 * Fix css issues * Reset before setting currentTo
106 lines
2.7 KiB
TypeScript
106 lines
2.7 KiB
TypeScript
import { TShowNotification } from 'actions/notifications';
|
|
import {
|
|
TRestartSwap,
|
|
TStartPollBityOrderStatus,
|
|
TStartPollShapeshiftOrderStatus,
|
|
TStopOrderTimerSwap,
|
|
TStopPollBityOrderStatus,
|
|
TStopPollShapeshiftOrderStatus
|
|
} from 'actions/swap';
|
|
import { SwapInput } from 'reducers/swap/types';
|
|
import React, { PureComponent } from 'react';
|
|
import BitcoinQR from './BitcoinQR';
|
|
import PaymentInfo from './PaymentInfo';
|
|
import SwapProgress from './SwapProgress';
|
|
import { LiteSend } from './LiteSend';
|
|
|
|
interface ReduxStateProps {
|
|
destinationAddress: string;
|
|
origin: SwapInput;
|
|
destination: SwapInput;
|
|
reference: string;
|
|
secondsRemaining: number | null;
|
|
paymentAddress: string | null;
|
|
provider: string;
|
|
bityOrderStatus: string | null;
|
|
shapeshiftOrderStatus: string | null;
|
|
outputTx: any;
|
|
}
|
|
|
|
interface ReduxActionProps {
|
|
restartSwap: TRestartSwap;
|
|
startPollBityOrderStatus: TStartPollBityOrderStatus;
|
|
stopPollBityOrderStatus: TStopPollBityOrderStatus;
|
|
startPollShapeshiftOrderStatus: TStartPollShapeshiftOrderStatus;
|
|
stopPollShapeshiftOrderStatus: TStopPollShapeshiftOrderStatus;
|
|
stopOrderTimerSwap: TStopOrderTimerSwap;
|
|
showNotification: TShowNotification;
|
|
}
|
|
|
|
export default class PartThree extends PureComponent<ReduxActionProps & ReduxStateProps, {}> {
|
|
public componentDidMount() {
|
|
const { provider } = this.props;
|
|
if (provider === 'shapeshift') {
|
|
this.props.startPollShapeshiftOrderStatus();
|
|
} else {
|
|
this.props.startPollBityOrderStatus();
|
|
}
|
|
}
|
|
|
|
public componentWillUnmount() {
|
|
this.props.stopOrderTimerSwap();
|
|
this.props.stopPollBityOrderStatus();
|
|
this.props.stopPollShapeshiftOrderStatus();
|
|
}
|
|
|
|
public render() {
|
|
const {
|
|
// STATE
|
|
origin,
|
|
destination,
|
|
paymentAddress,
|
|
provider,
|
|
bityOrderStatus,
|
|
shapeshiftOrderStatus,
|
|
destinationAddress,
|
|
outputTx,
|
|
// ACTIONS
|
|
showNotification
|
|
} = this.props;
|
|
|
|
const SwapProgressProps = {
|
|
originId: origin.label,
|
|
destinationId: destination.label,
|
|
provider,
|
|
bityOrderStatus,
|
|
shapeshiftOrderStatus,
|
|
showNotification,
|
|
destinationAddress,
|
|
outputTx
|
|
};
|
|
|
|
const PaymentInfoProps = {
|
|
origin,
|
|
paymentAddress
|
|
};
|
|
|
|
const BitcoinQRProps = {
|
|
paymentAddress,
|
|
destinationAmount: destination.amount as number
|
|
};
|
|
|
|
const OpenOrder = bityOrderStatus === 'OPEN' || shapeshiftOrderStatus === 'no_deposits';
|
|
|
|
return (
|
|
<div>
|
|
<SwapProgress {...SwapProgressProps} />
|
|
|
|
<PaymentInfo {...PaymentInfoProps} />
|
|
|
|
<LiteSend />
|
|
{OpenOrder && origin.label === 'BTC' && <BitcoinQR {...BitcoinQRProps} />}
|
|
</div>
|
|
);
|
|
}
|
|
}
|