Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions assets/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,8 @@
"trezorSelectSubTitle": "Select a hardware wallet you'd like to use with Komodo Wallet",
"trezorBrowserUnsupported": "Trezor is not supported on this browser.\nPlease use Chrome for Trezor functionality.",
"trezorTransactionInProgressMessage": "Please confirm transaction on your Trezor device",
"trezorWalletModeOnly": "Only wallet mode supported currently",
"trezorUnavailableTooltip": "Not available with Trezor currently",
"mixedCaseError": "If you are using non mixed case address, please try to convert to mixed case one.",
"addressConvertedToMixedCase": "Address automatically converted to mixed-case for checksum validation.",
"invalidAddressChecksum": "Invalid address checksum",
Expand Down
2 changes: 2 additions & 0 deletions lib/generated/codegen_loader.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,8 @@ abstract class LocaleKeys {
static const trezorSelectSubTitle = 'trezorSelectSubTitle';
static const trezorBrowserUnsupported = 'trezorBrowserUnsupported';
static const trezorTransactionInProgressMessage = 'trezorTransactionInProgressMessage';
static const trezorWalletModeOnly = 'trezorWalletModeOnly';
static const trezorUnavailableTooltip = 'trezorUnavailableTooltip';
static const mixedCaseError = 'mixedCaseError';
static const addressConvertedToMixedCase = 'addressConvertedToMixedCase';
static const invalidAddressChecksum = 'invalidAddressChecksum';
Expand Down
5 changes: 5 additions & 0 deletions lib/views/common/hw_wallet_dialog/hw_dialog_init.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ class HwDialogInit extends StatelessWidget {
}
},
),
const SizedBox(height: 8),
Text(
LocaleKeys.trezorWalletModeOnly.tr(),
textAlign: TextAlign.center,
),
Padding(
padding: const EdgeInsets.only(top: 12),
child: UiUnderlineTextButton(
Expand Down
39 changes: 25 additions & 14 deletions lib/views/common/main_menu/main_menu_bar_mobile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class MainMenuBarMobile extends StatelessWidget {
Widget build(BuildContext context) {
final MainMenuValue selected = routingState.selectedMenu;
final currentWallet = context.watch<AuthBloc>().state.currentUser?.wallet;
final bool isHardware = currentWallet?.isHW == true;

return BlocBuilder<SettingsBloc, SettingsState>(
builder: (context, state) {
Expand Down Expand Up @@ -50,17 +51,22 @@ class MainMenuBarMobile extends StatelessWidget {
),
),
Expanded(
child: MainMenuBarMobileItem(
value: MainMenuValue.fiat,
enabled: currentWallet?.isHW != true,
isActive: selected == MainMenuValue.fiat,
child: Tooltip(
message: '',
child: MainMenuBarMobileItem(
value: MainMenuValue.fiat,
enabled: true,
isActive: selected == MainMenuValue.fiat,
),
),
),
Expanded(
child: Tooltip(
message: tradingEnabled
? ''
: LocaleKeys.tradingDisabledTooltip.tr(),
message: isHardware
? LocaleKeys.trezorUnavailableTooltip.tr()
: (tradingEnabled
? ''
: LocaleKeys.tradingDisabledTooltip.tr()),
child: MainMenuBarMobileItem(
value: MainMenuValue.dex,
enabled: currentWallet?.isHW != true,
Expand All @@ -70,9 +76,11 @@ class MainMenuBarMobile extends StatelessWidget {
),
Expanded(
child: Tooltip(
message: tradingEnabled
? ''
: LocaleKeys.tradingDisabledTooltip.tr(),
message: isHardware
? LocaleKeys.trezorUnavailableTooltip.tr()
: (tradingEnabled
? ''
: LocaleKeys.tradingDisabledTooltip.tr()),
child: MainMenuBarMobileItem(
value: MainMenuValue.bridge,
enabled: currentWallet?.isHW != true,
Expand All @@ -83,9 +91,11 @@ class MainMenuBarMobile extends StatelessWidget {
if (isMMBotEnabled)
Expanded(
child: Tooltip(
message: tradingEnabled
? ''
: LocaleKeys.tradingDisabledTooltip.tr(),
message: isHardware
? LocaleKeys.trezorUnavailableTooltip.tr()
: (tradingEnabled
? ''
: LocaleKeys.tradingDisabledTooltip.tr()),
child: MainMenuBarMobileItem(
enabled: currentWallet?.isHW != true,
value: MainMenuValue.marketMakerBot,
Expand All @@ -95,7 +105,8 @@ class MainMenuBarMobile extends StatelessWidget {
),
Expanded(
child: Tooltip(
message: LocaleKeys.nftDisabledTooltip.tr(),
message:
isHardware ? LocaleKeys.trezorUnavailableTooltip.tr() : LocaleKeys.nftDisabledTooltip.tr(),
child: MainMenuBarMobileItem(
value: MainMenuValue.nft,
enabled: false,
Expand Down
47 changes: 30 additions & 17 deletions lib/views/common/main_menu/main_menu_desktop.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class _MainMenuDesktopState extends State<MainMenuDesktop> {
.isEnabled;
final SettingsBloc settings = context.read<SettingsBloc>();
final currentWallet = state.currentUser?.wallet;
final bool isHardware = currentWallet?.isHW == true;

return Container(
height: double.infinity,
Expand Down Expand Up @@ -83,19 +84,24 @@ class _MainMenuDesktopState extends State<MainMenuDesktop> {
MainMenuValue.wallet,
),
),
DesktopMenuDesktopItem(
key: const Key('main-menu-fiat'),
enabled: currentWallet?.isHW != true,
menu: MainMenuValue.fiat,
onTap: onTapItem,
isSelected: _checkSelectedItem(
MainMenuValue.fiat,
Tooltip(
message: '',
child: DesktopMenuDesktopItem(
key: const Key('main-menu-fiat'),
enabled: true,
menu: MainMenuValue.fiat,
onTap: onTapItem,
isSelected: _checkSelectedItem(
MainMenuValue.fiat,
),
),
),
Tooltip(
message: tradingEnabled
? ''
: LocaleKeys.tradingDisabledTooltip.tr(),
message: isHardware
? LocaleKeys.trezorUnavailableTooltip.tr()
: (tradingEnabled
? ''
: LocaleKeys.tradingDisabledTooltip.tr()),
child: DesktopMenuDesktopItem(
key: const Key('main-menu-dex'),
enabled: currentWallet?.isHW != true,
Expand All @@ -107,9 +113,11 @@ class _MainMenuDesktopState extends State<MainMenuDesktop> {
),
),
Tooltip(
message: tradingEnabled
? ''
: LocaleKeys.tradingDisabledTooltip.tr(),
message: isHardware
? LocaleKeys.trezorUnavailableTooltip.tr()
: (tradingEnabled
? ''
: LocaleKeys.tradingDisabledTooltip.tr()),
child: DesktopMenuDesktopItem(
key: const Key('main-menu-bridge'),
enabled: currentWallet?.isHW != true,
Expand All @@ -122,9 +130,12 @@ class _MainMenuDesktopState extends State<MainMenuDesktop> {
),
if (isMMBotEnabled && isAuthenticated)
Tooltip(
message: tradingEnabled
? ''
: LocaleKeys.tradingDisabledTooltip.tr(),
message: isHardware
? LocaleKeys.trezorUnavailableTooltip.tr()
: (tradingEnabled
? ''
: LocaleKeys.tradingDisabledTooltip
.tr()),
child: DesktopMenuDesktopItem(
key: const Key('main-menu-market-maker-bot'),
enabled: currentWallet?.isHW != true,
Expand All @@ -136,7 +147,9 @@ class _MainMenuDesktopState extends State<MainMenuDesktop> {
),
),
Tooltip(
message: LocaleKeys.nftDisabledTooltip.tr(),
message: isHardware
? LocaleKeys.trezorUnavailableTooltip.tr()
: LocaleKeys.nftDisabledTooltip.tr(),
child: DesktopMenuDesktopItem(
key: const Key('main-menu-nft'),
enabled: false,
Expand Down
Loading