@dilicorp/ui 1.1.0 → 1.3.1

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.
@@ -10,7 +10,6 @@ interface CountryInformationModel {
10
10
  version: string;
11
11
  companyName: string;
12
12
  links: {
13
- id: number;
14
13
  href: string;
15
14
  label: string;
16
15
  mobileLabel?: string;
@@ -24,7 +23,7 @@ export interface FooterPluxeeProps {
24
23
  target?: '_blank' | '_self' | '_parent' | '_top';
25
24
  }
26
25
  export declare const FooterPluxee: {
27
- ({ data, country, version, surpressYear, target }: FooterPluxeeProps): JSX.Element;
26
+ (props: FooterPluxeeProps): JSX.Element;
28
27
  displayName: string;
29
28
  };
30
29
  export {};
@@ -5,121 +5,114 @@ export var CountryCodes;
5
5
  CountryCodes["MEXICO"] = "es-MX";
6
6
  CountryCodes["COLOMBIA"] = "es-CO";
7
7
  })(CountryCodes || (CountryCodes = {}));
8
- var CountriesNames;
9
- (function (CountriesNames) {
10
- CountriesNames["BRAZIL"] = "Brasil";
11
- CountriesNames["MEXICO"] = "M\u00E9xico";
12
- CountriesNames["COLOMBIA"] = "Colombia";
13
- })(CountriesNames || (CountriesNames = {}));
8
+ const CountriesNames = {
9
+ [CountryCodes.BRAZIL]: 'Brasil',
10
+ [CountryCodes.MEXICO]: 'México',
11
+ [CountryCodes.COLOMBIA]: 'Colombia'
12
+ };
13
+ const linksByCountry = {
14
+ [CountryCodes.BRAZIL]: [
15
+ {
16
+ label: 'Privacidade',
17
+ href: 'https://www.sodexobeneficios.com.br/politica-de-privacidade/'
18
+ },
19
+ {
20
+ label: 'Termos uso',
21
+ href: 'https://www.sodexobeneficios.com.br/termos-de-uso/'
22
+ },
23
+ {
24
+ label: 'Cookies',
25
+ href: 'https://www.sodexobeneficios.com.br/politica-de-cookies/'
26
+ },
27
+ {
28
+ label: 'Prevenção Fraudes',
29
+ href: 'https://www.sodexobeneficios.com.br/seguranca-digital/'
30
+ },
31
+ {
32
+ label: 'Segurança Informação',
33
+ href: 'https://www.sodexobeneficios.com.br/politica-de-seguranca-da-informacao/'
34
+ }
35
+ ],
36
+ [CountryCodes.COLOMBIA]: [
37
+ {
38
+ label: 'Privacidad',
39
+ href: 'https://www.pluxee.co/politicas-de-privacidad/'
40
+ },
41
+ {
42
+ label: 'Términos uso',
43
+ href: 'https://www.pluxee.co/terminos-de-uso/'
44
+ },
45
+ {
46
+ label: 'Cookies',
47
+ href: 'https://www.pluxee.co/cookies/'
48
+ },
49
+ // {
50
+ // label: 'Seguridad Información',
51
+ // href: 'https://www.sodexo.co/politica-uso-datos/'
52
+ // }
53
+ ],
54
+ [CountryCodes.MEXICO]: [
55
+ {
56
+ label: 'Privacidad',
57
+ href: 'https://www.pluxee.mx/privacidad-pluxee/'
58
+ },
59
+ // {
60
+ // label: 'Términos uso',
61
+ // href: 'https://www.sodexo.com.mx/privacidad/uso-de-marca/'
62
+ // },
63
+ {
64
+ label: 'Cookies',
65
+ href: 'https://www.pluxee.mx/politica-de-cookies/'
66
+ },
67
+ {
68
+ label: 'Seguridad Información',
69
+ href: 'https://www.pluxee.mx/politica-del-sistema-de-gestion-de-seguridad-de-la-informacion/'
70
+ }
71
+ ]
72
+ };
14
73
  const currentYear = new Date().getFullYear();
15
- export const FooterPluxee = ({ data, country, version, surpressYear, target = '_self' }) => {
16
- var _a;
74
+ export const FooterPluxee = (props) => {
75
+ var _a, _b;
76
+ const { data, country = CountryCodes.BRAZIL, version, surpressYear, target = '_self' } = props;
17
77
  const countryInformation = useMemo(() => {
18
78
  var _a;
19
- if (data)
79
+ if (data) {
20
80
  return data;
21
- const links = {
22
- [CountryCodes.BRAZIL]: {
23
- name: CountriesNames.BRAZIL,
24
- version: 'Versão',
25
- companyName: 'Pluxee',
26
- links: [
27
- {
28
- id: 1,
29
- label: 'Privacidade',
30
- href: 'https://www.sodexobeneficios.com.br/politica-de-privacidade/'
31
- },
32
- {
33
- id: 2,
34
- label: 'Termos uso',
35
- href: 'https://www.sodexobeneficios.com.br/termos-de-uso/'
36
- },
37
- {
38
- id: 3,
39
- label: 'Cookies',
40
- href: 'https://www.sodexobeneficios.com.br/politica-de-cookies/'
41
- },
42
- {
43
- id: 4,
44
- label: 'Prevenção Fraudes',
45
- href: 'https://www.sodexobeneficios.com.br/seguranca-digital/'
46
- },
47
- {
48
- id: 5,
49
- label: 'Segurança Informação',
50
- href: 'https://www.sodexobeneficios.com.br/politica-de-seguranca-da-informacao/'
51
- }
52
- ]
53
- },
54
- [CountryCodes.COLOMBIA]: {
55
- name: CountriesNames.COLOMBIA,
56
- version: 'Versión',
57
- companyName: 'Pluxee',
58
- links: [
59
- {
60
- id: 6,
61
- label: 'Privacidad',
62
- href: 'https://www.sodexo.co/politicas-de-privacidad/'
63
- },
64
- {
65
- id: 7,
66
- label: 'Términos uso',
67
- href: 'https://www.sodexo.co/terminos-de-uso/'
68
- },
69
- { id: 9, label: 'Cookies', href: 'https://www.sodexo.co/cookies/' },
70
- {
71
- id: 8,
72
- label: 'Seguridad Información',
73
- href: 'https://www.sodexo.co/politica-uso-datos/'
74
- }
75
- ]
76
- },
77
- [CountryCodes.MEXICO]: {
78
- name: CountriesNames.MEXICO,
79
- version: 'Versión',
80
- companyName: 'Pluxee',
81
- links: [
82
- {
83
- id: 9,
84
- label: 'Privacidad',
85
- href: 'https://www.sodexo.com.mx/privacidad/'
86
- },
87
- {
88
- id: 10,
89
- label: 'Términos uso',
90
- href: 'https://www.sodexo.com.mx/privacidad/uso-de-marca/'
91
- },
92
- {
93
- id: 11,
94
- label: 'Cookies',
95
- href: 'https://www.sodexo.com.mx/politica-de-cookies/'
96
- },
97
- {
98
- id: 12,
99
- label: 'Seguridad Información',
100
- href: 'https://www.sodexo.com.mx/politica-del-sistema-de-gestion-de-seguridad-de-la-informacion/'
101
- }
102
- ]
103
- }
81
+ }
82
+ const defaultCompanyName = 'Pluxee';
83
+ const defaultCountry = CountryCodes.BRAZIL;
84
+ const countryConfig = {
85
+ [CountryCodes.BRAZIL]: { version: 'Versão' },
86
+ [CountryCodes.COLOMBIA]: { version: 'Versión' },
87
+ [CountryCodes.MEXICO]: { version: 'Versión' }
104
88
  };
105
- return country
106
- ? (_a = links === null || links === void 0 ? void 0 : links[country]) !== null && _a !== void 0 ? _a : links === null || links === void 0 ? void 0 : links[CountryCodes.BRAZIL]
107
- : links === null || links === void 0 ? void 0 : links[CountryCodes.BRAZIL];
89
+ const links = Object.entries(countryConfig).reduce((acc, [code, config]) => {
90
+ const countryCode = code;
91
+ acc[countryCode] = {
92
+ name: CountriesNames[countryCode],
93
+ version: config.version,
94
+ companyName: defaultCompanyName,
95
+ links: linksByCountry[countryCode]
96
+ };
97
+ return acc;
98
+ }, {});
99
+ return (_a = links[country !== null && country !== void 0 ? country : defaultCountry]) !== null && _a !== void 0 ? _a : links[defaultCountry];
108
100
  }, [data, country]);
101
+ const yearText = surpressYear ? '' : currentYear;
102
+ const companyName = (_a = countryInformation === null || countryInformation === void 0 ? void 0 : countryInformation.companyName) !== null && _a !== void 0 ? _a : 'Pluxee';
103
+ const versionText = version
104
+ ? ` - ${countryInformation === null || countryInformation === void 0 ? void 0 : countryInformation.version}: ${version}`
105
+ : '';
109
106
  return (React.createElement("footer", { className: "footer-pluxee" },
110
107
  React.createElement("div", { className: "footer-pluxee-container" },
111
108
  React.createElement("nav", null,
112
- React.createElement("ul", null, (_a = countryInformation === null || countryInformation === void 0 ? void 0 : countryInformation.links) === null || _a === void 0 ? void 0 : _a.map(({ id, label, href }) => {
113
- return (React.createElement("li", { key: `external-link-${id}` },
114
- React.createElement("a", { href: href, target: target, rel: "noreferrer" }, label)));
115
- }))),
109
+ React.createElement("ul", null, (_b = countryInformation === null || countryInformation === void 0 ? void 0 : countryInformation.links) === null || _b === void 0 ? void 0 : _b.map(({ label, href }, index) => (React.createElement("li", { key: `external-link-${index}` },
110
+ React.createElement("a", { href: href, target: target, rel: "noreferrer" }, label)))))),
116
111
  React.createElement("span", null,
117
112
  "\u00A9",
118
- surpressYear ? '' : currentYear,
119
- ' ',
120
- (countryInformation === null || countryInformation === void 0 ? void 0 : countryInformation.companyName)
121
- ? countryInformation === null || countryInformation === void 0 ? void 0 : countryInformation.companyName
122
- : 'Pluxee',
123
- version ? ` - ${countryInformation === null || countryInformation === void 0 ? void 0 : countryInformation.version}: ${version}` : ''))));
113
+ yearText,
114
+ " ",
115
+ companyName,
116
+ versionText))));
124
117
  };
125
118
  FooterPluxee.displayName = 'FooterPluxee';
@@ -35,7 +35,7 @@ export declare const Layout: {
35
35
  displayName: string;
36
36
  };
37
37
  FooterPluxee: {
38
- ({ data, country, version, surpressYear, target }: import("./footer/footer-pluxee").FooterPluxeeProps): JSX.Element;
38
+ (props: import("./footer/footer-pluxee").FooterPluxeeProps): JSX.Element;
39
39
  displayName: string;
40
40
  };
41
41
  };