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
OleksandrSobol committed
Oct 28, 2020 at 19:33 UTC
bf491c7d14076724d9201ace919e55bdc35df6c3
1 file changed
+19
-5
lib/src/screens/exchange_trade/exchange_trade_page.dart
+19
-5
@@ -227,11 +227,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
227
);
228
}),
229
bottomSectionPadding: EdgeInsets.fromLTRB(24, 0, 24, 24),
230
- bottomSection: PrimaryButton(
231
- onPressed: () {},
232
- text: S.of(context).confirm,
233
- color: Theme.of(context).accentTextTheme.body2.color,
234
- textColor: Colors.white)
230
+ bottomSection:
231
/*Observer(
232
builder: (_) => tradeStore.trade.from == CryptoCurrency.xmr &&
233
!(sendStore.state is TransactionCommitted)
@@ -250,6 +246,24 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
246
color: Colors.blue,
247
textColor: Colors.white)
248
: Offstage()),*/
249
+ Observer(
250
+ builder: (_) {
251
+ final trade = widget.exchangeTradeViewModel.trade;
252
+
253
+ return trade.from == CryptoCurrency.xmr
254
+ ? LoadingPrimaryButton(
255
+ isDisabled: trade.inputAddress == null ||
256
+ trade.inputAddress.isEmpty,
257
+ isLoading: false, // FIXME
258
+ onPressed: () {}, // FIXME
259
+ text: trade.provider ==
260
+ ExchangeProviderDescription.xmrto
261
+ ? S.of(context).confirm
262
+ : S.of(context).send_xmr,
263
+ color: Theme.of(context).accentTextTheme.body2.color,
264
+ textColor: Colors.white)
265
+ : Offstage();
266
+ })
267
),
268
);
269
}