newdesign | blocked address text fields in exchange pages for wallet address; refactored exchange page and exchange template page; added base exchange widget and present provider picker

This commit is contained in:
Oleksandr Sobol
2020-05-18 20:23:33 +03:00
parent 9bace0cd3c
commit 8769e93025
19 changed files with 680 additions and 926 deletions
+17 -4
View File
@@ -33,6 +33,8 @@ abstract class ExchangeStoreBase with Store {
provider = initialProvider;
depositCurrency = initialDepositCurrency;
receiveCurrency = initialReceiveCurrency;
isDepositAddressEnabled = !(depositCurrency == walletStore.type);
isReceiveAddressEnabled = !(receiveCurrency == walletStore.type);
depositAmount = '';
receiveAmount = '';
depositAddress = '';
@@ -73,6 +75,12 @@ abstract class ExchangeStoreBase with Store {
@observable
String receiveAddress;
@observable
bool isDepositAddressEnabled;
@observable
bool isReceiveAddressEnabled;
@observable
bool isValid;
@@ -99,12 +107,16 @@ abstract class ExchangeStoreBase with Store {
void changeDepositCurrency({CryptoCurrency currency}) {
depositCurrency = currency;
_onPairChange();
isDepositAddressEnabled = !(depositCurrency == walletStore.type);
isReceiveAddressEnabled = !(receiveCurrency == walletStore.type);
}
@action
void changeReceiveCurrency({CryptoCurrency currency}) {
receiveCurrency = currency;
_onPairChange();
isDepositAddressEnabled = !(depositCurrency == walletStore.type);
isReceiveAddressEnabled = !(receiveCurrency == walletStore.type);
}
@action
@@ -224,12 +236,13 @@ abstract class ExchangeStoreBase with Store {
void reset() {
depositAmount = '';
receiveAmount = '';
depositAddress = '';
receiveAddress = '';
provider = XMRTOExchangeProvider();
depositCurrency = CryptoCurrency.xmr;
receiveCurrency = CryptoCurrency.btc;
loadLimits();
depositAddress = depositCurrency == walletStore.type ? walletStore.address : '';
receiveAddress = receiveCurrency == walletStore.type ? walletStore.address : '';
isDepositAddressEnabled = !(depositCurrency == walletStore.type);
isReceiveAddressEnabled = !(receiveCurrency == walletStore.type);
_onPairChange();
}
List<ExchangeProvider> providersForCurrentPair() {