mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-12-01 12:04:21 +01:00
UI enhancements (#1895)
* UI enhancements [skip ci] * Fix spacing for swap screen * Cleanup and update backup page [skip ci] * Fix address book page * Update address book page * Update standard lists * Update hamburger menu * Make toggle rows tappable * Make more components TextButtons * Make button dock float * Fix shadows * Update [skip ci] * Update all cards with shadow and proper alignment * Fix component positioning and scaling * Cleanup, update strings, rename strings * Fix spacing on Swap and Send pages [skip ci] * Remove Wallets action button [skip ci] * Move Sign/Verify into settings [skip ci] * Cleanup & fix merge conflicts (pls) [skip ci] * Fix formatting [skip ci] * Move bottom bar to navigation_dock.dart [skip ci] * Fix card spacing * Conflict resolution [skip ci] * Conflict resolution [skip ci] * Update shadow theming * Update menu * Temporarily remove shadow * Temporarily remove shadows again * Update setting_action_button.dart --------- Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
@@ -52,6 +52,8 @@ import 'package:http/http.dart' as http;
|
||||
import 'package:mobx/mobx.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import '../../themes/theme_base.dart';
|
||||
|
||||
part 'dashboard_view_model.g.dart';
|
||||
|
||||
class DashboardViewModel = DashboardViewModelBase with _$DashboardViewModel;
|
||||
@@ -70,7 +72,7 @@ abstract class DashboardViewModelBase with Store {
|
||||
required this.sharedPreferences,
|
||||
required this.keyService})
|
||||
: hasTradeAction = false,
|
||||
hasExchangeAction = false,
|
||||
hasSwapAction = false,
|
||||
isShowFirstYatIntroduction = false,
|
||||
isShowSecondYatIntroduction = false,
|
||||
isShowThirdYatIntroduction = false,
|
||||
@@ -480,6 +482,34 @@ abstract class DashboardViewModelBase with Store {
|
||||
@computed
|
||||
bool get hasEnabledMwebBefore => settingsStore.hasEnabledMwebBefore;
|
||||
|
||||
@action
|
||||
double getShadowSpread() {
|
||||
double spread = 0;
|
||||
if (settingsStore.currentTheme.type == ThemeType.bright)
|
||||
spread = 0;
|
||||
else if (settingsStore.currentTheme.type == ThemeType.light)
|
||||
spread = 0;
|
||||
else if (settingsStore.currentTheme.type == ThemeType.dark)
|
||||
spread = 0;
|
||||
else if (settingsStore.currentTheme.type == ThemeType.oled)
|
||||
spread = 0;
|
||||
return spread;
|
||||
}
|
||||
|
||||
@action
|
||||
double getShadowBlur() {
|
||||
double blur = 0;
|
||||
if (settingsStore.currentTheme.type == ThemeType.bright)
|
||||
blur = 0;
|
||||
else if (settingsStore.currentTheme.type == ThemeType.light)
|
||||
blur = 0;
|
||||
else if (settingsStore.currentTheme.type == ThemeType.dark)
|
||||
blur = 0;
|
||||
else if (settingsStore.currentTheme.type == ThemeType.oled)
|
||||
blur = 0;
|
||||
return blur;
|
||||
}
|
||||
|
||||
@action
|
||||
void setMwebEnabled() {
|
||||
if (!hasMweb) {
|
||||
@@ -530,10 +560,10 @@ abstract class DashboardViewModelBase with Store {
|
||||
void furtherShowYatPopup(bool shouldShow) => settingsStore.shouldShowYatPopup = shouldShow;
|
||||
|
||||
@computed
|
||||
bool get isEnabledExchangeAction => settingsStore.exchangeStatus != ExchangeApiMode.disabled;
|
||||
bool get isEnabledSwapAction => settingsStore.exchangeStatus != ExchangeApiMode.disabled;
|
||||
|
||||
@observable
|
||||
bool hasExchangeAction;
|
||||
bool hasSwapAction;
|
||||
|
||||
@computed
|
||||
bool get isEnabledTradeAction => !settingsStore.disableTradeOption;
|
||||
@@ -736,7 +766,7 @@ abstract class DashboardViewModelBase with Store {
|
||||
}
|
||||
|
||||
void updateActions() {
|
||||
hasExchangeAction = !isHaven;
|
||||
hasSwapAction = !isHaven;
|
||||
hasTradeAction = !isHaven;
|
||||
}
|
||||
|
||||
|
||||
@@ -37,6 +37,9 @@ abstract class DisplaySettingsViewModelBase with Store {
|
||||
@computed
|
||||
bool get disabledFiatApiMode => _settingsStore.fiatApiMode == FiatApiMode.disabled;
|
||||
|
||||
@computed
|
||||
bool get showAddressBookPopup => _settingsStore.showAddressBookPopupEnabled;
|
||||
|
||||
@action
|
||||
void setBalanceDisplayMode(BalanceDisplayMode value) => _settingsStore.balanceDisplayMode = value;
|
||||
|
||||
@@ -66,4 +69,8 @@ abstract class DisplaySettingsViewModelBase with Store {
|
||||
void setShouldShowMarketPlaceInDashbaord(bool value) {
|
||||
_settingsStore.shouldShowMarketPlaceInDashboard = value;
|
||||
}
|
||||
|
||||
@action
|
||||
void setShowAddressBookPopup(bool value) => _settingsStore.showAddressBookPopupEnabled = value;
|
||||
|
||||
}
|
||||
|
||||
@@ -60,10 +60,6 @@ abstract class OtherSettingsViewModelBase with Store {
|
||||
bool get changeRepresentativeEnabled =>
|
||||
_wallet.type == WalletType.nano || _wallet.type == WalletType.banano;
|
||||
|
||||
@computed
|
||||
bool get showAddressBookPopup => _settingsStore.showAddressBookPopupEnabled;
|
||||
|
||||
|
||||
@computed
|
||||
bool get displayTransactionPriority => !(changeRepresentativeEnabled ||
|
||||
_wallet.type == WalletType.solana ||
|
||||
@@ -118,9 +114,6 @@ abstract class OtherSettingsViewModelBase with Store {
|
||||
return customItem != null ? priorities.indexOf(customItem) : null;
|
||||
}
|
||||
|
||||
@action
|
||||
void setShowAddressBookPopup(bool value) => _settingsStore.showAddressBookPopupEnabled = value;
|
||||
|
||||
int? get maxCustomFeeRate {
|
||||
if (_wallet.type == WalletType.bitcoin) {
|
||||
return bitcoin!.getMaxCustomFeeRate(_wallet);
|
||||
|
||||
Reference in New Issue
Block a user