@gustavo-valsechi/client 1.4.64 → 1.4.65
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.
- package/dist/contexts/target/index.js +17 -14
- package/dist/contexts/target/index.mjs +18 -15
- package/package.json +1 -1
|
@@ -88,6 +88,22 @@ const TargetProviderContainer = ({ children }) => {
|
|
|
88
88
|
memory.slice(index, 1);
|
|
89
89
|
setTargets(memory);
|
|
90
90
|
};
|
|
91
|
+
const renderTargets = (0, import_react.useCallback)(() => {
|
|
92
|
+
return import_lodash.default.map(targets, (target, index) => {
|
|
93
|
+
console.log("show", show);
|
|
94
|
+
const targetContent = import_lodash.default.find(show, (data) => data.index === index);
|
|
95
|
+
console.log("targetContent", targetContent);
|
|
96
|
+
if (!targetContent) return;
|
|
97
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
98
|
+
import_styles.Container,
|
|
99
|
+
{
|
|
100
|
+
style: targetContent.coords,
|
|
101
|
+
children: target.component
|
|
102
|
+
},
|
|
103
|
+
index
|
|
104
|
+
);
|
|
105
|
+
});
|
|
106
|
+
}, [targets, show]);
|
|
91
107
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
92
108
|
TargetContext.Provider,
|
|
93
109
|
{
|
|
@@ -96,20 +112,7 @@ const TargetProviderContainer = ({ children }) => {
|
|
|
96
112
|
remove
|
|
97
113
|
},
|
|
98
114
|
children: [
|
|
99
|
-
|
|
100
|
-
console.log("show", show);
|
|
101
|
-
const targetContent = import_lodash.default.find(show, (data) => data.index === index);
|
|
102
|
-
console.log("targetContent", targetContent);
|
|
103
|
-
if (!targetContent) return;
|
|
104
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
105
|
-
import_styles.Container,
|
|
106
|
-
{
|
|
107
|
-
style: targetContent.coords,
|
|
108
|
-
children: target.component
|
|
109
|
-
},
|
|
110
|
-
index
|
|
111
|
-
);
|
|
112
|
-
}),
|
|
115
|
+
renderTargets(),
|
|
113
116
|
children
|
|
114
117
|
]
|
|
115
118
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { createContext, useContext, useEffect, useState } from "react";
|
|
3
|
+
import { createContext, useContext, useEffect, useState, useCallback } from "react";
|
|
4
4
|
import { Container } from "./styles";
|
|
5
5
|
import _ from "lodash";
|
|
6
6
|
const TargetContext = createContext({});
|
|
@@ -54,6 +54,22 @@ const TargetProviderContainer = ({ children }) => {
|
|
|
54
54
|
memory.slice(index, 1);
|
|
55
55
|
setTargets(memory);
|
|
56
56
|
};
|
|
57
|
+
const renderTargets = useCallback(() => {
|
|
58
|
+
return _.map(targets, (target, index) => {
|
|
59
|
+
console.log("show", show);
|
|
60
|
+
const targetContent = _.find(show, (data) => data.index === index);
|
|
61
|
+
console.log("targetContent", targetContent);
|
|
62
|
+
if (!targetContent) return;
|
|
63
|
+
return /* @__PURE__ */ jsx(
|
|
64
|
+
Container,
|
|
65
|
+
{
|
|
66
|
+
style: targetContent.coords,
|
|
67
|
+
children: target.component
|
|
68
|
+
},
|
|
69
|
+
index
|
|
70
|
+
);
|
|
71
|
+
});
|
|
72
|
+
}, [targets, show]);
|
|
57
73
|
return /* @__PURE__ */ jsxs(
|
|
58
74
|
TargetContext.Provider,
|
|
59
75
|
{
|
|
@@ -62,20 +78,7 @@ const TargetProviderContainer = ({ children }) => {
|
|
|
62
78
|
remove
|
|
63
79
|
},
|
|
64
80
|
children: [
|
|
65
|
-
|
|
66
|
-
console.log("show", show);
|
|
67
|
-
const targetContent = _.find(show, (data) => data.index === index);
|
|
68
|
-
console.log("targetContent", targetContent);
|
|
69
|
-
if (!targetContent) return;
|
|
70
|
-
return /* @__PURE__ */ jsx(
|
|
71
|
-
Container,
|
|
72
|
-
{
|
|
73
|
-
style: targetContent.coords,
|
|
74
|
-
children: target.component
|
|
75
|
-
},
|
|
76
|
-
index
|
|
77
|
-
);
|
|
78
|
-
}),
|
|
81
|
+
renderTargets(),
|
|
79
82
|
children
|
|
80
83
|
]
|
|
81
84
|
}
|