From 3da725278f635c638910589d906a5b08594431bf Mon Sep 17 00:00:00 2001 From: Godwin JIbs <126525197+Jibz-Mysten@users.noreply.github.com> Date: Fri, 30 Jun 2023 12:36:28 -0400 Subject: [PATCH] Add explorer link to Wallet Settings (#12770) - Add explorer button to wallet setting - Fix Sui Apps description line height - Switch the secondary button color to `bg-gray-40 ` Screenshot 2023-06-29 at 1 24 17 PM Screenshot 2023-06-30 at 10 00 13 AM --- .../app/components/menu/content/MenuList.tsx | 34 +++++++++++++++---- .../components/menu/content/MenuListItem.tsx | 4 +-- .../src/ui/app/components/sui-apps/SuiApp.tsx | 4 +-- apps/wallet/src/ui/app/shared/ButtonUI.tsx | 3 +- 4 files changed, 34 insertions(+), 11 deletions(-) diff --git a/apps/wallet/src/ui/app/components/menu/content/MenuList.tsx b/apps/wallet/src/ui/app/components/menu/content/MenuList.tsx index eb0eb9867e76f..e9a7152d8c64f 100644 --- a/apps/wallet/src/ui/app/components/menu/content/MenuList.tsx +++ b/apps/wallet/src/ui/app/components/menu/content/MenuList.tsx @@ -5,6 +5,7 @@ import { useResolveSuiNSName } from '@mysten/core'; import { Account24, ArrowUpRight12, + ArrowUpRight16, Domain24, Version24, CopyArchiveDoNotUse24, @@ -23,8 +24,10 @@ import { lockWallet } from '_app/wallet/actions'; import { useNextMenuUrl } from '_components/menu/hooks'; import { useAppDispatch, useAppSelector } from '_hooks'; import { ToS_LINK, FAQ_LINK } from '_src/shared/constants'; +import { ExplorerLinkType } from '_src/ui/app/components/explorer-link/ExplorerLinkType'; import { useActiveAddress } from '_src/ui/app/hooks/useActiveAddress'; import { useAutoLockInterval } from '_src/ui/app/hooks/useAutoLockInterval'; +import { useExplorerLink } from '_src/ui/app/hooks/useExplorerLink'; import { logout } from '_src/ui/app/redux/slices/account'; import { ConfirmationModal } from '_src/ui/app/shared/ConfirmationModal'; import { Link } from '_src/ui/app/shared/Link'; @@ -45,16 +48,35 @@ function MenuList() { const navigate = useNavigate(); const [logoutInProgress, setLogoutInProgress] = useState(false); const [isLogoutDialogOpen, setIsLogoutDialogOpen] = useState(false); + const explorerAddress = useExplorerLink({ + type: ExplorerLinkType.address, + address: address || '', + }); return ( <>
- } - title={'Accounts'} - subtitle={domainName ?? (address ? formatAddress(address) : '')} - /> +
+ } + title={'Accounts'} + subtitle={domainName ?? (address ? formatAddress(address) : '')} + /> + {explorerAddress && ( +
} diff --git a/apps/wallet/src/ui/app/components/menu/content/MenuListItem.tsx b/apps/wallet/src/ui/app/components/menu/content/MenuListItem.tsx index 4fcbec4134ad8..c28d55ea08733 100644 --- a/apps/wallet/src/ui/app/components/menu/content/MenuListItem.tsx +++ b/apps/wallet/src/ui/app/components/menu/content/MenuListItem.tsx @@ -52,7 +52,7 @@ function MenuListItem({ href={href} target="_blank" rel="noreferrer noopener" - className="flex flex-nowrap items-center px-1 py-4.5 first:pt-3 last:pb-3 gap-5 no-underline overflow-hidden group cursor-pointer" + className="flex flex-nowrap items-center px-1 py-4.5 first:pt-3 first:pb-3 last:pb-3 gap-5 no-underline overflow-hidden group cursor-pointer" > {MenuItemContent} @@ -61,7 +61,7 @@ function MenuListItem({ return ( diff --git a/apps/wallet/src/ui/app/components/sui-apps/SuiApp.tsx b/apps/wallet/src/ui/app/components/sui-apps/SuiApp.tsx index 064024c0a992c..552235958daa0 100644 --- a/apps/wallet/src/ui/app/components/sui-apps/SuiApp.tsx +++ b/apps/wallet/src/ui/app/components/sui-apps/SuiApp.tsx @@ -63,11 +63,11 @@ function ListView({ name, icon, description, tags }: ListViewProp) { {name} - + {description} {tags?.length && ( -
+
{tags?.map((tag) => (