@@ -12,7 +12,6 @@ import { checksumAddress, shortenAddress } from "thirdweb/utils";
1212import z from "zod" ;
1313import { createPaymentLink } from "@/api/universal-bridge/developer" ;
1414import { getUniversalBridgeTokens } from "@/api/universal-bridge/tokens" ;
15- import { FileInput } from "@/components/blocks/FileInput" ;
1615import { SingleNetworkSelector } from "@/components/blocks/NetworkSelectors" ;
1716import { TokenSelector } from "@/components/blocks/TokenSelector" ;
1817import { Button } from "@/components/ui/button" ;
@@ -44,14 +43,13 @@ const formSchema = z.object({
4443 recipient : z . string ( ) ,
4544 amount : z . coerce . number ( ) ,
4645 title : z . string ( ) ,
47- imageUrl : z . string ( ) ,
4846} ) ;
4947
5048export function CreatePaymentLinkButton (
5149 props : PropsWithChildren < { clientId : string ; teamId : string } > ,
5250) {
5351 const [ open , setOpen ] = useState ( false ) ;
54- const [ image , setImage ] = useState < File > ( ) ;
52+ // const [image, setImage] = useState<File>();
5553 const client = getClientThirdwebClient ( ) ;
5654
5755 const form = useForm < z . infer < typeof formSchema > > ( {
@@ -61,7 +59,6 @@ export function CreatePaymentLinkButton(
6159 recipient : undefined ,
6260 amount : undefined ,
6361 title : undefined ,
64- imageUrl : undefined ,
6562 } ,
6663 resolver : zodResolver ( formSchema ) ,
6764 } ) ;
@@ -75,7 +72,7 @@ export function CreatePaymentLinkButton(
7572 } ) ;
7673 const createMutation = useMutation ( {
7774 mutationFn : async ( values : z . infer < typeof formSchema > ) => {
78- console . log ( values ) ;
75+ console . log ( "createMutation" , values ) ;
7976 const tokens = await getUniversalBridgeTokens ( {
8077 chainId : values . chainId ,
8178 address : values . tokenAddress ,
@@ -96,7 +93,6 @@ export function CreatePaymentLinkButton(
9693 amount : toUnits ( values . amount . toString ( ) , token . decimals ) ,
9794 } ,
9895 title : values . title ,
99- imageUrl : values . imageUrl ,
10096 } ) ;
10197 return null ;
10298 } ,
@@ -135,7 +131,7 @@ export function CreatePaymentLinkButton(
135131 } ,
136132 onError : ( e ) => {
137133 console . error ( e ) ;
138- setImage ( undefined ) ;
134+ // setImage(undefined);
139135 toast . error ( parseErrorToMessage ( e ) , { duration : 5000 } ) ;
140136 } ,
141137 } ) ;
@@ -165,30 +161,6 @@ export function CreatePaymentLinkButton(
165161 </ DialogHeader >
166162
167163 < div className = "flex flex-col gap-6 w-full" >
168- < FormField
169- name = "image"
170- render = { ( ) => (
171- < FormItem className = "w-full" >
172- < RequiredFormLabel > Image</ RequiredFormLabel >
173- < FileInput
174- accept = { { "image/*" : [ ] } }
175- className = "rounded-md h-32"
176- client = { client }
177- helperText = "image"
178- isDisabled = { uploadMutation . isPending }
179- isDisabledText = "Uploading..."
180- selectOrUpload = "Upload"
181- setValue = { async ( file ) => {
182- await uploadMutation . mutateAsync ( file ) ;
183- setImage ( file ) ;
184- } }
185- value = { image }
186- />
187- < FormMessage />
188- </ FormItem >
189- ) }
190- />
191-
192164 < FormField
193165 name = "title"
194166 render = { ( { field } ) => (
@@ -298,7 +270,6 @@ export function CreatePaymentLinkButton(
298270 disabled = {
299271 uploadMutation . isPending || createMutation . isPending
300272 }
301- onClick = { ( ) => console . log ( form . getValues ( ) ) }
302273 >
303274 { createMutation . isPending ? (
304275 < Spinner className = "size-4" />
0 commit comments