From 6274e248d7046e9ea2f995ebdcbd4894e3e98602 Mon Sep 17 00:00:00 2001 From: caxtonacollins Date: Mon, 23 Feb 2026 23:09:43 +0100 Subject: [PATCH] feat(SnippetForm): disable form submission if wallet not connected Adds a mock isConnected state that prevents API post on submit --- components/SnippetForm.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/components/SnippetForm.tsx b/components/SnippetForm.tsx index abebcc2..3a9c948 100644 --- a/components/SnippetForm.tsx +++ b/components/SnippetForm.tsx @@ -20,6 +20,7 @@ import React, { SetStateAction } from "react"; import { SnippetFormValues } from "@/types/type"; import { zodResolver } from "@hookform/resolvers/zod"; import { snippetSchema } from "@/validiation/snippet-form-validiation"; +import { toast } from "sonner"; interface SnippetFormProps { editingId: string | null; @@ -53,6 +54,14 @@ export default function SnippetForm({ } = form; const onSubmit = async (data: SnippetFormValues) => { + // Mock isConnected state - replace with real state later + const isConnected = false; + + if (!isConnected) { + toast.error("Please connect your wallet before submitting."); + return; + } + try { setSubmitting(true); const payload = {