contentoh-components-library 21.4.80 → 21.4.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -35,8 +35,6 @@ var _close = _interopRequireDefault(require("../../../assets/images/Icons/close.
|
|
|
35
35
|
|
|
36
36
|
var _save = _interopRequireDefault(require("../../../assets/images/Icons/save.svg"));
|
|
37
37
|
|
|
38
|
-
var _Modal = require("../../organisms/Modal");
|
|
39
|
-
|
|
40
38
|
var _axios = _interopRequireDefault(require("axios"));
|
|
41
39
|
|
|
42
40
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -78,7 +76,9 @@ var reducerGroups = function reducerGroups(state, action) {
|
|
|
78
76
|
};
|
|
79
77
|
|
|
80
78
|
var EditGroup = function EditGroup(_ref) {
|
|
81
|
-
var token = _ref.token
|
|
79
|
+
var token = _ref.token,
|
|
80
|
+
show = _ref.show,
|
|
81
|
+
onClose = _ref.onClose;
|
|
82
82
|
|
|
83
83
|
var _useState = (0, _react.useState)([]),
|
|
84
84
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -105,51 +105,46 @@ var EditGroup = function EditGroup(_ref) {
|
|
|
105
105
|
deletingIndex = _useState8[0],
|
|
106
106
|
setDeletingIndex = _useState8[1];
|
|
107
107
|
|
|
108
|
-
var _useState9 = (0, _react.useState)(
|
|
108
|
+
var _useState9 = (0, _react.useState)(null),
|
|
109
109
|
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
hoveredIndex = _useState10[0],
|
|
111
|
+
setHoveredIndex = _useState10[1];
|
|
112
112
|
|
|
113
|
-
var _useState11 = (0, _react.useState)(
|
|
113
|
+
var _useState11 = (0, _react.useState)([]),
|
|
114
114
|
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
isEditingList = _useState12[0],
|
|
116
|
+
setIsEditingList = _useState12[1];
|
|
117
117
|
|
|
118
|
-
var _useState13 = (0, _react.useState)(
|
|
118
|
+
var _useState13 = (0, _react.useState)(false),
|
|
119
119
|
_useState14 = (0, _slicedToArray2.default)(_useState13, 2),
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
newGroup = _useState14[0],
|
|
121
|
+
setNewGroup = _useState14[1];
|
|
122
122
|
|
|
123
|
-
var _useState15 = (0, _react.useState)(
|
|
123
|
+
var _useState15 = (0, _react.useState)(null),
|
|
124
124
|
_useState16 = (0, _slicedToArray2.default)(_useState15, 2),
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
currentEditIndex = _useState16[0],
|
|
126
|
+
setCurrentEditIndex = _useState16[1];
|
|
127
127
|
|
|
128
|
-
var _useState17 = (0, _react.useState)(
|
|
128
|
+
var _useState17 = (0, _react.useState)([]),
|
|
129
129
|
_useState18 = (0, _slicedToArray2.default)(_useState17, 2),
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
inputValue = _useState18[0],
|
|
131
|
+
setInputValue = _useState18[1];
|
|
132
132
|
|
|
133
|
-
var _useState19 = (0, _react.useState)(
|
|
133
|
+
var _useState19 = (0, _react.useState)(false),
|
|
134
134
|
_useState20 = (0, _slicedToArray2.default)(_useState19, 2),
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
var _useState21 = (0, _react.useState)({
|
|
139
|
-
show: false,
|
|
140
|
-
title: "Actualización completa",
|
|
141
|
-
message: "",
|
|
142
|
-
icon: "success"
|
|
143
|
-
}),
|
|
144
|
-
_useState22 = (0, _slicedToArray2.default)(_useState21, 2),
|
|
145
|
-
modalData = _useState22[0],
|
|
146
|
-
setModalData = _useState22[1];
|
|
135
|
+
shouldClose = _useState20[0],
|
|
136
|
+
setShouldClose = _useState20[1];
|
|
147
137
|
|
|
148
138
|
var modalRef = (0, _react.useRef)();
|
|
149
139
|
(0, _react.useEffect)(function () {}, [groups]);
|
|
150
140
|
(0, _react.useEffect)(function () {
|
|
151
141
|
loadData();
|
|
152
142
|
}, []);
|
|
143
|
+
(0, _react.useEffect)(function () {
|
|
144
|
+
if (shouldClose) {
|
|
145
|
+
onClose && onClose();
|
|
146
|
+
}
|
|
147
|
+
}, [shouldClose, onClose]);
|
|
153
148
|
|
|
154
149
|
var loadData = /*#__PURE__*/function () {
|
|
155
150
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
@@ -449,110 +444,105 @@ var EditGroup = function EditGroup(_ref) {
|
|
|
449
444
|
}
|
|
450
445
|
};
|
|
451
446
|
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
src: _close.default,
|
|
478
|
-
alt: "close icon"
|
|
479
|
-
})
|
|
480
|
-
})]
|
|
481
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
482
|
-
className: "details-edit",
|
|
483
|
-
children: "Agrega, edita y borra. Luego guarda los cambios."
|
|
484
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
485
|
-
className: "".concat(isMoreThanTenGroups ? "table-groups-max" : "table-groups-edit"),
|
|
486
|
-
children: groups.map(function (group, index) {
|
|
487
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.GroupRow, {
|
|
488
|
-
editing: editingIndex === index,
|
|
489
|
-
deleting: deletingIndex === index,
|
|
490
|
-
onMouseEnter: function onMouseEnter() {
|
|
491
|
-
return setHoveredIndex(index);
|
|
492
|
-
},
|
|
493
|
-
onMouseLeave: function onMouseLeave() {
|
|
494
|
-
return setHoveredIndex(null);
|
|
495
|
-
},
|
|
496
|
-
className: "group-row ".concat(isEditingList[index] ? "editing" : ""),
|
|
497
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
498
|
-
className: "input-group",
|
|
499
|
-
placeholder: "Escribe el nombre del grupo",
|
|
500
|
-
value: index !== undefined ? group.groupName : inputValue,
|
|
501
|
-
onChange: function onChange(e) {
|
|
502
|
-
return handleInputChange(e.target.value, index);
|
|
503
|
-
},
|
|
504
|
-
disabled: !isEditingList[index],
|
|
505
|
-
autoFocus: isEditingList[index] && editingIndex === index
|
|
506
|
-
}, index), currentEditIndex === index ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Button, {
|
|
507
|
-
className: "circular-button save-button visible",
|
|
508
|
-
onClick: function onClick() {
|
|
509
|
-
return handleSaveChanges(index);
|
|
510
|
-
},
|
|
447
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Backdrop, {
|
|
448
|
+
open: show,
|
|
449
|
+
className: "container-backgroundModal",
|
|
450
|
+
timeout: 400,
|
|
451
|
+
style: {
|
|
452
|
+
backgroundColor: "transparent",
|
|
453
|
+
zIndex: 10
|
|
454
|
+
},
|
|
455
|
+
onClick: onClose,
|
|
456
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Fade, {
|
|
457
|
+
in: show,
|
|
458
|
+
timeout: 400,
|
|
459
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
|
|
460
|
+
ref: modalRef,
|
|
461
|
+
open: show,
|
|
462
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
463
|
+
className: "contentModal",
|
|
464
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
465
|
+
className: "header",
|
|
466
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("h2", {
|
|
467
|
+
className: "title-edit",
|
|
468
|
+
children: "Editar grupos"
|
|
469
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Button, {
|
|
470
|
+
className: "circular-button close-button",
|
|
471
|
+
onClick: onClose,
|
|
511
472
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
512
|
-
src:
|
|
513
|
-
alt: "
|
|
473
|
+
src: _close.default,
|
|
474
|
+
alt: "close icon"
|
|
514
475
|
})
|
|
515
|
-
})
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
476
|
+
})]
|
|
477
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
478
|
+
className: "details-edit",
|
|
479
|
+
children: "Agrega, edita y borra. Luego guarda los cambios."
|
|
480
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
481
|
+
className: "".concat(isMoreThanTenGroups ? "table-groups-max" : "table-groups-edit"),
|
|
482
|
+
children: groups.map(function (group, index) {
|
|
483
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.GroupRow, {
|
|
484
|
+
editing: editingIndex === index,
|
|
485
|
+
deleting: deletingIndex === index,
|
|
486
|
+
onMouseEnter: function onMouseEnter() {
|
|
487
|
+
return setHoveredIndex(index);
|
|
520
488
|
},
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
alt: "edit icon"
|
|
524
|
-
})
|
|
525
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Button, {
|
|
526
|
-
className: "circular-button delete-button ".concat(hoveredIndex === index ? "visible" : ""),
|
|
527
|
-
onClick: function onClick() {
|
|
528
|
-
return handleDeleteButtonClick(group.groupId);
|
|
489
|
+
onMouseLeave: function onMouseLeave() {
|
|
490
|
+
return setHoveredIndex(null);
|
|
529
491
|
},
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
492
|
+
className: "group-row ".concat(isEditingList[index] ? "editing" : ""),
|
|
493
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
494
|
+
className: "input-group",
|
|
495
|
+
placeholder: "Escribe el nombre del grupo",
|
|
496
|
+
value: index !== undefined ? group.groupName : inputValue,
|
|
497
|
+
onChange: function onChange(e) {
|
|
498
|
+
return handleInputChange(e.target.value, index);
|
|
499
|
+
},
|
|
500
|
+
disabled: !isEditingList[index],
|
|
501
|
+
autoFocus: isEditingList[index] && editingIndex === index
|
|
502
|
+
}, index), currentEditIndex === index ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Button, {
|
|
503
|
+
className: "circular-button save-button visible",
|
|
504
|
+
onClick: function onClick() {
|
|
505
|
+
return handleSaveChanges(index);
|
|
506
|
+
},
|
|
507
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
508
|
+
src: _save.default,
|
|
509
|
+
alt: "save update icon"
|
|
510
|
+
})
|
|
511
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
512
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Button, {
|
|
513
|
+
className: "circular-button edit-button ".concat(hoveredIndex === index ? "visible" : ""),
|
|
514
|
+
onClick: function onClick() {
|
|
515
|
+
return handleEditButtonClick(index);
|
|
516
|
+
},
|
|
517
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
518
|
+
src: _edit.default,
|
|
519
|
+
alt: "edit icon"
|
|
520
|
+
})
|
|
521
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Button, {
|
|
522
|
+
className: "circular-button delete-button ".concat(hoveredIndex === index ? "visible" : ""),
|
|
523
|
+
onClick: function onClick() {
|
|
524
|
+
return handleDeleteButtonClick(group.groupId);
|
|
525
|
+
},
|
|
526
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
527
|
+
src: _trash.default,
|
|
528
|
+
alt: "trash icon"
|
|
529
|
+
})
|
|
530
|
+
})]
|
|
531
|
+
})]
|
|
532
|
+
}, group.groupId);
|
|
533
|
+
})
|
|
534
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
535
|
+
className: "container-save-add",
|
|
536
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Button, {
|
|
537
|
+
className: "button-add",
|
|
538
|
+
onClick: function onClick() {
|
|
539
|
+
return handleAddButtonClick();
|
|
540
|
+
},
|
|
541
|
+
children: "+ Agregar Grupo"
|
|
542
|
+
})
|
|
543
|
+
})]
|
|
546
544
|
})
|
|
547
|
-
})
|
|
548
|
-
onClickBtnDefault: function onClickBtnDefault() {
|
|
549
|
-
return setModalData(function (prev) {
|
|
550
|
-
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, prev), {}, {
|
|
551
|
-
show: false
|
|
552
|
-
});
|
|
553
|
-
});
|
|
554
|
-
}
|
|
555
|
-
}))]
|
|
545
|
+
})
|
|
556
546
|
})
|
|
557
547
|
});
|
|
558
548
|
};
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@ import trash from "../../../assets/images/Icons/trash.svg";
|
|
|
7
7
|
import edit from "../../../assets/images/Icons/edit.svg";
|
|
8
8
|
import close from "../../../assets/images/Icons/close.svg";
|
|
9
9
|
import save from "../../../assets/images/Icons/save.svg";
|
|
10
|
-
import {
|
|
10
|
+
import { Fade, Grow, Zoom, Backdrop } from "@mui/material";
|
|
11
11
|
import axios from "axios";
|
|
12
12
|
|
|
13
13
|
const reducerGroups = (state, action) => {
|
|
@@ -32,34 +32,33 @@ const reducerGroups = (state, action) => {
|
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
-
export const EditGroup = ({ token }) => {
|
|
35
|
+
export const EditGroup = ({ token, show, onClose }) => {
|
|
36
36
|
const [groups, setGroups] = useState([]);
|
|
37
37
|
const [state, dispatch] = useReducer(reducerGroups, {});
|
|
38
38
|
const [isMoreThanTenGroups, setIsMoreThanTenGroups] = useState(false);
|
|
39
39
|
const [editingIndex, setEditingIndex] = useState(null);
|
|
40
40
|
const [deletingIndex, setDeletingIndex] = useState(null);
|
|
41
|
-
const [deletedRows, setDeletedRows] = useState([]);
|
|
42
41
|
const [hoveredIndex, setHoveredIndex] = useState(null);
|
|
43
42
|
const [isEditingList, setIsEditingList] = useState([]);
|
|
44
43
|
const [newGroup, setNewGroup] = useState(false);
|
|
45
44
|
const [currentEditIndex, setCurrentEditIndex] = useState(null);
|
|
46
45
|
const [inputValue, setInputValue] = useState([]);
|
|
47
|
-
const [
|
|
48
|
-
show: false,
|
|
49
|
-
title: "Actualización completa",
|
|
50
|
-
message: "",
|
|
51
|
-
icon: "success",
|
|
52
|
-
});
|
|
46
|
+
const [shouldClose, setShouldClose] = useState(false);
|
|
53
47
|
|
|
54
48
|
const modalRef = useRef();
|
|
55
49
|
|
|
56
|
-
useEffect(() => {
|
|
57
|
-
}, [groups]);
|
|
50
|
+
useEffect(() => {}, [groups]);
|
|
58
51
|
|
|
59
52
|
useEffect(() => {
|
|
60
53
|
loadData();
|
|
61
54
|
}, []);
|
|
62
55
|
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
if (shouldClose) {
|
|
58
|
+
onClose && onClose();
|
|
59
|
+
}
|
|
60
|
+
}, [shouldClose, onClose]);
|
|
61
|
+
|
|
63
62
|
const loadData = async () => {
|
|
64
63
|
try {
|
|
65
64
|
const response = await axios.post(
|
|
@@ -123,7 +122,7 @@ export const EditGroup = ({ token }) => {
|
|
|
123
122
|
try {
|
|
124
123
|
const response = await axios.post(
|
|
125
124
|
`${process.env.REACT_APP_GROUPS_ENDPOINT}/update?id=${groupId}&groupName=${updatedGroupName}`,
|
|
126
|
-
|
|
125
|
+
{},
|
|
127
126
|
{
|
|
128
127
|
headers: {
|
|
129
128
|
Authorization: token,
|
|
@@ -231,101 +230,102 @@ export const EditGroup = ({ token }) => {
|
|
|
231
230
|
if (newGroup !== undefined) {
|
|
232
231
|
handleUpdateGroup(index, newGroup, concatenatedValue);
|
|
233
232
|
} else {
|
|
234
|
-
AddGroup(index,concatenatedValue);
|
|
233
|
+
AddGroup(index, concatenatedValue);
|
|
235
234
|
}
|
|
236
235
|
};
|
|
237
236
|
|
|
238
|
-
const handleCloseModal = (e) => {
|
|
239
|
-
if (modalRef.current && !modalRef.current.contains(e.target)) {
|
|
240
|
-
setEditingIndex(null);
|
|
241
|
-
}
|
|
242
|
-
};
|
|
243
|
-
|
|
244
|
-
useEffect(() => {
|
|
245
|
-
document.addEventListener("mousedown", handleCloseModal);
|
|
246
|
-
|
|
247
|
-
return () => {
|
|
248
|
-
document.removeEventListener("mousedown", handleCloseModal);
|
|
249
|
-
};
|
|
250
|
-
}, []);
|
|
251
|
-
|
|
252
237
|
return (
|
|
253
|
-
<
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
<
|
|
265
|
-
className={
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
238
|
+
<Backdrop
|
|
239
|
+
open={show}
|
|
240
|
+
className="container-backgroundModal"
|
|
241
|
+
timeout={400}
|
|
242
|
+
style={{
|
|
243
|
+
backgroundColor: "transparent",
|
|
244
|
+
zIndex: 10,
|
|
245
|
+
}}
|
|
246
|
+
onClick={onClose}
|
|
247
|
+
>
|
|
248
|
+
<Fade in={show} timeout={400}>
|
|
249
|
+
<Container ref={modalRef} open={show}>
|
|
250
|
+
<div className={`contentModal`}>
|
|
251
|
+
<div className="header">
|
|
252
|
+
<h2 className="title-edit">Editar grupos</h2>
|
|
253
|
+
<Button
|
|
254
|
+
className={`circular-button close-button`}
|
|
255
|
+
onClick={onClose}
|
|
256
|
+
>
|
|
257
|
+
<img src={close} alt="close icon" />
|
|
258
|
+
</Button>
|
|
259
|
+
</div>
|
|
260
|
+
<p className="details-edit">
|
|
261
|
+
Agrega, edita y borra. Luego guarda los cambios.
|
|
262
|
+
</p>
|
|
263
|
+
<div
|
|
264
|
+
className={`${
|
|
265
|
+
isMoreThanTenGroups ? "table-groups-max" : "table-groups-edit"
|
|
266
|
+
}`}
|
|
277
267
|
>
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
<Button
|
|
289
|
-
className={`circular-button save-button visible`}
|
|
290
|
-
onClick={() => handleSaveChanges(index)}
|
|
268
|
+
{groups.map((group, index) => (
|
|
269
|
+
<GroupRow
|
|
270
|
+
key={group.groupId}
|
|
271
|
+
editing={editingIndex === index}
|
|
272
|
+
deleting={deletingIndex === index}
|
|
273
|
+
onMouseEnter={() => setHoveredIndex(index)}
|
|
274
|
+
onMouseLeave={() => setHoveredIndex(null)}
|
|
275
|
+
className={`group-row ${
|
|
276
|
+
isEditingList[index] ? "editing" : ""
|
|
277
|
+
}`}
|
|
291
278
|
>
|
|
292
|
-
<
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
<
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
279
|
+
<input
|
|
280
|
+
key={index}
|
|
281
|
+
className={`input-group`}
|
|
282
|
+
placeholder="Escribe el nombre del grupo"
|
|
283
|
+
value={index !== undefined ? group.groupName : inputValue}
|
|
284
|
+
onChange={(e) => handleInputChange(e.target.value, index)}
|
|
285
|
+
disabled={!isEditingList[index]}
|
|
286
|
+
autoFocus={isEditingList[index] && editingIndex === index}
|
|
287
|
+
/>
|
|
288
|
+
{currentEditIndex === index ? (
|
|
289
|
+
<Button
|
|
290
|
+
className={`circular-button save-button visible`}
|
|
291
|
+
onClick={() => handleSaveChanges(index)}
|
|
292
|
+
>
|
|
293
|
+
<img src={save} alt="save update icon" />
|
|
294
|
+
</Button>
|
|
295
|
+
) : (
|
|
296
|
+
<>
|
|
297
|
+
<Button
|
|
298
|
+
className={`circular-button edit-button ${
|
|
299
|
+
hoveredIndex === index ? "visible" : ""
|
|
300
|
+
}`}
|
|
301
|
+
onClick={() => handleEditButtonClick(index)}
|
|
302
|
+
>
|
|
303
|
+
<img src={edit} alt="edit icon" />
|
|
304
|
+
</Button>
|
|
305
|
+
<Button
|
|
306
|
+
className={`circular-button delete-button ${
|
|
307
|
+
hoveredIndex === index ? "visible" : ""
|
|
308
|
+
}`}
|
|
309
|
+
onClick={() => handleDeleteButtonClick(group.groupId)}
|
|
310
|
+
>
|
|
311
|
+
<img src={trash} alt="trash icon" />
|
|
312
|
+
</Button>
|
|
313
|
+
</>
|
|
314
|
+
)}
|
|
315
|
+
</GroupRow>
|
|
316
|
+
))}
|
|
317
|
+
</div>
|
|
318
|
+
<div className="container-save-add">
|
|
319
|
+
<Button
|
|
320
|
+
className="button-add"
|
|
321
|
+
onClick={() => handleAddButtonClick()}
|
|
322
|
+
>
|
|
323
|
+
+ Agregar Grupo
|
|
324
|
+
</Button>
|
|
325
|
+
</div>
|
|
326
|
+
</div>
|
|
327
|
+
</Container>
|
|
328
|
+
</Fade>
|
|
329
|
+
</Backdrop>
|
|
330
330
|
);
|
|
331
331
|
};
|