oolib 2.69.1 → 2.69.2
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.
|
@@ -26,6 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.BannerInfo = exports.BannerAlert = void 0;
|
|
27
27
|
var react_1 = __importStar(require("react"));
|
|
28
28
|
var index_styled_1 = require("./index.styled");
|
|
29
|
+
var react_router_dom_1 = require("react-router-dom");
|
|
29
30
|
var Buttons_1 = require("../Buttons");
|
|
30
31
|
var icons_1 = require("../../icons");
|
|
31
32
|
var Typo_1 = require("../Typo");
|
|
@@ -61,12 +62,17 @@ var Banner = function (_a) {
|
|
|
61
62
|
handleRemove(e, id);
|
|
62
63
|
}, 300);
|
|
63
64
|
};
|
|
65
|
+
var genCTA = function (cta) {
|
|
66
|
+
var LinkWrapper = cta.to ? react_router_dom_1.Link : react_1.Fragment; //sometimes we wanna pass the cta as a 'to' string rather than a action function so that it is serializable
|
|
67
|
+
return (react_1.default.createElement(LinkWrapper, { to: cta.to },
|
|
68
|
+
react_1.default.createElement(Buttons_1.ButtonSecondary, { style: { marginTop: "0.5rem", marginBottom: "0.5rem" }, S: true, onClick: !cta.to && cta.action, invert: color === "dark" ? true : false }, cta === null || cta === void 0 ? void 0 : cta.text)));
|
|
69
|
+
};
|
|
64
70
|
return (react_1.default.createElement(index_styled_1.BannerAnimateStyled, { key: id, ref: ContainerRef, height: height },
|
|
65
71
|
react_1.default.createElement(index_styled_1.BannerWrapperStyled, { bottomStroke: bottomStroke, color: color },
|
|
66
72
|
react_1.default.createElement(index_styled_1.BannerStyled, null,
|
|
67
73
|
showIcon && react_1.default.createElement(DisplayIcon, { color: color }),
|
|
68
74
|
react_1.default.createElement(Typo_1.SANS_2, null, msg),
|
|
69
|
-
cta && (
|
|
75
|
+
cta && genCTA(cta)),
|
|
70
76
|
hideCloseButton !== true && react_1.default.createElement(Buttons_1.ButtonGhost, { S: true, icon: "X", invert: color === "dark" ? true : false, onClick: function (e) { return remove(e, id); } }))));
|
|
71
77
|
};
|
|
72
78
|
var BannerAlert = function (_a) {
|