mirror of
https://github.com/documenso/documenso.git
synced 2025-11-12 15:53:02 +10:00
Merge branch 'main' of https://github.com/plxity/documenso into fix/undo-button-in-canvas
This commit is contained in:
@ -16,6 +16,7 @@ const DPI = 2;
|
||||
export type SignaturePadProps = Omit<HTMLAttributes<HTMLCanvasElement>, '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<HTMLCanvasElement>(null);
|
||||
@ -220,7 +222,11 @@ export const SignaturePad = ({
|
||||
}, [defaultValue]);
|
||||
|
||||
return (
|
||||
<div className={cn('relative block', containerClassName)}>
|
||||
<div
|
||||
className={cn('relative block', containerClassName, {
|
||||
'pointer-events-none opacity-50': disabled,
|
||||
})}
|
||||
>
|
||||
<canvas
|
||||
ref={$el}
|
||||
className={cn('relative block dark:invert', className)}
|
||||
|
||||
Reference in New Issue
Block a user