@ikas/loyalty-widget-renderer 1.0.0-alpha.64 → 1.0.0-alpha.65

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.
@@ -1 +1 @@
1
- import{__awaiter as e,__generator as t}from'./../../../../ext/tslib/tslib.es6.mjs.js';import{observer as r}from"mobx-react";import n from"react";import'./../../../../ext/react-i18next/dist/es/context.js';import{useTranslation as o}from'./../../../../ext/react-i18next/dist/es/useTranslation.js';import{ArrowRight as i}from"../../../../assets/icons/arrow-right.js";import{CheckCircle as s}from"../../../../assets/icons/check-circle.js";import{CheckFillIllustration as c}from"../../../../assets/widget-icons/illustraions/check-fill.js";import{CampaignTypeEnum as a}from"../../../../models/loyalty-customer-info/index.js";import{WidgetIconTypeEnum as l}from"../../../../models/loyalty-widget/types/index.js";import{Container as u,IconWrapper as m,ContentWrapper as d,TextRow as p,ButtonsRow as f,ActionButton as E,Loader as y,ArrowIcon as _}from"./style.js";var g=r(function(r){var g=r.viewModel,h=r.line,v=o().t,T=g.loyaltyWidget.settings.widgetIconType,j=n.useState(!1),w=j[0],b=j[1];return n.createElement(u,null,n.createElement(m,{$iconType:T},function(){switch(T){case l.ILLUSTRATION:return n.createElement(c,null);case l.NORMAL:case l.NONE:default:return n.createElement(s,null)}}()),n.createElement(d,null,n.createElement(p,null,function(){var e=g.formatCurrency(h.discountAmount);switch(h.campaignType){case a.FIXED_AMOUNT:return v("main_screen.appliedDiscount.fixedAmount",{amount:e});case a.FREE_SHIPPING:return v("main_screen.appliedDiscount.freeShipping");case a.RATIO:return v("main_screen.appliedDiscount.ratio",{amount:"%".concat(h.discountAmount)});case a.BUY_X_THEN_GET_Y:return v("main_screen.appliedDiscount.freeProduct");default:return v("main_screen.appliedDiscount.generic",{amount:e})}}()),n.createElement(f,null,n.createElement(E,{$color:"#697586",$disabled:w,onClick:function(){return e(void 0,void 0,void 0,function(){var e;return t(this,function(t){switch(t.label){case 0:if(!(null===(e=g.callbacks)||void 0===e?void 0:e.removeLoyaltyPointsFromCart))return[3,4];b(!0),t.label=1;case 1:return t.trys.push([1,,3,4]),[4,g.callbacks.removeLoyaltyPointsFromCart()];case 2:return t.sent(),g.cartRefreshTrigger++,g.userRefreshTrigger++,[3,4];case 3:return b(!1),[7];case 4:return[2]}})})}},w&&n.createElement(y,null),v("main_screen.appliedDiscount.remove")),n.createElement(E,{$color:"#121926",$disabled:w,onClick:function(){g.storeUrl&&(window.location.href="".concat(g.storeUrl,"/checkout"))}},v("main_screen.appliedDiscount.goToCheckout"),n.createElement(_,null,n.createElement(i,null))))))});export{g as default};
1
+ import{__awaiter as e,__generator as t}from'./../../../../ext/tslib/tslib.es6.mjs.js';import{observer as r}from"mobx-react";import n from"react";import'./../../../../ext/react-i18next/dist/es/context.js';import{useTranslation as o}from'./../../../../ext/react-i18next/dist/es/useTranslation.js';import{ArrowRight as i}from"../../../../assets/icons/arrow-right.js";import{CheckCircle as c}from"../../../../assets/icons/check-circle.js";import{CheckFillIllustration as s}from"../../../../assets/widget-icons/illustraions/check-fill.js";import{CampaignTypeEnum as a}from"../../../../models/loyalty-customer-info/index.js";import{WidgetIconTypeEnum as l}from"../../../../models/loyalty-widget/types/index.js";import{Container as u,IconWrapper as m,ContentWrapper as d,TextRow as p,ButtonsRow as f,ActionButton as E,Loader as y,ArrowIcon as _}from"./style.js";var g=r(function(r){var g=r.viewModel,h=r.line,v=o().t,T=g.loyaltyWidget.settings.widgetIconType,j=n.useState(!1),w=j[0],b=j[1];return n.createElement(u,null,n.createElement(m,{$iconType:T},function(){switch(T){case l.ILLUSTRATION:return n.createElement(s,null);case l.NORMAL:case l.NONE:default:return n.createElement(c,null)}}()),n.createElement(d,null,n.createElement(p,null,function(){var e=g.formatCurrency(h.discountAmount);switch(h.campaignType){case a.FIXED_AMOUNT:return v("main_screen.appliedDiscount.fixedAmount",{amount:e});case a.FREE_SHIPPING:return v("main_screen.appliedDiscount.freeShipping");case a.RATIO:return v("main_screen.appliedDiscount.ratio",{amount:"%".concat(h.discountAmount)});case a.BUY_X_THEN_GET_Y:return v("main_screen.appliedDiscount.freeProduct");default:return v("main_screen.appliedDiscount.generic",{amount:e})}}()),n.createElement(f,null,n.createElement(E,{$color:"#697586",$disabled:w,onClick:function(){return e(void 0,void 0,void 0,function(){var e;return t(this,function(t){switch(t.label){case 0:if(!(null===(e=g.callbacks)||void 0===e?void 0:e.removeLoyaltyPointsFromCart))return[3,4];b(!0),t.label=1;case 1:return t.trys.push([1,,3,4]),[4,g.callbacks.removeLoyaltyPointsFromCart()];case 2:return t.sent(),g.cartRefreshTrigger++,g.userRefreshTrigger++,[3,4];case 3:return b(!1),[7];case 4:return[2]}})})}},w&&n.createElement(y,null),v("main_screen.appliedDiscount.remove")),n.createElement(E,{$color:"#121926",$disabled:w,onClick:function(){g.storeUrl&&g.cartId&&(window.location.href="".concat(g.storeUrl,"/checkout?id=").concat(g.cartId,"&step=info"))}},v("main_screen.appliedDiscount.goToCheckout"),n.createElement(_,null,n.createElement(i,null))))))});export{g as default};