11"use client" ;
22import { FormFieldSetup } from "@/components/blocks/FormFieldSetup" ;
33import { DatePickerWithRange } from "@/components/ui/DatePickerWithRange" ;
4- import { Spinner } from "@/components/ui/Spinner/Spinner" ;
54import {
65 Accordion ,
76 AccordionContent ,
@@ -24,6 +23,7 @@ import { Skeleton } from "@/components/ui/skeleton";
2423import { ToolTipLabel } from "@/components/ui/tooltip" ;
2524import { zodResolver } from "@hookform/resolvers/zod" ;
2625import { useMutation } from "@tanstack/react-query" ;
26+ import { TransactionButton } from "components/buttons/TransactionButton" ;
2727import { addDays , fromUnixTime } from "date-fns" ;
2828import { useAllChainsData } from "hooks/chains/allChains" ;
2929import { useTxNotifications } from "hooks/useTxNotifications" ;
@@ -220,7 +220,7 @@ function ClaimableModule(props: ModuleInstanceProps) {
220220 } }
221221 isOwnerAccount = { ! ! ownerAccount }
222222 isErc721 = { isErc721 }
223- chainId = { props . contract . chain . id }
223+ contractChainId = { props . contract . chain . id }
224224 mintSection = { {
225225 mint,
226226 } }
@@ -232,7 +232,7 @@ export function ClaimableModuleUI(
232232 props : Omit < ModuleCardUIProps , "children" | "updateButton" > & {
233233 isOwnerAccount : boolean ;
234234 isErc721 : boolean ;
235- chainId : number ;
235+ contractChainId : number ;
236236 primarySaleRecipientSection : {
237237 setPrimarySaleRecipient : (
238238 values : PrimarySaleRecipientFormValues ,
@@ -272,6 +272,7 @@ export function ClaimableModuleUI(
272272 < MintNFTSection
273273 mint = { props . mintSection . mint }
274274 isErc721 = { props . isErc721 }
275+ contractChainId = { props . contractChainId }
275276 />
276277 </ AccordionContent >
277278 </ AccordionItem >
@@ -289,7 +290,7 @@ export function ClaimableModuleUI(
289290 }
290291 update = { props . claimConditionSection . setClaimCondition }
291292 isErc721 = { props . isErc721 }
292- chainId = { props . chainId }
293+ chainId = { props . contractChainId }
293294 tokenDecimals = { props . claimConditionSection . data . tokenDecimals }
294295 />
295296 ) : (
@@ -315,6 +316,7 @@ export function ClaimableModuleUI(
315316 update = {
316317 props . primarySaleRecipientSection . setPrimarySaleRecipient
317318 }
319+ contractChainId = { props . contractChainId }
318320 />
319321 ) : (
320322 < Skeleton className = "h-[74px]" />
@@ -598,15 +600,18 @@ function ClaimConditionSection(props: {
598600 </ div >
599601
600602 < div className = "flex justify-end" >
601- < Button
603+ < TransactionButton
602604 size = "sm"
603- className = "min-w-24 gap-2 "
605+ className = "min-w-24"
604606 disabled = { updateMutation . isPending || ! props . isOwnerAccount }
605607 type = "submit"
608+ isLoading = { updateMutation . isPending }
609+ txChainID = { props . chainId }
610+ transactionCount = { 1 }
611+ colorScheme = "primary"
606612 >
607- { updateMutation . isPending && < Spinner className = "size-4" /> }
608613 Update
609- </ Button >
614+ </ TransactionButton >
610615 </ div >
611616 </ div >
612617 </ form > { " " }
@@ -626,6 +631,7 @@ function PrimarySaleRecipientSection(props: {
626631 primarySaleRecipient : string | undefined ;
627632 update : ( values : PrimarySaleRecipientFormValues ) => Promise < void > ;
628633 isOwnerAccount : boolean ;
634+ contractChainId : number ;
629635} ) {
630636 const form = useForm < PrimarySaleRecipientFormValues > ( {
631637 resolver : zodResolver ( primarySaleRecipientFormSchema ) ,
@@ -673,15 +679,18 @@ function PrimarySaleRecipientSection(props: {
673679 < div className = "h-5" />
674680
675681 < div className = "flex justify-end" >
676- < Button
682+ < TransactionButton
677683 size = "sm"
678684 className = "min-w-24 gap-2"
679685 disabled = { updateMutation . isPending || ! props . isOwnerAccount }
680686 type = "submit"
687+ isLoading = { updateMutation . isPending }
688+ txChainID = { props . contractChainId }
689+ transactionCount = { 1 }
690+ colorScheme = "primary"
681691 >
682- { updateMutation . isPending && < Spinner className = "size-4" /> }
683692 Update
684- </ Button >
693+ </ TransactionButton >
685694 </ div >
686695 </ form > { " " }
687696 </ Form >
@@ -701,6 +710,7 @@ export type MintFormValues = z.infer<typeof mintFormSchema>;
701710function MintNFTSection ( props : {
702711 mint : ( values : MintFormValues ) => Promise < void > ;
703712 isErc721 : boolean ;
713+ contractChainId : number ;
704714} ) {
705715 const form = useForm < MintFormValues > ( {
706716 resolver : zodResolver ( mintFormSchema ) ,
@@ -784,15 +794,18 @@ function MintNFTSection(props: {
784794 </ div >
785795
786796 < div className = "flex justify-end" >
787- < Button
797+ < TransactionButton
788798 size = "sm"
789799 className = "min-w-24 gap-2"
790800 disabled = { mintMutation . isPending }
791801 type = "submit"
802+ isLoading = { mintMutation . isPending }
803+ txChainID = { props . contractChainId }
804+ transactionCount = { 1 }
805+ colorScheme = "primary"
792806 >
793- { mintMutation . isPending && < Spinner className = "size-4" /> }
794807 Mint
795- </ Button >
808+ </ TransactionButton >
796809 </ div >
797810 </ div >
798811 </ form >
0 commit comments