@@ -6,7 +6,6 @@ import { Button } from "@/components/ui/button";
66import { Card , CardContent , CardHeader , CardTitle } from "@/components/ui/card" ;
77import { Input } from "@/components/ui/input" ;
88import { Label } from "@/components/ui/label" ;
9- import { useThirdwebClient } from "@/constants/thirdweb.client" ;
109import { ChevronDownIcon , CreditCardIcon } from "lucide-react" ;
1110import { useCallback , useMemo , useState } from "react" ;
1211import { toast } from "sonner" ;
@@ -20,9 +19,9 @@ import { getCurrencyMetadata } from "thirdweb/extensions/erc20";
2019import { resolveScheme , upload } from "thirdweb/storage" ;
2120import { FileInput } from "../../../../components/shared/FileInput" ;
2221import { resolveEns } from "../../../../lib/ens" ;
22+ import { cn } from "@/lib/utils" ;
2323
24- export function CheckoutLinkForm ( ) {
25- const client = useThirdwebClient ( ) ;
24+ export function CheckoutLinkForm ( { client } : { client : ThirdwebClient } ) {
2625 const [ chainId , setChainId ] = useState < number > ( ) ;
2726 const [ recipientAddress , setRecipientAddress ] = useState ( "" ) ;
2827 const [ tokenAddressWithChain , setTokenAddressWithChain ] = useState ( "" ) ;
@@ -258,25 +257,27 @@ export function CheckoutLinkForm() {
258257 < Button
259258 type = "button"
260259 variant = "ghost"
261- className = "flex w-full items-center justify-between px-0 text-muted-foreground hover:bg-transparent"
260+ className = { cn (
261+ "flex w-full items-center justify-between px-0 text-muted-foreground hover:bg-transparent" ,
262+ ) }
262263 onClick = { ( ) => setShowAdvanced ( ! showAdvanced ) }
263264 >
264265 < span > Advanced Options</ span >
265266 < ChevronDownIcon
266- className = { `size-4 transition-transform duration-200 ease-in-out ${
267- showAdvanced ? "rotate-180" : ""
268- } `}
267+ className = { `size-4 transition-transform duration-200 ease-in-out ${ showAdvanced ? "rotate-180" : ""
268+ } `}
269269 />
270270 </ Button >
271271
272272 < div
273- className = { `grid transition-all duration-200 ease-in-out ${
273+ className = { cn (
274+ "grid transition-all duration-200 ease-in-out" ,
274275 showAdvanced
275276 ? "grid-rows-[1fr] opacity-100"
276- : "grid-rows-[0fr] opacity-0"
277- } ` }
277+ : "grid-rows-[0fr] opacity-0" ,
278+ ) }
278279 >
279- < div className = " overflow-hidden">
280+ < div className = { cn ( showAdvanced ? "" : " overflow-hidden") } >
280281 < div className = "space-y-6 pt-2" >
281282 < div className = "space-y-2" >
282283 < Label htmlFor = "title" className = "font-medium text-sm" >
@@ -295,7 +296,7 @@ export function CheckoutLinkForm() {
295296 < Label htmlFor = "image" className = "font-medium text-sm" >
296297 Image
297298 </ Label >
298- < div className = "w-full px-1 pb-1 " >
299+ < div className = "w-full" >
299300 < FileInput
300301 accept = { { "image/*" : [ ] } }
301302 setValue = { handleImageUpload }
0 commit comments