Skip to content

Commit 624ec07

Browse files
committed
chore: remove image from payment links
1 parent 97b7e82 commit 624ec07

File tree

3 files changed

+6
-39
lines changed

3 files changed

+6
-39
lines changed

apps/dashboard/src/@/api/universal-bridge/developer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export async function createPaymentLink(props: {
163163
clientId: string;
164164
teamId: string;
165165
title: string;
166-
imageUrl: string;
166+
imageUrl?: string;
167167
intent: {
168168
destinationChainId: number;
169169
destinationTokenAddress: Address;

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/links/components/CreatePaymentLinkButton.client.tsx

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { checksumAddress, shortenAddress } from "thirdweb/utils";
1212
import z from "zod";
1313
import { createPaymentLink } from "@/api/universal-bridge/developer";
1414
import { getUniversalBridgeTokens } from "@/api/universal-bridge/tokens";
15-
import { FileInput } from "@/components/blocks/FileInput";
1615
import { SingleNetworkSelector } from "@/components/blocks/NetworkSelectors";
1716
import { TokenSelector } from "@/components/blocks/TokenSelector";
1817
import { 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

5048
export 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" />

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/links/components/PaymentLinksTable.client.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -262,12 +262,8 @@ function DeletePaymentLinkButton(
262262
});
263263
return null;
264264
},
265-
onSuccess: () => {
266-
return queryClient.invalidateQueries({
267-
queryKey: ["webhooks", props.clientId],
268-
});
269-
},
270265
});
266+
271267
return (
272268
<Dialog onOpenChange={setOpen} open={open}>
273269
<DialogTrigger asChild>{props.children}</DialogTrigger>
@@ -295,7 +291,7 @@ function DeletePaymentLinkButton(
295291
toast.success("Payment link deleted successfully.");
296292
setOpen(false);
297293
return queryClient.invalidateQueries({
298-
queryKey: ["payment-link", props.clientId],
294+
queryKey: ["payment-links", props.clientId, props.teamId],
299295
});
300296
},
301297
});

0 commit comments

Comments
 (0)