Skip to content

chore: disable buttons for non-evm account #31193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Mar 25, 2025
12 changes: 10 additions & 2 deletions ui/components/app/wallet-overview/coin-buttons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import {
getMemoizedUnapprovedTemplatedConfirmations,
///: END:ONLY_INCLUDE_IF
getNetworkConfigurationIdByChainId,
isSolanaAccount,
} from '../../../selectors';
import Tooltip from '../../ui/tooltip';
///: BEGIN:ONLY_INCLUDE_IF(build-main,build-beta,build-flask)
Expand Down Expand Up @@ -170,6 +171,9 @@ const CoinButtons = ({

const isExternalServicesEnabled = useSelector(getUseExternalServices);

const isSolanaAccountWithoutExternalServices =
!isExternalServicesEnabled && isSolanaAccount(account);

const buttonTooltips = {
buyButton: [
///: BEGIN:ONLY_INCLUDE_IF(build-main,build-beta,build-flask)
Expand Down Expand Up @@ -463,7 +467,11 @@ const CoinButtons = ({
<IconButton
className={`${classPrefix}-overview__button`}
iconButtonClassName={iconButtonClassName}
disabled={!isBridgeChain || !isSigningEnabled}
disabled={
!isBridgeChain ||
!isSigningEnabled ||
isSolanaAccountWithoutExternalServices
}
data-testid={`${classPrefix}-overview-bridge`}
Icon={
<Icon
Expand Down Expand Up @@ -491,7 +499,7 @@ const CoinButtons = ({
size={IconSize.Sm}
/>
}
disabled={!isSigningEnabled}
disabled={!isSigningEnabled || isSolanaAccountWithoutExternalServices}
label={t('send')}
onClick={handleSendOnClick}
tooltipRender={(contents: React.ReactElement) =>
Expand Down
Loading