From f5bc1af5cc4ac599e94a69fd835113ad2b567811 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho <32248947+thiagocarvalhodev@users.noreply.github.com> Date: Wed, 18 Dec 2024 16:59:41 -0300 Subject: [PATCH] feat(logo) - open viewblock --- .../login/views/modals/enter_your_password_modal.dart | 11 +++++++++-- .../login/views/modals/secure_your_wallet_modal.dart | 11 +++++++++-- lib/utils/open_view_block.dart | 5 +++++ 3 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 lib/utils/open_view_block.dart diff --git a/lib/authentication/login/views/modals/enter_your_password_modal.dart b/lib/authentication/login/views/modals/enter_your_password_modal.dart index ef4b73513..8e2b1138c 100644 --- a/lib/authentication/login/views/modals/enter_your_password_modal.dart +++ b/lib/authentication/login/views/modals/enter_your_password_modal.dart @@ -8,6 +8,7 @@ import 'package:ardrive/services/ethereum/provider/ethereum_provider_wallet.dart import 'package:ardrive/user/name/presentation/bloc/profile_name_bloc.dart'; import 'package:ardrive/utils/app_localizations_wrapper.dart'; import 'package:ardrive/utils/logger.dart'; +import 'package:ardrive/utils/open_view_block.dart'; import 'package:ardrive/utils/plausible_event_tracker/plausible_event_tracker.dart'; import 'package:ardrive/utils/show_general_dialog.dart'; import 'package:ardrive_ui/ardrive_ui.dart'; @@ -155,7 +156,9 @@ class _EnterYourPasswordWidgetState extends State { if (state is ProfileNameLoaded) { return ProfileCardHeader( walletAddress: state.walletAddress, - onPressed: () {}, + onPressed: () { + openViewBlockWallet(state.walletAddress); + }, isExpanded: true, hasLogoutButton: true, logoutTooltip: 'Forget wallet', @@ -169,7 +172,11 @@ class _EnterYourPasswordWidgetState extends State { return ProfileCardHeader( walletAddress: state.walletAddress ?? '', - onPressed: () {}, + onPressed: () { + if (state.walletAddress != null) { + openViewBlockWallet(state.walletAddress!); + } + }, isExpanded: true, hasLogoutButton: true, logoutTooltip: 'Forget wallet', diff --git a/lib/authentication/login/views/modals/secure_your_wallet_modal.dart b/lib/authentication/login/views/modals/secure_your_wallet_modal.dart index 80f752a13..576a9e9b7 100644 --- a/lib/authentication/login/views/modals/secure_your_wallet_modal.dart +++ b/lib/authentication/login/views/modals/secure_your_wallet_modal.dart @@ -8,6 +8,7 @@ import 'package:ardrive/services/ethereum/provider/ethereum_provider_wallet.dart import 'package:ardrive/user/name/presentation/bloc/profile_name_bloc.dart'; import 'package:ardrive/utils/app_localizations_wrapper.dart'; import 'package:ardrive/utils/logger.dart'; +import 'package:ardrive/utils/open_view_block.dart'; import 'package:ardrive/utils/plausible_event_tracker/plausible_event_tracker.dart'; import 'package:ardrive/utils/show_general_dialog.dart'; import 'package:ardrive_ui/ardrive_ui.dart'; @@ -115,7 +116,9 @@ class _SecureYourWalletWidgetState extends State { if (state is ProfileNameLoaded) { return ProfileCardHeader( walletAddress: state.walletAddress, - onPressed: () {}, + onPressed: () { + openViewBlockWallet(state.walletAddress); + }, isExpanded: true, hasLogoutButton: true, logoutTooltip: 'Forget wallet', @@ -129,7 +132,11 @@ class _SecureYourWalletWidgetState extends State { return ProfileCardHeader( walletAddress: state.walletAddress ?? '', - onPressed: () {}, + onPressed: () { + if (state.walletAddress != null) { + openViewBlockWallet(state.walletAddress!); + } + }, isExpanded: true, hasLogoutButton: true, logoutTooltip: 'Forget wallet', diff --git a/lib/utils/open_view_block.dart b/lib/utils/open_view_block.dart new file mode 100644 index 000000000..925e10170 --- /dev/null +++ b/lib/utils/open_view_block.dart @@ -0,0 +1,5 @@ +import 'package:ardrive/utils/open_url.dart'; + +void openViewBlockWallet(String walletAddress) { + openUrl(url: 'https://viewblock.io/arweave/address/$walletAddress'); +}