From d0c009adff53d94414cf51028eff490e0452a3c9 Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Wed, 7 Nov 2018 18:02:24 -0800 Subject: feat(instant): fetch account address at startup and drive account state changes --- packages/instant/src/components/buy_button.tsx | 21 ++++++---------- .../src/components/buy_order_state_buttons.tsx | 2 ++ .../src/components/zero_ex_instant_provider.tsx | 4 +-- packages/instant/src/constants.ts | 14 ++++++++++- .../selected_asset_buy_order_state_buttons.ts | 6 ++++- packages/instant/src/redux/actions.ts | 8 ++++++ packages/instant/src/redux/async_data.ts | 21 ++++++++++++++++ packages/instant/src/redux/reducer.ts | 29 +++++++++++++++++++++- .../instant/src/util/provider_state_factory.ts | 8 +----- 9 files changed, 88 insertions(+), 25 deletions(-) (limited to 'packages') diff --git a/packages/instant/src/components/buy_button.tsx b/packages/instant/src/components/buy_button.tsx index 515cd18e9..f24bb57ee 100644 --- a/packages/instant/src/components/buy_button.tsx +++ b/packages/instant/src/components/buy_button.tsx @@ -16,6 +16,7 @@ import { Button } from './ui/button'; import { Text } from './ui/text'; export interface BuyButtonProps { + accountAddress?: string; buyQuote?: BuyQuote; assetBuyer: AssetBuyer; affiliateInfo?: AffiliateInfo; @@ -34,7 +35,8 @@ export class BuyButton extends React.Component { onBuyFailure: util.boundNoop, }; public render(): React.ReactNode { - const shouldDisableButton = _.isUndefined(this.props.buyQuote); + const { buyQuote, accountAddress } = this.props; + const shouldDisableButton = _.isUndefined(buyQuote) || _.isUndefined(accountAddress); return (