From 2499c0ab645dca284775ef2b32e3fbca2d4919c9 Mon Sep 17 00:00:00 2001 From: Mariela Date: Tue, 2 Aug 2022 12:27:38 -0600 Subject: [PATCH] =?UTF-8?q?fix=20estilos=20de=20formulario=20de=20agregar?= =?UTF-8?q?=20=C3=A1rea=20com=C3=BAn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web-react/src/components/AreasComunes.js | 131 +++++++++++------- 1 file changed, 81 insertions(+), 50 deletions(-) diff --git a/web-ui/web-react/src/components/AreasComunes.js b/web-ui/web-react/src/components/AreasComunes.js index d539bc40..0850e31c 100644 --- a/web-ui/web-react/src/components/AreasComunes.js +++ b/web-ui/web-react/src/components/AreasComunes.js @@ -388,10 +388,10 @@ const AreasComunes = () => { }; - function compareTimesMinRequired(hour1, hour2){ - var timeFormat1 = Number(hour1.replace(/[:]/g,'')); - var timeFormat2 = Number(hour2.replace(/[:]/g,'')); - if(timeFormat1 <= timeFormat2){ + function compareTimesMinRequired(hour1, hour2) { + var timeFormat1 = Number(hour1.replace(/[:]/g, '')); + var timeFormat2 = Number(hour2.replace(/[:]/g, '')); + if (timeFormat1 <= timeFormat2) { return true; } else { return false; @@ -439,60 +439,83 @@ const AreasComunes = () => {
- onInputChange(e, 'name')} - value={commonArea.name} - required - autoFocus - className={classNames({ - 'p-invalid': submitted && commonArea.name === '', - })} - /> - {submitted && commonArea.name === '' && ( - Nombre es requirido. - )} +
+ +
+ + + + onInputChange(e, 'name')} + value={commonArea.name} + required + autoFocus + className={classNames({ + 'p-invalid': submitted && commonArea.name === '', + })} + /> +
+ {submitted && commonArea.name === '' && ( + Nombre es requirido. + )} +
- onInputChange(e, 'hourMin')} - value={commonArea.hourMin} - required - autoFocus - className={classNames({ - 'p-invalid': submitted && compareTimesMinRequired(commonArea.hourMax, commonArea.hourMin), - })} - /> - {submitted && compareTimesMinRequired(commonArea.hourMax, commonArea.hourMin) && ( - La hora de apertura debe ser menor que la hora de cierre. - )} +
+
+ + + + onInputChange(e, 'hourMin')} + value={commonArea.hourMin} + required + autoFocus + className={classNames({ + 'p-invalid': submitted && compareTimesMinRequired(commonArea.hourMax, commonArea.hourMin), + })} + /> +
+ {submitted && compareTimesMinRequired(commonArea.hourMax, commonArea.hourMin) && ( + La hora de apertura debe ser menor que la hora de cierre. + )} +
- onInputChange(e, 'hourMax')} - value={commonArea.hourMax} - required - autoFocus - className={classNames({ - 'p-invalid': submitted && compareTimesMinRequired(commonArea.hourMax, commonArea.hourMin), - })} - /> - {submitted && compareTimesMinRequired(commonArea.hourMax, commonArea.hourMin) && ( - La hora de cierre debe ser mayor que la hora de apertura - )} +
+
+ + + + onInputChange(e, 'hourMax')} + value={commonArea.hourMax} + required + autoFocus + className={classNames({ + 'p-invalid': submitted && compareTimesMinRequired(commonArea.hourMax, commonArea.hourMin), + })} + /> +
+ {submitted && compareTimesMinRequired(commonArea.hourMax, commonArea.hourMin) && ( + La hora de cierre debe ser mayor que la hora de apertura + )} +
-
+
+ { onChange={onBookableChange} checked={commonArea.bookable === '1'} /> - +
{ onChange={onBookableChange} checked={commonArea.bookable === '0'} /> - +