@gustavo-valsechi/client 1.4.161 → 1.4.162
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.
|
@@ -66,20 +66,29 @@ const ModalProviderContainer = ({ children }) => {
|
|
|
66
66
|
removeModal(modalName);
|
|
67
67
|
};
|
|
68
68
|
const setProps = (modalName, props) => {
|
|
69
|
-
|
|
70
|
-
const
|
|
69
|
+
var _a;
|
|
70
|
+
const index = import_lodash.default.findIndex(memory, (modal) => modal.name === modalName);
|
|
71
|
+
const content = import_lodash.default.find(memory, (modal) => modal.name === modalName);
|
|
71
72
|
if (!content) return;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
memory.splice(index, 1, {
|
|
74
|
+
...content,
|
|
75
|
+
props: {
|
|
76
|
+
...content.props,
|
|
77
|
+
...props,
|
|
78
|
+
content: {
|
|
79
|
+
...((_a = content.props) == null ? void 0 : _a.content) || {},
|
|
80
|
+
...props.content
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
setModals(memory);
|
|
75
85
|
};
|
|
76
86
|
const toggle = (modalName) => {
|
|
77
87
|
var _a;
|
|
78
|
-
const content = import_lodash.default.find(
|
|
88
|
+
const content = import_lodash.default.find(memory, (modal) => modal.name === modalName);
|
|
79
89
|
if (!content) return;
|
|
80
90
|
setProps(modalName, { toggle: !((_a = content == null ? void 0 : content.props) == null ? void 0 : _a.toggle) });
|
|
81
91
|
};
|
|
82
|
-
console.log(modals);
|
|
83
92
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
84
93
|
ModalContext.Provider,
|
|
85
94
|
{
|
|
@@ -32,20 +32,29 @@ const ModalProviderContainer = ({ children }) => {
|
|
|
32
32
|
removeModal(modalName);
|
|
33
33
|
};
|
|
34
34
|
const setProps = (modalName, props) => {
|
|
35
|
-
|
|
36
|
-
const
|
|
35
|
+
var _a;
|
|
36
|
+
const index = _.findIndex(memory, (modal) => modal.name === modalName);
|
|
37
|
+
const content = _.find(memory, (modal) => modal.name === modalName);
|
|
37
38
|
if (!content) return;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
memory.splice(index, 1, {
|
|
40
|
+
...content,
|
|
41
|
+
props: {
|
|
42
|
+
...content.props,
|
|
43
|
+
...props,
|
|
44
|
+
content: {
|
|
45
|
+
...((_a = content.props) == null ? void 0 : _a.content) || {},
|
|
46
|
+
...props.content
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
setModals(memory);
|
|
41
51
|
};
|
|
42
52
|
const toggle = (modalName) => {
|
|
43
53
|
var _a;
|
|
44
|
-
const content = _.find(
|
|
54
|
+
const content = _.find(memory, (modal) => modal.name === modalName);
|
|
45
55
|
if (!content) return;
|
|
46
56
|
setProps(modalName, { toggle: !((_a = content == null ? void 0 : content.props) == null ? void 0 : _a.toggle) });
|
|
47
57
|
};
|
|
48
|
-
console.log(modals);
|
|
49
58
|
return /* @__PURE__ */ jsxs(
|
|
50
59
|
ModalContext.Provider,
|
|
51
60
|
{
|