From 12e1e8a90b05d5b1f142eecba3b264f173a0f968 Mon Sep 17 00:00:00 2001 From: fede Date: Tue, 18 Mar 2025 00:09:22 -0300 Subject: [PATCH] =?UTF-8?q?a=C3=B1adido=20soporte=20para=20sacar=20la=20y?= =?UTF-8?q?=20y=20volverla=20a=20a=C3=B1adir?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/EditarModal.jsx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/components/EditarModal.jsx b/src/components/EditarModal.jsx index f08c2bd..e25ae39 100644 --- a/src/components/EditarModal.jsx +++ b/src/components/EditarModal.jsx @@ -1,4 +1,8 @@ +import { useState } from "react"; export default function EditarModal({ tipo, coord, show, close, setCoords }) { + if (coord == null) return null; + const [hasY, setHasY] = useState(coord.y !== null); + const handleSubmit = (e) => { e.preventDefault(); @@ -50,6 +54,18 @@ export default function EditarModal({ tipo, coord, show, close, setCoords }) {
+
+ { + coord.y = e.target.checked ? "0" : null; + setHasY(e.target.checked); + }} + /> + +
- {coord.y != null && ( + {hasY && (