11"use client" ;
2- import { Spinner } from "@/components/ui/Spinner/Spinner" ;
32import {
43 Accordion ,
54 AccordionContent ,
65 AccordionItem ,
76 AccordionTrigger ,
87} from "@/components/ui/accordion" ;
98import { Alert , AlertTitle } from "@/components/ui/alert" ;
10- import { Button } from "@/components/ui/button" ;
119import {
1210 Form ,
1311 FormControl ,
@@ -20,6 +18,7 @@ import { Input } from "@/components/ui/input";
2018import { Textarea } from "@/components/ui/textarea" ;
2119import { zodResolver } from "@hookform/resolvers/zod" ;
2220import { useMutation } from "@tanstack/react-query" ;
21+ import { TransactionButton } from "components/buttons/TransactionButton" ;
2322import { useTxNotifications } from "hooks/useTxNotifications" ;
2423import { CircleAlertIcon } from "lucide-react" ;
2524import { useCallback } from "react" ;
@@ -73,6 +72,7 @@ function OpenEditionMetadataModule(props: ModuleInstanceProps) {
7372 { ...props }
7473 setSharedMetadata = { setSharedMetadata }
7574 isOwnerAccount = { ! ! props . ownerAccount }
75+ contractChainId = { props . contract . chain . id }
7676 />
7777 ) ;
7878}
@@ -81,6 +81,7 @@ export function OpenEditionMetadataModuleUI(
8181 props : Omit < ModuleCardUIProps , "children" | "updateButton" > & {
8282 isOwnerAccount : boolean ;
8383 setSharedMetadata : ( values : SetSharedMetadataFormValues ) => Promise < void > ;
84+ contractChainId : number ;
8485 } ,
8586) {
8687 return (
@@ -95,6 +96,7 @@ export function OpenEditionMetadataModuleUI(
9596 { props . isOwnerAccount && (
9697 < SetSharedMetadataSection
9798 setSharedMetadata = { props . setSharedMetadata }
99+ contractChainId = { props . contractChainId }
98100 />
99101 ) }
100102 { ! props . isOwnerAccount && (
@@ -115,6 +117,7 @@ export function OpenEditionMetadataModuleUI(
115117
116118function SetSharedMetadataSection ( props : {
117119 setSharedMetadata : ( values : SetSharedMetadataFormValues ) => Promise < void > ;
120+ contractChainId : number ;
118121} ) {
119122 const form = useForm < SetSharedMetadataFormValues > ( {
120123 resolver : zodResolver ( setSharedMetadataFormSchema ) ,
@@ -204,17 +207,18 @@ function SetSharedMetadataSection(props: {
204207 </ div >
205208
206209 < div className = "flex justify-end" >
207- < Button
210+ < TransactionButton
208211 size = "sm"
209- className = "min-w-24 gap-2 "
212+ className = "min-w-24"
210213 disabled = { setSharedMetadataMutation . isPending }
211214 type = "submit"
215+ isLoading = { setSharedMetadataMutation . isPending }
216+ colorScheme = "primary"
217+ transactionCount = { 1 }
218+ txChainID = { props . contractChainId }
212219 >
213- { setSharedMetadataMutation . isPending && (
214- < Spinner className = "size-4" />
215- ) }
216220 Update
217- </ Button >
221+ </ TransactionButton >
218222 </ div >
219223 </ div >
220224 </ form >
0 commit comments