diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-11-13 05:30:47 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-11-13 05:30:47 +0800 |
commit | 79f0324abc6e59d5595770e44d620e6d0cccd6bc (patch) | |
tree | cab441568b4362b90f2626257576ebab60b7ecbb /packages/instant/src/components | |
parent | a8a1ea92a614181ebdf6c738139723f0d5c6da69 (diff) | |
download | dexon-sol-tools-79f0324abc6e59d5595770e44d620e6d0cccd6bc.tar dexon-sol-tools-79f0324abc6e59d5595770e44d620e6d0cccd6bc.tar.gz dexon-sol-tools-79f0324abc6e59d5595770e44d620e6d0cccd6bc.tar.bz2 dexon-sol-tools-79f0324abc6e59d5595770e44d620e6d0cccd6bc.tar.lz dexon-sol-tools-79f0324abc6e59d5595770e44d620e6d0cccd6bc.tar.xz dexon-sol-tools-79f0324abc6e59d5595770e44d620e6d0cccd6bc.tar.zst dexon-sol-tools-79f0324abc6e59d5595770e44d620e6d0cccd6bc.zip |
feat: integrate wallet flow with heartbeat and other branches
Diffstat (limited to 'packages/instant/src/components')
3 files changed, 10 insertions, 11 deletions
diff --git a/packages/instant/src/components/buy_order_progress.tsx b/packages/instant/src/components/buy_order_progress.tsx index cb02c8d8c..d93e74c9f 100644 --- a/packages/instant/src/components/buy_order_progress.tsx +++ b/packages/instant/src/components/buy_order_progress.tsx @@ -1,7 +1,7 @@ import * as _ from 'lodash'; import * as React from 'react'; -import { ProgressBar, TimedProgressBar } from '../components/timed_progress_bar'; +import { TimedProgressBar } from '../components/timed_progress_bar'; import { TimeCounter } from '../components/time_counter'; import { Container } from '../components/ui/container'; diff --git a/packages/instant/src/components/payment_method.tsx b/packages/instant/src/components/payment_method.tsx index f596c5ad6..25c879519 100644 --- a/packages/instant/src/components/payment_method.tsx +++ b/packages/instant/src/components/payment_method.tsx @@ -2,7 +2,7 @@ import * as _ from 'lodash'; import * as React from 'react'; import { ColorOption } from '../style/theme'; -import { Account, AccountState, Network, StandardSlidingPanelContent } from '../types'; +import { Account, AccountState, Network } from '../types'; import { MetaMaskLogo } from './meta_mask_logo'; import { PaymentMethodDropdown } from './payment_method_dropdown'; @@ -15,7 +15,8 @@ import { Text } from './ui/text'; export interface PaymentMethodProps { account: Account; network: Network; - openStandardSlidingPanel: (content: StandardSlidingPanelContent) => void; + onInstallWalletClick: () => void; + onUnlockWalletClick: () => void; } export class PaymentMethod extends React.Component<PaymentMethodProps> { @@ -80,7 +81,7 @@ export class PaymentMethod extends React.Component<PaymentMethodProps> { case AccountState.Locked: return ( <WalletPrompt - onClick={this._openInstallWalletPanel} + onClick={this.props.onUnlockWalletClick} image={<Icon width={13} icon="lock" color={ColorOption.black} />} > Please Unlock MetaMask @@ -89,7 +90,7 @@ export class PaymentMethod extends React.Component<PaymentMethodProps> { case AccountState.None: return ( <WalletPrompt - onClick={this._openInstallWalletPanel} + onClick={this.props.onInstallWalletClick} image={<MetaMaskLogo width={19} height={18} />} > Install MetaMask @@ -107,9 +108,6 @@ export class PaymentMethod extends React.Component<PaymentMethodProps> { return null; } }; - private readonly _openInstallWalletPanel = () => { - this.props.openStandardSlidingPanel(StandardSlidingPanelContent.InstallWallet); - }; } interface WalletPromptProps { diff --git a/packages/instant/src/components/zero_ex_instant_provider.tsx b/packages/instant/src/components/zero_ex_instant_provider.tsx index 411f118cc..863bc99b7 100644 --- a/packages/instant/src/components/zero_ex_instant_provider.tsx +++ b/packages/instant/src/components/zero_ex_instant_provider.tsx @@ -91,12 +91,13 @@ export class ZeroExInstantProvider extends React.Component<ZeroExInstantProvider } public componentDidMount(): void { const state = this._store.getState(); + const dispatch = this._store.dispatch; // tslint:disable-next-line:no-floating-promises - asyncData.fetchEthPriceAndDispatchToStore(this._store); + asyncData.fetchEthPriceAndDispatchToStore(dispatch); // fetch available assets if none are specified if (_.isUndefined(state.availableAssets)) { // tslint:disable-next-line:no-floating-promises - asyncData.fetchAvailableAssetDatasAndDispatchToStore(this._store); + asyncData.fetchAvailableAssetDatasAndDispatchToStore(state, dispatch); } if (state.providerState.account.state !== AccountState.None) { this._accountUpdateHeartbeat = generateAccountHeartbeater({ @@ -112,7 +113,7 @@ export class ZeroExInstantProvider extends React.Component<ZeroExInstantProvider }); this._buyQuoteHeartbeat.start(BUY_QUOTE_UPDATE_INTERVAL_TIME_MS); // tslint:disable-next-line:no-floating-promises - asyncData.fetchCurrentBuyQuoteAndDispatchToStore({ store: this._store, shouldSetPending: true }); + asyncData.fetchCurrentBuyQuoteAndDispatchToStore(state, dispatch, true); // warm up the gas price estimator cache just in case we can't // grab the gas price estimate when submitting the transaction // tslint:disable-next-line:no-floating-promises |