@gustavo-valsechi/client 1.4.42 → 1.4.44

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.
@@ -42,18 +42,17 @@ const memory = [];
42
42
  const TargetProviderContainer = ({ children }) => {
43
43
  const [targets, setTargets] = (0, import_react.useState)([]);
44
44
  (0, import_react.useEffect)(() => {
45
- import_lodash.default.forEach(targets, (target, index) => {
45
+ import_lodash.default.forEach(memory, (target, index) => {
46
46
  var _a;
47
47
  const element = (_a = target.ref) == null ? void 0 : _a.current;
48
48
  if (!element) return;
49
49
  element.addEventListener("click", () => {
50
- const newTargets = [...targets];
51
50
  const coords = getCoords(element);
52
- newTargets.splice(index, 1, { ...target, show: !target.show, coords });
53
- setTargets(newTargets);
51
+ memory.splice(index, 1, { ...target, show: !target.show, coords });
52
+ setTargets(memory);
54
53
  });
55
54
  });
56
- }, [targets]);
55
+ }, []);
57
56
  const getCoords = (target) => {
58
57
  const rect = target.getBoundingClientRect();
59
58
  const targetTop = rect.top + window.scrollY;
@@ -8,18 +8,17 @@ const memory = [];
8
8
  const TargetProviderContainer = ({ children }) => {
9
9
  const [targets, setTargets] = useState([]);
10
10
  useEffect(() => {
11
- _.forEach(targets, (target, index) => {
11
+ _.forEach(memory, (target, index) => {
12
12
  var _a;
13
13
  const element = (_a = target.ref) == null ? void 0 : _a.current;
14
14
  if (!element) return;
15
15
  element.addEventListener("click", () => {
16
- const newTargets = [...targets];
17
16
  const coords = getCoords(element);
18
- newTargets.splice(index, 1, { ...target, show: !target.show, coords });
19
- setTargets(newTargets);
17
+ memory.splice(index, 1, { ...target, show: !target.show, coords });
18
+ setTargets(memory);
20
19
  });
21
20
  });
22
- }, [targets]);
21
+ }, []);
23
22
  const getCoords = (target) => {
24
23
  const rect = target.getBoundingClientRect();
25
24
  const targetTop = rect.top + window.scrollY;
@@ -35,6 +35,10 @@ var import_styled_components = __toESM(require("styled-components"));
35
35
  const Container = import_styled_components.default.div`
36
36
  position: absolute;
37
37
  z-index: 10;
38
+
39
+ @media(max-width: ${({ theme }) => theme.mobileMaxWidth}) {
40
+ width: 100%;
41
+ }
38
42
  `;
39
43
  // Annotate the CommonJS export names for ESM import in node:
40
44
  0 && (module.exports = {
@@ -2,6 +2,10 @@ import styled from "styled-components";
2
2
  const Container = styled.div`
3
3
  position: absolute;
4
4
  z-index: 10;
5
+
6
+ @media(max-width: ${({ theme }) => theme.mobileMaxWidth}) {
7
+ width: 100%;
8
+ }
5
9
  `;
6
10
  export {
7
11
  Container
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gustavo-valsechi/client",
3
- "version": "1.4.42",
3
+ "version": "1.4.44",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",