@@ -17,6 +17,7 @@ import {
1717 FormMessage ,
1818} from "@/components/ui/form" ;
1919import { Input } from "@/components/ui/input" ;
20+ import { Textarea } from "@/components/ui/textarea" ;
2021import { zodResolver } from "@hookform/resolvers/zod" ;
2122import { useMutation } from "@tanstack/react-query" ;
2223import { useTxNotifications } from "hooks/useTxNotifications" ;
@@ -29,14 +30,16 @@ import { z } from "zod";
2930import { ModuleCardUI , type ModuleCardUIProps } from "./module-card" ;
3031import type { ModuleInstanceProps } from "./module-instance" ;
3132
32- const formSchema = z . object ( {
33+ const setSharedMetadataFormSchema = z . object ( {
3334 name : z . string ( ) . min ( 1 ) ,
3435 description : z . string ( ) . min ( 1 ) ,
3536 imageUri : z . string ( ) . optional ( ) ,
3637 animationUri : z . string ( ) . optional ( ) ,
3738} ) ;
3839
39- export type SetSharedMetadataFormValues = z . infer < typeof formSchema > ;
40+ export type SetSharedMetadataFormValues = z . infer <
41+ typeof setSharedMetadataFormSchema
42+ > ;
4043
4144function OpenEditionMetadataModule ( props : ModuleInstanceProps ) {
4245 const { contract, ownerAccount } = props ;
@@ -114,7 +117,7 @@ function SetSharedMetadataSection(props: {
114117 setSharedMetadata : ( values : SetSharedMetadataFormValues ) => Promise < void > ;
115118} ) {
116119 const form = useForm < SetSharedMetadataFormValues > ( {
117- resolver : zodResolver ( formSchema ) ,
120+ resolver : zodResolver ( setSharedMetadataFormSchema ) ,
118121 values : {
119122 name : "" ,
120123 description : "" ,
@@ -143,12 +146,12 @@ function SetSharedMetadataSection(props: {
143146 < Form { ...form } >
144147 < form onSubmit = { form . handleSubmit ( onSubmit ) } >
145148 < div className = "flex flex-col gap-6" >
146- < div className = "grid grid-cols-1 gap-4 md:grid-cols-2 " >
149+ < div className = "flex flex-col gap-6 " >
147150 < FormField
148151 control = { form . control }
149152 name = "name"
150153 render = { ( { field } ) => (
151- < FormItem className = "flex-1" >
154+ < FormItem >
152155 < FormLabel > Name</ FormLabel >
153156 < FormControl >
154157 < Input { ...field } />
@@ -157,28 +160,27 @@ function SetSharedMetadataSection(props: {
157160 </ FormItem >
158161 ) }
159162 />
163+
160164 < FormField
161165 control = { form . control }
162166 name = "description"
163167 render = { ( { field } ) => (
164- < FormItem className = "flex-1" >
168+ < FormItem >
165169 < FormLabel > Description</ FormLabel >
166170 < FormControl >
167- < Input { ...field } />
171+ < Textarea { ...field } />
168172 </ FormControl >
169173 < FormMessage />
170174 </ FormItem >
171175 ) }
172176 />
173- </ div >
174177
175- < div className = "grid grid-cols-1 gap-4 md:grid-cols-2" >
176178 < FormField
177179 control = { form . control }
178180 name = "imageUri"
179181 render = { ( { field } ) => (
180182 < FormItem className = "flex-1" >
181- < FormLabel > Image URL </ FormLabel >
183+ < FormLabel > Image URI </ FormLabel >
182184 < FormControl >
183185 < Input { ...field } />
184186 </ FormControl >
@@ -191,7 +193,7 @@ function SetSharedMetadataSection(props: {
191193 name = "animationUri"
192194 render = { ( { field } ) => (
193195 < FormItem className = "flex-1" >
194- < FormLabel > Animation URL </ FormLabel >
196+ < FormLabel > Animation URI </ FormLabel >
195197 < FormControl >
196198 < Input { ...field } />
197199 </ FormControl >
@@ -211,7 +213,7 @@ function SetSharedMetadataSection(props: {
211213 { setSharedMetadataMutation . isPending && (
212214 < Spinner className = "size-4" />
213215 ) }
214- Set Shared Metadata
216+ Update
215217 </ Button >
216218 </ div >
217219 </ div >
0 commit comments