l-min-components 1.0.765 → 1.0.773

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "l-min-components",
3
- "version": "1.0.765",
3
+ "version": "1.0.773",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -1,5 +1,6 @@
1
1
  import React, { useCallback, CSSProperties } from "react";
2
2
  import styled from "styled-components";
3
+ import useTranslation from "../../hooks/useTranslation";
3
4
  /**
4
5
  * @param {{
5
6
  * type?: ("primary" | "secondary" | "tertiary"),
@@ -19,6 +20,8 @@ import styled from "styled-components";
19
20
  *
20
21
  */
21
22
  const ButtonComponent = (props) => {
23
+ const { textSchema, findText } = useTranslation();
24
+
22
25
  const handleClick = useCallback((e) => {
23
26
  props.onClick && props.onClick(e);
24
27
  }, []);
@@ -26,6 +29,7 @@ const ButtonComponent = (props) => {
26
29
  switch (props.type) {
27
30
  case "primary":
28
31
  return (
32
+ textSchema &&
29
33
  <Button
30
34
  disabled={props.disabled}
31
35
  onClick={handleClick}
@@ -49,7 +53,7 @@ const ButtonComponent = (props) => {
49
53
  />
50
54
  )
51
55
  )}
52
- {props.text ?? "Text"}
56
+ {findText(props.text) ?? "Text"}
53
57
  {props.icon?.right && props.icon.jsx ? (
54
58
  <props.icon.jsx
55
59
  {...{
@@ -73,6 +77,7 @@ const ButtonComponent = (props) => {
73
77
  );
74
78
  case "secondary":
75
79
  return (
80
+ textSchema &&
76
81
  <SecondaryButton
77
82
  disabled={props.disabled}
78
83
  onClick={handleClick}
@@ -96,7 +101,7 @@ const ButtonComponent = (props) => {
96
101
  />
97
102
  )
98
103
  )}
99
- {props.text ?? "Text"}
104
+ {findText(props.text) ?? "Text"}
100
105
  {props.icon?.right && props.icon.jsx ? (
101
106
  <props.icon.jsx
102
107
  {...{
@@ -143,7 +148,7 @@ const ButtonComponent = (props) => {
143
148
  />
144
149
  )
145
150
  )}
146
- {props.text ?? "Text"}
151
+ {findText(props.text) ?? "Text"}
147
152
  {props.icon?.right && props.icon.jsx ? (
148
153
  <props.icon.jsx
149
154
  {...{
@@ -167,6 +172,7 @@ const ButtonComponent = (props) => {
167
172
  );
168
173
  default:
169
174
  return (
175
+ textSchema &&
170
176
  <Button
171
177
  disabled={props.disabled}
172
178
  onClick={handleClick}
@@ -190,7 +196,7 @@ const ButtonComponent = (props) => {
190
196
  />
191
197
  )
192
198
  )}
193
- {props.text ?? "Text"}
199
+ {findText(props.text) ?? "Text"}
194
200
  {props.icon?.right && props.icon.jsx ? (
195
201
  <props.icon.jsx
196
202
  {...{
@@ -26,7 +26,7 @@ import useTranslation from "../../hooks/useTranslation";
26
26
  *
27
27
  */
28
28
  const HeaderComponentTwo = (props) => {
29
- const { textSchema, setDefaultLang, defaultLang, findText } = useTranslation();
29
+ // const { setDefaultLang, } = useTranslation();
30
30
 
31
31
  const [selected, setSelected] = useState("ES");
32
32
  const [isOpen, setIsOpen] = useState(false);
@@ -121,7 +121,7 @@ const HeaderComponentTwo = (props) => {
121
121
  <li
122
122
  onClick={() => {
123
123
  setLanguageDropdown();
124
- setDefaultLang(item?.slug);
124
+ props?.setDefaultLang(item?.slug);
125
125
  localStorage.setItem("defaultLang", JSON.stringify(item));
126
126
  }}
127
127
  >
@@ -1,5 +1,7 @@
1
- import React, { useState, useEffect } from "react";
1
+ import React, { useState, useEffect, useContext } from "react";
2
2
  import { Input, Label, ErrorMsg } from "./index.styled";
3
+ import { OutletContext } from "../AppMainLayout";
4
+ import useTranslation from "../../hooks/useTranslation";
3
5
 
4
6
  /**
5
7
  * @param {{
@@ -17,6 +19,8 @@ import { Input, Label, ErrorMsg } from "./index.styled";
17
19
  const InputComponent = (props) => {
18
20
  const [value, setValue] = useState("");
19
21
  const [formErrors, setFormErrors] = useState(false);
22
+ const { textSchema, findText } = useTranslation();
23
+
20
24
 
21
25
  const validate = (e) => {
22
26
  if (!e.target.value) {
@@ -35,16 +39,17 @@ const InputComponent = (props) => {
35
39
  };
36
40
 
37
41
  return (
42
+ textSchema &&
38
43
  <div style={props.style}>
39
44
  <Label htmlFor={props.in} style={props.customLabelStyle}>
40
- {props.label}
45
+ {findText(props.label)}
41
46
  </Label>
42
47
  <Input
43
48
  type={props.inputType}
44
49
  name={props.inputName}
45
50
  value={props.value}
46
51
  id={props.inputId}
47
- placeholder={props.placeholder}
52
+ placeholder={findText(props.placeholder)}
48
53
  style={props.customInputStyle}
49
54
  disabled={props.disabled}
50
55
  hasError={props.hasError}
@@ -301,11 +301,17 @@ const SideMenu = ({
301
301
  )}
302
302
  minimal={isOpen}
303
303
  >
304
- <IconContainer active={active}>
305
- {active ? iconActive : icon}
306
- </IconContainer>
307
-
308
- <TextContainer minimal={isOpen}>{text}</TextContainer>
304
+ {!(
305
+ window.location.hostname.includes("personal") &&
306
+ window.location.hostname.includes("staging")
307
+ ) && (
308
+ <>
309
+ <IconContainer active={active}>
310
+ {active ? iconActive : icon}
311
+ </IconContainer>
312
+ <TextContainer minimal={isOpen}>{text}</TextContainer>
313
+ </>
314
+ )}
309
315
 
310
316
  {notifications && (
311
317
  <NotificationCount minimal={isOpen}>