11import { CardBody , CardFooter , Collapse , Flex , Skeleton , Stack } from '@chakra-ui/react'
2- import { fromAssetId } from '@shapeshiftoss/caip'
2+ import { fromAssetId , uniV2EthFoxArbitrumAssetId } from '@shapeshiftoss/caip'
33import type { Asset } from '@shapeshiftoss/types'
44import { isSome } from '@shapeshiftoss/utils'
55import { useCallback , useEffect , useMemo , useState } from 'react'
@@ -277,7 +277,7 @@ export const UnstakeInput: React.FC<UnstakeRouteProps & UnstakeInputProps> = ({
277277 stakingAssetAccountId &&
278278 hasEnteredValue &&
279279 stakingAsset &&
280- cooldownPeriodData ?. cooldownPeriod
280+ cooldownPeriodData ?. cooldownPeriod !== undefined
281281 )
282282 )
283283 return
@@ -286,7 +286,7 @@ export const UnstakeInput: React.FC<UnstakeRouteProps & UnstakeInputProps> = ({
286286 stakingAssetAccountId,
287287 stakingAssetId,
288288 unstakingAmountCryptoBaseUnit : toBaseUnit ( amountCryptoPrecision , stakingAsset . precision ) ,
289- cooldownPeriod : cooldownPeriodData ? .cooldownPeriod ,
289+ cooldownPeriod : cooldownPeriodData . cooldownPeriod ,
290290 } )
291291
292292 navigate ( UnstakeRoutePaths . Confirm )
@@ -301,6 +301,11 @@ export const UnstakeInput: React.FC<UnstakeRouteProps & UnstakeInputProps> = ({
301301 stakingAssetId ,
302302 ] )
303303
304+ const handleUnstakeClick = useMemo ( ( ) => {
305+ if ( stakingAssetId === uniV2EthFoxArbitrumAssetId ) return handleSubmit
306+ return handleWarning
307+ } , [ handleSubmit , handleWarning , stakingAssetId ] )
308+
304309 const validateHasEnoughFeeBalance = useCallback (
305310 ( input : string ) => {
306311 if ( bnOrZero ( input ) . isZero ( ) ) return true
@@ -479,11 +484,11 @@ export const UnstakeInput: React.FC<UnstakeRouteProps & UnstakeInputProps> = ({
479484 ! hasEnteredValue ||
480485 ! isUnstakeFeesSuccess ||
481486 Boolean ( errors . amountFieldInput ) ||
482- ! cooldownPeriodData ?. cooldownPeriodSeconds ,
487+ cooldownPeriodData ?. cooldownPeriodSeconds === undefined ,
483488 ) }
484489 size = 'lg'
485490 mx = { - 2 }
486- onClick = { handleWarning }
491+ onClick = { handleUnstakeClick }
487492 colorScheme = { Boolean ( errors . amountFieldInput ) ? 'red' : 'blue' }
488493 isLoading = { isUnstakeFeesLoading }
489494 >
0 commit comments