From bf491c7d14076724d9201ace919e55bdc35df6c3 Mon Sep 17 00:00:00 2001 From: OleksandrSobol Date: Wed, 28 Oct 2020 19:33:04 +0200 Subject: [PATCH] CAKE-130 | confirmation button shown only for pairs when user send xmr; if provider is xmr.to then button title is Confirm, else button title is Send XMR --- .../exchange_trade/exchange_trade_page.dart | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/lib/src/screens/exchange_trade/exchange_trade_page.dart b/lib/src/screens/exchange_trade/exchange_trade_page.dart index cfadd48ff..15c1a8a77 100644 --- a/lib/src/screens/exchange_trade/exchange_trade_page.dart +++ b/lib/src/screens/exchange_trade/exchange_trade_page.dart @@ -227,11 +227,7 @@ class ExchangeTradeState extends State { ); }), bottomSectionPadding: EdgeInsets.fromLTRB(24, 0, 24, 24), - bottomSection: PrimaryButton( - onPressed: () {}, - text: S.of(context).confirm, - color: Theme.of(context).accentTextTheme.body2.color, - textColor: Colors.white) + bottomSection: /*Observer( builder: (_) => tradeStore.trade.from == CryptoCurrency.xmr && !(sendStore.state is TransactionCommitted) @@ -250,6 +246,24 @@ class ExchangeTradeState extends State { color: Colors.blue, textColor: Colors.white) : Offstage()),*/ + Observer( + builder: (_) { + final trade = widget.exchangeTradeViewModel.trade; + + return trade.from == CryptoCurrency.xmr + ? LoadingPrimaryButton( + isDisabled: trade.inputAddress == null || + trade.inputAddress.isEmpty, + isLoading: false, // FIXME + onPressed: () {}, // FIXME + text: trade.provider == + ExchangeProviderDescription.xmrto + ? S.of(context).confirm + : S.of(context).send_xmr, + color: Theme.of(context).accentTextTheme.body2.color, + textColor: Colors.white) + : Offstage(); + }) ), ); }