From 56683aa99897f098cc7d536d4fe73adccc0363e3 Mon Sep 17 00:00:00 2001 From: Apoorv Taneja Date: Thu, 1 Feb 2024 13:44:37 +0530 Subject: [PATCH] fix: Added signing pad disable state while submitting form (#892) Fixes : #891 --- apps/marketing/src/components/(marketing)/widget.tsx | 1 + apps/web/src/app/(signing)/sign/[token]/form.tsx | 1 + apps/web/src/components/forms/profile.tsx | 6 ++---- apps/web/src/components/forms/signup.tsx | 1 + packages/ui/primitives/signature-pad/signature-pad.tsx | 8 +++++++- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/apps/marketing/src/components/(marketing)/widget.tsx b/apps/marketing/src/components/(marketing)/widget.tsx index 80c13b275..d4305a04c 100644 --- a/apps/marketing/src/components/(marketing)/widget.tsx +++ b/apps/marketing/src/components/(marketing)/widget.tsx @@ -399,6 +399,7 @@ export const Widget = ({ className, children, ...props }: WidgetProps) => { { setSignature(value); diff --git a/apps/web/src/components/forms/profile.tsx b/apps/web/src/components/forms/profile.tsx index 7036f4e43..2c278292f 100644 --- a/apps/web/src/components/forms/profile.tsx +++ b/apps/web/src/components/forms/profile.tsx @@ -121,10 +121,8 @@ export const ProfileForm = ({ className, user }: ProfileFormProps) => { onChange(v ?? '')} /> diff --git a/apps/web/src/components/forms/signup.tsx b/apps/web/src/components/forms/signup.tsx index ebfbf72c9..f38ab15d1 100644 --- a/apps/web/src/components/forms/signup.tsx +++ b/apps/web/src/components/forms/signup.tsx @@ -172,6 +172,7 @@ export const SignUpForm = ({ className, isGoogleSSOEnabled }: SignUpFormProps) = onChange(v ?? '')} /> diff --git a/packages/ui/primitives/signature-pad/signature-pad.tsx b/packages/ui/primitives/signature-pad/signature-pad.tsx index 80bac0e18..eb9403df4 100644 --- a/packages/ui/primitives/signature-pad/signature-pad.tsx +++ b/packages/ui/primitives/signature-pad/signature-pad.tsx @@ -16,6 +16,7 @@ const DPI = 2; export type SignaturePadProps = Omit, 'onChange'> & { onChange?: (_signatureDataUrl: string | null) => void; containerClassName?: string; + disabled?: boolean; }; export const SignaturePad = ({ @@ -23,6 +24,7 @@ export const SignaturePad = ({ containerClassName, defaultValue, onChange, + disabled = false, ...props }: SignaturePadProps) => { const $el = useRef(null); @@ -214,7 +216,11 @@ export const SignaturePad = ({ }, [defaultValue]); return ( -
+