@epec-fcfm-uchile/frontend-component-header 1.0.43 → 1.0.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.
- package/dist/Logo.js +32 -7
- package/dist/Logo.js.map +1 -1
- package/package.json +1 -1
package/dist/Logo.js
CHANGED
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
var _excluded = ["href", "src", "alt"];
|
|
2
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
2
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
3
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
4
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
import Cookies from 'js-cookie';
|
|
8
|
+
import { jwtDecode } from "jwt-decode";
|
|
9
|
+
var login_domain = 'app.fcfmonline.cl';
|
|
10
|
+
var login_admin = false;
|
|
11
|
+
try {
|
|
12
|
+
var _decoded_epec_session, _decoded_epec_session2;
|
|
13
|
+
var epec_session_data = Cookies.get('_epec_session_data');
|
|
14
|
+
var decoded_epec_session_data = jwtDecode(epec_session_data);
|
|
15
|
+
login_domain = (_decoded_epec_session = decoded_epec_session_data.payload) !== null && _decoded_epec_session !== void 0 && _decoded_epec_session.subdomain && typeof decoded_epec_session_data.payload.subdomain === 'string' && decoded_epec_session_data.payload.subdomain ? "".concat(decoded_epec_session_data.payload.subdomain.trim().toLowerCase().replace(/[^a-z]/g, ''), ".fcfmonline.cl") : 'app.fcfmonline.cl';
|
|
16
|
+
login_admin = (_decoded_epec_session2 = decoded_epec_session_data.payload) !== null && _decoded_epec_session2 !== void 0 && _decoded_epec_session2.admin ? decoded_epec_session_data.payload.admin : false;
|
|
17
|
+
} catch (e) {/* empty */}
|
|
18
|
+
var condLogo;
|
|
19
|
+
if (login_domain === 'app.fcfmonline.cl') {
|
|
20
|
+
condLogo = /*#__PURE__*/React.createElement("a", _extends({
|
|
13
21
|
href: href,
|
|
14
22
|
className: "logo"
|
|
15
23
|
}, attributes), /*#__PURE__*/React.createElement("img", {
|
|
@@ -17,6 +25,23 @@ var Logo = function Logo(_ref) {
|
|
|
17
25
|
src: src,
|
|
18
26
|
alt: alt
|
|
19
27
|
}));
|
|
28
|
+
} else {
|
|
29
|
+
condLogo = /*#__PURE__*/React.createElement("div", _extends({
|
|
30
|
+
className: "logo"
|
|
31
|
+
}, attributes), /*#__PURE__*/React.createElement("img", {
|
|
32
|
+
className: "d-block epec_brand_img",
|
|
33
|
+
src: src,
|
|
34
|
+
alt: alt
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
var Logo = function Logo(_ref) {
|
|
38
|
+
var href = _ref.href,
|
|
39
|
+
src = _ref.src,
|
|
40
|
+
alt = _ref.alt,
|
|
41
|
+
attributes = _objectWithoutProperties(_ref, _excluded);
|
|
42
|
+
return {
|
|
43
|
+
condLogo: condLogo
|
|
44
|
+
};
|
|
20
45
|
};
|
|
21
46
|
export var logoDataShape = {
|
|
22
47
|
href: PropTypes.string.isRequired,
|
package/dist/Logo.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Logo.js","names":["React","PropTypes","
|
|
1
|
+
{"version":3,"file":"Logo.js","names":["React","PropTypes","Cookies","jwtDecode","login_domain","login_admin","_decoded_epec_session","_decoded_epec_session2","epec_session_data","get","decoded_epec_session_data","payload","subdomain","concat","trim","toLowerCase","replace","admin","e","condLogo","createElement","_extends","href","className","attributes","src","alt","Logo","_ref","_objectWithoutProperties","_excluded","logoDataShape","string","isRequired","propTypes"],"sources":["../src/Logo.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Cookies from 'js-cookie';\nimport { jwtDecode } from \"jwt-decode\";\nvar login_domain = 'app.fcfmonline.cl';\nvar login_admin = false;\ntry{\n const epec_session_data = Cookies.get('_epec_session_data');\n const decoded_epec_session_data = jwtDecode(epec_session_data);\n login_domain = (decoded_epec_session_data.payload?.subdomain && typeof decoded_epec_session_data.payload.subdomain ==='string' && decoded_epec_session_data.payload.subdomain)?`${decoded_epec_session_data.payload.subdomain.trim().toLowerCase().replace(/[^a-z]/g, '')}.fcfmonline.cl`:'app.fcfmonline.cl';\n login_admin = (decoded_epec_session_data.payload?.admin)?decoded_epec_session_data.payload.admin:false;\n}\ncatch (e) { /* empty */ }\nlet condLogo;\nif(login_domain === 'app.fcfmonline.cl'){\n condLogo = <a href={href} className=\"logo\" {...attributes}><img className=\"d-block epec_brand_img\" src={src} alt={alt} /></a>\n}\nelse{\n condLogo = <div className=\"logo\" {...attributes}><img className=\"d-block epec_brand_img\" src={src} alt={alt} /></div>\n}\nconst Logo = ({\n href,\n src,\n alt,\n ...attributes\n}) => (\n {condLogo}\n);\n\nexport const logoDataShape = {\n href: PropTypes.string.isRequired,\n src: PropTypes.string.isRequired,\n alt: PropTypes.string.isRequired,\n};\n\nLogo.propTypes = logoDataShape;\n\nexport default Logo;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MA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