@trafilea/afrodita-components 6.21.3 → 6.21.4

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/build/index.d.ts CHANGED
@@ -2928,6 +2928,7 @@ interface CouponProps {
2928
2928
  btnText?: string;
2929
2929
  couponCode?: string;
2930
2930
  offerLink?: string;
2931
+ onClickHandler?: () => void;
2931
2932
  }
2932
2933
  declare const CouponCard: FC<CouponProps>;
2933
2934
 
@@ -5198,16 +5198,14 @@ var RightSide = newStyled.div(templateObject_4$O || (templateObject_4$O = __make
5198
5198
  var FlexStart = newStyled.div(templateObject_5$A || (templateObject_5$A = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: start;\n gap: 5px;\n width: 100%;\n padding: 12px;\n"], ["\n display: flex;\n flex-direction: column;\n align-items: start;\n gap: 5px;\n width: 100%;\n padding: 12px;\n"])));
5199
5199
  var templateObject_1$1R, templateObject_2$1g, templateObject_3$$, templateObject_4$O, templateObject_5$A;
5200
5200
 
5201
- var _this$1 = undefined;
5202
5201
  var CouponCard = function (_a) {
5203
- var image = _a.image, title = _a.title, content = _a.content, couponCode = _a.couponCode, offerLink = _a.offerLink, width = _a.width, height = _a.height, _b = _a.btnText, btnText = _b === void 0 ? 'Redeem Offer' : _b;
5202
+ var image = _a.image, title = _a.title, content = _a.content, couponCode = _a.couponCode, offerLink = _a.offerLink, width = _a.width, height = _a.height, _b = _a.btnText, btnText = _b === void 0 ? 'Redeem Offer' : _b, onClickHandler = _a.onClickHandler;
5204
5203
  var _c = useState(false), showCoupon = _c[0], setShowCoupon = _c[1];
5205
- var handleCopy = useCallback(function (couponCode) { return (couponCode ? navigator.clipboard.writeText(couponCode) : undefined); }, []);
5206
5204
  return (jsxs$1(Container$1a, __assign$1({ height: height, width: width }, { children: [jsx$1(LeftSide, { children: jsx$1(Image$3, { objectFit: "cover", src: image.src, alt: image.alt, width: "100%", height: "100%", borderRadius: "8px 0 0 8px" }, void 0) }, void 0), jsxs$1(RightSide, { children: [jsxs$1(FlexStart, { children: [jsx$1(Text$7, __assign$1({ variant: "body", weight: "bold", size: "small" }, { children: title }), void 0), content] }, void 0), jsx$1(FlexCentered, { children: !showCoupon ? (jsx$1(ButtonPrimary, { type: "button", text: btnText, wide: true, size: ComponentSize.Large, onClick: function () { return setShowCoupon(function (prev) { return !prev; }); } }, void 0)) : (jsxs$1(Fragment$2, { children: [jsx$1(ButtonSecondaryOutline, { "data-testid": "coupon-code-btn", testId: "coupon-code-btn", type: "button", text: couponCode !== null && couponCode !== void 0 ? couponCode : '', wide: true, size: ComponentSize.Small, icon: {
5207
5205
  name: 'actions/copy_outlined',
5208
5206
  position: 'right',
5209
5207
  margin: '10px',
5210
- }, onClick: handleCopy.bind(_this$1, couponCode !== null && couponCode !== void 0 ? couponCode : '') }, void 0), jsx$1(Text$7, __assign$1({ variant: "link", weight: "demi", underline: true, href: offerLink }, { children: "Go to offer" }), void 0)] }, void 0)) }, void 0)] }, void 0)] }), void 0));
5208
+ }, onClick: function () { return onClickHandler && onClickHandler(); } }, void 0), jsx$1(Text$7, __assign$1({ variant: "link", weight: "demi", underline: true, href: offerLink }, { children: "Go to offer" }), void 0)] }, void 0)) }, void 0)] }, void 0)] }), void 0));
5211
5209
  };
5212
5210
 
5213
5211
  // Partner titles