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

This commit is contained in:
OleksandrSobol 2020-10-28 19:33:04 +02:00
parent 44e55f0bc4
commit bf491c7d14

View file

@ -227,11 +227,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
);
}),
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<ExchangeTradeForm> {
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();
})
),
);
}