File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,13 +39,15 @@ export const ZapWidgetStack: FC<ZapWidgetStackProps> = ({
3939 return customInformation ?. projectData ;
4040 } , [ customInformation ?. projectData ] ) ;
4141
42- // Get zap data to check if user has deposited
42+ // Get zap data to check if user has deposited and if withdraw is available
4343 const {
44+ zapData,
4445 depositTokenData,
4546 isLoadingDepositTokenData,
4647 } = useEnhancedZapData ( projectData ) ;
4748
4849 const hasDeposited = ! isLoadingDepositTokenData && ! ! depositTokenData ;
50+ const hasWithdrawAbi = ! ! zapData ?. abi ?. withdraw ;
4951
5052 const tabs = useMemo ( ( ) => [
5153 {
@@ -55,9 +57,9 @@ export const ZapWidgetStack: FC<ZapWidgetStackProps> = ({
5557 {
5658 value : 'withdraw' ,
5759 label : 'Withdraw' ,
58- disabled : ! hasDeposited ,
60+ disabled : ! hasDeposited || ! hasWithdrawAbi ,
5961 } ,
60- ] , [ hasDeposited ] ) ;
62+ ] , [ hasDeposited , hasWithdrawAbi ] ) ;
6163
6264 const handleTabChange = ( event : React . SyntheticEvent , newValue : string ) => {
6365 setActiveTab ( newValue as 'deposit' | 'withdraw' ) ;
You can’t perform that action at this time.
0 commit comments