@ikas/storefront 4.2.0-beta.8 → 4.2.0-beta.9
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 c}from"../../../../utils/i18n.js";import{formatCurrency as i}from"../../../../utils/currency.js";import o from"./style.module.scss.js";var m=function(t){var a=t.seconds,r=t.rejectOffer,n=c().t,i=e.useState(a),m=i[0],d=i[1];e.useEffect((function(){var e=m>0&&setInterval((function(){return d(m-1)}),1e3);return 0===m&&r(),function(){return clearInterval(e)}}),[m]);return e.createElement("div",{className:o.CountdownContainer},e.createElement("div",{className:o.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")}(m)})))},d=t((function(t){var d,s
|
|
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 c}from"../../../../utils/i18n.js";import{formatCurrency as i}from"../../../../utils/currency.js";import o from"./style.module.scss.js";var m=function(t){var a=t.seconds,r=t.rejectOffer,n=c().t,i=e.useState(a),m=i[0],d=i[1];e.useEffect((function(){var e=m>0&&setInterval((function(){return d(m-1)}),1e3);return 0===m&&r(),function(){return clearInterval(e)}}),[m]);return e.createElement("div",{className:o.CountdownContainer},e.createElement("div",{className:o.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")}(m)})))},d=t((function(t){var d,f,s=t.vm,u=t.campaignOffer,l=c().t,p=e.useState(u.variants[0]),v=p[0],g=p[1],E=function(){s.updateCartCampaignOffer({accepted:!1,cartId:s.checkout.id,campaignOfferId:u.campaignOffer.campaignOfferId,campaignOfferProductId:u.offer.id,productId:u.offer.productId,variantId:v.id})},I=Math.round(((new Date).getTime()-new Date(u.campaignOffer.offerStartDate).getTime())/1e3);return e.createElement("div",{className:o.Container},u.offer.countdownMinutes&&e.createElement(m,{seconds:I>60*u.offer.countdownMinutes?0:60*u.offer.countdownMinutes-I,rejectOffer:E}),e.createElement("div",{className:o.ContentContainer},e.createElement("div",{className:o.Header},e.createElement("div",{className:o.Title},u.offer.title),e.createElement("div",{className:o.RejectButton,onClick:E},e.createElement(n,null))),e.createElement("div",{className:o.ProductContainer},e.createElement("div",{className:o.ImageContainer},e.createElement("img",{className:o.Image,src:null===(f=null===(d=v.mainImage)||void 0===d?void 0:d.image)||void 0===f?void 0:f.thumbnailSrc})),e.createElement("div",{className:o.ProductDetails},e.createElement("div",{className:o.ProductName},u.product.name),u.product.hasVariant&&1===u.variants.length&&e.createElement("div",{className:o.VariantName},v.variantValues.map((function(e){return e.name})).join(", ")),u.product.brand&&e.createElement("div",{className:o.Brand},u.product.brand.name),e.createElement("div",{className:o.ProductPrice},0!==u.offer.discountAmount&&e.createElement("span",{className:o.Discount},v.price.formattedFinalPrice," "),i(v.price.finalPrice-v.price.finalPrice*(u.offer.discountAmount||0)/100,s.checkout.currencyCode,s.checkout.currencySymbol)),e.createElement("div",{className:o.Actions},u.variants.length>1&&e.createElement(r,{value:v.id,onSelectChange:function(e){var t=u.variants.find((function(t){return t.id===e}));t&&g(t)},options:u.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:l("checkout-page:actions.addToCart"),onClick:function(){s.updateCartCampaignOffer({accepted:!0,cartId:s.checkout.id,campaignOfferId:u.campaignOffer.campaignOfferId,campaignOfferProductId:u.offer.id,productId:u.offer.productId,variantId:v.id})}}))))))}));export{d as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/storefront",
|
|
3
|
-
"version": "4.2.0-beta.
|
|
3
|
+
"version": "4.2.0-beta.9",
|
|
4
4
|
"description": "Storefront functionality for ikas storefront themes.",
|
|
5
5
|
"author": "ikas",
|
|
6
6
|
"license": "ISC",
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@ikas/storefront-api": "^4.2.0-beta.
|
|
22
|
-
"@ikas/storefront-config": "^4.2.0-beta.
|
|
23
|
-
"@ikas/storefront-model-functions": "^4.2.0-beta.
|
|
24
|
-
"@ikas/storefront-models": "^4.2.0-beta.
|
|
25
|
-
"@ikas/storefront-providers": "^4.2.0-beta.
|
|
21
|
+
"@ikas/storefront-api": "^4.2.0-beta.9",
|
|
22
|
+
"@ikas/storefront-config": "^4.2.0-beta.9",
|
|
23
|
+
"@ikas/storefront-model-functions": "^4.2.0-beta.9",
|
|
24
|
+
"@ikas/storefront-models": "^4.2.0-beta.9",
|
|
25
|
+
"@ikas/storefront-providers": "^4.2.0-beta.9",
|
|
26
26
|
"@rollup/plugin-commonjs": "^22.0.0",
|
|
27
27
|
"@rollup/plugin-json": "^4.1.0",
|
|
28
28
|
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
"libphonenumber-js": "^1.10.6"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@ikas/storefront-api": "^4.2.0-beta.
|
|
56
|
-
"@ikas/storefront-config": "^4.2.0-beta.
|
|
57
|
-
"@ikas/storefront-model-functions": "^4.2.0-beta.
|
|
58
|
-
"@ikas/storefront-models": "^4.2.0-beta.
|
|
59
|
-
"@ikas/storefront-providers": "^4.2.0-beta.
|
|
55
|
+
"@ikas/storefront-api": "^4.2.0-beta.9",
|
|
56
|
+
"@ikas/storefront-config": "^4.2.0-beta.9",
|
|
57
|
+
"@ikas/storefront-model-functions": "^4.2.0-beta.9",
|
|
58
|
+
"@ikas/storefront-models": "^4.2.0-beta.9",
|
|
59
|
+
"@ikas/storefront-providers": "^4.2.0-beta.9",
|
|
60
60
|
"mobx": "^6.1.3",
|
|
61
61
|
"mobx-react-lite": "^3.1.5",
|
|
62
62
|
"next": "12.2.0",
|