From 4a8a77303176f52a8c2052ff79e32387a6d171d7 Mon Sep 17 00:00:00 2001 From: Fionna Chan <13184582+fionnachan@users.noreply.github.com> Date: Fri, 17 Jan 2025 19:03:11 +0800 Subject: [PATCH] feat: enable SC wallet to change destination chain (#2139) --- .../common/NetworkSelectionContainer.tsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/arb-token-bridge-ui/src/components/common/NetworkSelectionContainer.tsx b/packages/arb-token-bridge-ui/src/components/common/NetworkSelectionContainer.tsx index aab6e65c24..ab0e0fc9b1 100644 --- a/packages/arb-token-bridge-ui/src/components/common/NetworkSelectionContainer.tsx +++ b/packages/arb-token-bridge-ui/src/components/common/NetworkSelectionContainer.tsx @@ -123,7 +123,10 @@ export function NetworkButton({ const hasOneOrLessChain = chains.length <= 1 - const disabled = hasOneOrLessChain || isSmartContractWallet || isLoading + const disabled = + hasOneOrLessChain || + (isSmartContractWallet && type === 'source') || + isLoading const buttonStyle = { backgroundColor: getBridgeUiConfigForChain(selectedChainId).color @@ -405,6 +408,7 @@ export const NetworkSelectionContainer = ( const [oneNovaTransferDialogProps, openOneNovaTransferDialog] = useDialog() const [, setQueryParams] = useArbQueryParams() const { setAdvancedSettingsCollapsed } = useAdvancedSettingsStore() + const { isSmartContractWallet } = useAccountType() const isSource = props.type === 'source' @@ -442,7 +446,10 @@ export const NetworkSelectionContainer = ( actions.app.setSelectedToken(null) setQueryParams({ destinationAddress: undefined }) - setAdvancedSettingsCollapsed(true) + + if (!isSmartContractWallet) { + setAdvancedSettingsCollapsed(true) + } }, [ isSource, @@ -451,7 +458,8 @@ export const NetworkSelectionContainer = ( actions.app, setQueryParams, setAdvancedSettingsCollapsed, - openOneNovaTransferDialog + openOneNovaTransferDialog, + isSmartContractWallet ] )