@ikas/storefront 4.7.0-beta.3 → 4.7.0-beta.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{observer as t}from"mobx-react-lite";import{Button as a}from"../button/index.js";import r from"./select/index.js";import n from"../svg/cross.js";import{useTranslation as
|
|
1
|
+
import*as e from"react";import{observer as t}from"mobx-react-lite";import{Button as a}from"../button/index.js";import r from"./select/index.js";import n from"../svg/cross.js";import{useTranslation as i}from"../../../../utils/i18n.js";import{formatCurrency as c}from"../../../../utils/currency.js";import{IkasCampaignOfferProductApplicablePriceEnum as o}from"@ikas/storefront-models";import m from"./style.module.scss.js";var d=function(t){var a=t.seconds,r=t.rejectOffer,n=i().t,c=e.useState(a),o=c[0],d=c[1];e.useEffect((function(){var e=o>0&&setInterval((function(){return d(o-1)}),1e3);return 0===o&&r(),function(){return clearInterval(e)}}),[o]);return e.createElement("div",{className:m.CountdownContainer},e.createElement("div",{className:m.CountdownText},n("checkout-page:timeRemaining",{value:function(e){var t=Math.floor(e/60/60),a=Math.floor(e/60)-60*t,r=e%60;return 0!==t?t.toString().padStart(2,"0")+":":a.toString().padStart(2,"0")+":"+r.toString().padStart(2,"0")}(o)})))},l=t((function(t){var l,f,s,u,p,v=t.vm,g=t.campaignOffer,E=i().t,I=e.useState(g.variants[0]),h=I[0],C=I[1],N=function(){v.updateCartCampaignOffer({accepted:!1,cartId:v.checkout.id,campaignOfferId:g.campaignOffer.campaignOfferId,campaignOfferProductId:g.offer.id,productId:g.offer.productId,variantId:h.id})},P=Math.round(((new Date).getTime()-new Date(g.campaignOffer.offerStartDate).getTime())/1e3),S=null===(l=h.images)||void 0===l?void 0:l.filter((function(e){return!e.isVideo})),O=(null===(f=h.mainImage)||void 0===f?void 0:f.isVideo)?(null==S?void 0:S.length)?null===(s=S[0].image)||void 0===s?void 0:s.thumbnailSrc:void 0:null===(p=null===(u=h.mainImage)||void 0===u?void 0:u.image)||void 0===p?void 0:p.thumbnailSrc;return e.createElement("div",{className:m.Container},g.offer.countdownMinutes&&e.createElement(d,{seconds:P>60*g.offer.countdownMinutes?0:60*g.offer.countdownMinutes-P,rejectOffer:N}),e.createElement("div",{className:m.ContentContainer},e.createElement("div",{className:m.Header},e.createElement("div",{className:m.Title},g.offer.title),e.createElement("div",{className:m.RejectButton,onClick:N},e.createElement(n,null))),e.createElement("div",{className:m.ProductContainer},e.createElement("div",{className:m.ImageContainer},e.createElement("img",{className:m.Image,src:O})),e.createElement("div",{className:m.ProductDetails},e.createElement("div",{className:m.ProductName},g.product.name),g.product.hasVariant&&1===g.variants.length&&e.createElement("div",{className:m.VariantName},h.variantValues.map((function(e){return e.name})).join(", ")),g.product.brand&&e.createElement("div",{className:m.Brand},g.product.brand.name),e.createElement("div",{className:m.ProductPrice},0!==g.offer.discountAmount&&e.createElement("span",{className:m.Discount},g.offer.applicablePrice===o.SELL_PRICE?h.price.formattedSellPrice:h.price.formattedFinalPrice," "),c(g.offer.applicablePrice===o.SELL_PRICE?h.price.sellPrice-h.price.sellPrice*(g.offer.discountAmount||0)/100:h.price.finalPrice-h.price.finalPrice*(g.offer.discountAmount||0)/100,v.checkout.currencyCode,v.checkout.currencySymbol)),e.createElement("div",{className:m.Actions},g.variants.length>1&&e.createElement(r,{value:h.id,onSelectChange:function(e){var t=g.variants.find((function(t){return t.id===e}));t&&C(t)},options:g.variants.map((function(e){return{label:e.variantValues.map((function(e){return e.name})).join(", "),value:e.id}}))}),e.createElement(a,{style:{width:"100%",height:44,fontSize:14},text:E("checkout-page:actions.addToCart"),onClick:function(){v.updateCartCampaignOffer({accepted:!0,cartId:v.checkout.id,campaignOfferId:g.campaignOffer.campaignOfferId,campaignOfferProductId:g.offer.id,productId:g.offer.productId,variantId:h.id})}}))))))}));export{l as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/storefront",
|
|
3
|
-
"version": "4.7.0-beta.
|
|
3
|
+
"version": "4.7.0-beta.4",
|
|
4
4
|
"description": "Storefront functionality for ikas storefront themes.",
|
|
5
5
|
"author": "ikas",
|
|
6
6
|
"license": "ISC",
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
"build": "rm -rf build && rollup -c"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@ikas/storefront-api": "^4.7.0-beta.
|
|
21
|
-
"@ikas/storefront-config": "^4.7.0-beta.
|
|
22
|
-
"@ikas/storefront-model-functions": "^4.7.0-beta.
|
|
23
|
-
"@ikas/storefront-models": "^4.7.0-beta.
|
|
24
|
-
"@ikas/storefront-providers": "^4.7.0-beta.
|
|
20
|
+
"@ikas/storefront-api": "^4.7.0-beta.4",
|
|
21
|
+
"@ikas/storefront-config": "^4.7.0-beta.4",
|
|
22
|
+
"@ikas/storefront-model-functions": "^4.7.0-beta.4",
|
|
23
|
+
"@ikas/storefront-models": "^4.7.0-beta.4",
|
|
24
|
+
"@ikas/storefront-providers": "^4.7.0-beta.4",
|
|
25
25
|
"@ikas/localized-address": "^1.0.0-beta.3",
|
|
26
26
|
"@adyen/adyen-web": "^5.28.2",
|
|
27
27
|
"@rollup/plugin-commonjs": "^22.0.0",
|
|
@@ -55,11 +55,11 @@
|
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"@ikas/localized-address": "^1.0.0-beta.3",
|
|
58
|
-
"@ikas/storefront-api": "^4.7.0-beta.
|
|
59
|
-
"@ikas/storefront-config": "^4.7.0-beta.
|
|
60
|
-
"@ikas/storefront-model-functions": "^4.7.0-beta.
|
|
61
|
-
"@ikas/storefront-models": "^4.7.0-beta.
|
|
62
|
-
"@ikas/storefront-providers": "^4.7.0-beta.
|
|
58
|
+
"@ikas/storefront-api": "^4.7.0-beta.4",
|
|
59
|
+
"@ikas/storefront-config": "^4.7.0-beta.4",
|
|
60
|
+
"@ikas/storefront-model-functions": "^4.7.0-beta.4",
|
|
61
|
+
"@ikas/storefront-models": "^4.7.0-beta.4",
|
|
62
|
+
"@ikas/storefront-providers": "^4.7.0-beta.4",
|
|
63
63
|
"mobx": "^6.1.3",
|
|
64
64
|
"mobx-react-lite": "^3.1.5",
|
|
65
65
|
"next": "12.2.0",
|