refactor(profissional): Fixes ref usage in SignatureCanvas and removes react-quill- Adjusts ref usage with dynamic SignatureCanvas to avoid typing errors. - Removes dependency and usage of react-quill library from code.
This commit is contained in:
parent
47fb573f56
commit
524548cce8
@ -1,11 +1,9 @@
|
||||
import type SignatureCanvasType from "react-signature-canvas";
|
||||
import React, { useState, useRef } from "react";
|
||||
import React, { useState, useRef, forwardRef } from "react";
|
||||
import dynamic from "next/dynamic";
|
||||
|
||||
import Link from "next/link";
|
||||
|
||||
const SignatureCanvas = dynamic(() => import("react-signature-canvas"), { ssr: false });
|
||||
|
||||
import ProtectedRoute from "@/components/ProtectedRoute";
|
||||
import { useAuth } from "@/hooks/useAuth";
|
||||
import { Button } from "@/components/ui/button";
|
||||
@ -58,6 +56,13 @@ const medico = {
|
||||
fotoUrl: "",
|
||||
}
|
||||
|
||||
const SignatureCanvas = dynamic(
|
||||
() =>
|
||||
import("react-signature-canvas").then((mod) =>
|
||||
forwardRef<any, any>((props, ref) => <mod.default {...props} ref={ref} />)
|
||||
),
|
||||
{ ssr: false }
|
||||
);
|
||||
|
||||
const colorsByType = {
|
||||
Rotina: "#4dabf7",
|
||||
@ -632,7 +637,7 @@ function LaudoEditor() {
|
||||
<label className="block mb-1 font-medium text-primary">Assinatura Digital</label>
|
||||
<div className="bg-muted rounded-md border p-2 flex flex-col items-center">
|
||||
<SignatureCanvas
|
||||
ref={(node) => { sigCanvasRef.current = node; }}
|
||||
ref={sigCanvasRef}
|
||||
penColor="#0f172a"
|
||||
backgroundColor="#fff"
|
||||
canvasProps={{ width: 300, height: 100, className: "rounded border bg-white" }}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user