-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into abstract-hooks-from…
…-txpanel
- Loading branch information
Showing
5 changed files
with
98 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
packages/arb-token-bridge-ui/src/hooks/TransferPanel/useIsBatchTransferSupported.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { useAppState } from '../../state' | ||
import { isExperimentalFeatureEnabled } from '../../util' | ||
import { useNativeCurrency } from '../useNativeCurrency' | ||
import { useNetworks } from '../useNetworks' | ||
import { useNetworksRelationship } from '../useNetworksRelationship' | ||
|
||
export const useIsBatchTransferSupported = () => { | ||
const [networks] = useNetworks() | ||
const { isDepositMode, isTeleportMode, childChainProvider } = | ||
useNetworksRelationship(networks) | ||
const { | ||
app: { selectedToken } | ||
} = useAppState() | ||
const nativeCurrency = useNativeCurrency({ provider: childChainProvider }) | ||
|
||
if (!isExperimentalFeatureEnabled('batch')) { | ||
return false | ||
} | ||
if (!selectedToken) { | ||
return false | ||
} | ||
if (!isDepositMode) { | ||
return false | ||
} | ||
// TODO: teleport is disabled for now but it needs to be looked into more to check whether it is or can be supported | ||
if (isTeleportMode) { | ||
return false | ||
} | ||
// TODO: disable custom native currency for now, check if this works | ||
if (nativeCurrency.isCustom) { | ||
return false | ||
} | ||
|
||
return true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters