@treely/strapi-slices 5.10.0 → 5.11.0
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/dist/rootMessages.de.d.ts +2 -0
- package/dist/rootMessages.en.d.ts +2 -0
- package/dist/slices/ShopCheckout/ShopCheckout.d.ts +1 -0
- package/dist/slices/ShopCheckout/ShopCheckout.stories.d.ts +1 -0
- package/dist/slices/ShopCheckout/messages.de.d.ts +2 -0
- package/dist/slices/ShopCheckout/messages.en.d.ts +2 -0
- package/dist/strapi-slices.cjs.development.js +21 -3
- package/dist/strapi-slices.cjs.development.js.map +1 -1
- package/dist/strapi-slices.cjs.production.min.js +1 -1
- package/dist/strapi-slices.cjs.production.min.js.map +1 -1
- package/dist/strapi-slices.esm.js +21 -3
- package/dist/strapi-slices.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/slices/ShopCheckout/ShopCheckout.stories.tsx +13 -0
- package/src/slices/ShopCheckout/ShopCheckout.test.tsx +7 -0
- package/src/slices/ShopCheckout/ShopCheckout.tsx +92 -62
- package/src/slices/ShopCheckout/messages.de.ts +3 -0
- package/src/slices/ShopCheckout/messages.en.ts +3 -0
|
@@ -2250,6 +2250,8 @@ var messagesDe$3 = {
|
|
|
2250
2250
|
'sections.shopCheckout.contributionValue.validation.tooHigh': 'Für größere Einkäufe kontaktieren Sie bitte unser Verkaufsteam über office@tree.ly',
|
|
2251
2251
|
'sections.shopCheckout.summary.kg': 'Menge',
|
|
2252
2252
|
'sections.shopCheckout.summary.price': 'Preis',
|
|
2253
|
+
'sections.shopCheckout.summary.taxNotIncluded': 'ohne Steuern',
|
|
2254
|
+
'sections.shopCheckout.summary.taxIncluded': 'Preis inklusive Steuern: {number}',
|
|
2253
2255
|
'sections.shopCheckout.submit': 'Kaufen'
|
|
2254
2256
|
};
|
|
2255
2257
|
|
|
@@ -2367,6 +2369,8 @@ var messagesEn$1 = {
|
|
|
2367
2369
|
'sections.shopCheckout.contributionValue.validation.tooHigh': 'For bigger purchases please contact our sales team via office@tree.ly',
|
|
2368
2370
|
'sections.shopCheckout.summary.kg': 'Quantity',
|
|
2369
2371
|
'sections.shopCheckout.summary.price': 'Price',
|
|
2372
|
+
'sections.shopCheckout.summary.price.taxNotIncluded': 'not including tax',
|
|
2373
|
+
'sections.shopCheckout.summary.price.taxIncluded': 'Price including tax: {number}',
|
|
2370
2374
|
'sections.shopCheckout.submit': 'Checkout'
|
|
2371
2375
|
};
|
|
2372
2376
|
|
|
@@ -4036,7 +4040,10 @@ var ShopCheckout = function ShopCheckout(_ref) {
|
|
|
4036
4040
|
}) + "/" + formatNumber(100, {
|
|
4037
4041
|
style: 'unit',
|
|
4038
4042
|
unit: 'kilogram'
|
|
4039
|
-
}) + " CO\u2082"
|
|
4043
|
+
}) + " CO\u2082",
|
|
4044
|
+
caption: formatMessage({
|
|
4045
|
+
id: 'sections.shopCheckout.summary.price.taxNotIncluded'
|
|
4046
|
+
})
|
|
4040
4047
|
}), React.createElement(Spacer, {
|
|
4041
4048
|
height: "6"
|
|
4042
4049
|
}), React.createElement(Divider, null), React.createElement(Spacer, {
|
|
@@ -4052,6 +4059,7 @@ var ShopCheckout = function ShopCheckout(_ref) {
|
|
|
4052
4059
|
touched = _ref3.touched,
|
|
4053
4060
|
handleSubmit = _ref3.handleSubmit,
|
|
4054
4061
|
values = _ref3.values;
|
|
4062
|
+
var summaryPrice = Math.floor(values.contributionValue / slice.pricePerKg) * slice.pricePerKg;
|
|
4055
4063
|
return React.createElement(Form, {
|
|
4056
4064
|
onSubmit: handleSubmit
|
|
4057
4065
|
}, React.createElement(Box, {
|
|
@@ -4095,12 +4103,22 @@ var ShopCheckout = function ShopCheckout(_ref) {
|
|
|
4095
4103
|
label: formatMessage({
|
|
4096
4104
|
id: 'sections.shopCheckout.summary.price'
|
|
4097
4105
|
}),
|
|
4098
|
-
number: formatNumber(
|
|
4106
|
+
number: formatNumber(summaryPrice, {
|
|
4099
4107
|
style: 'currency',
|
|
4100
4108
|
currency: slice.currency,
|
|
4101
4109
|
minimumFractionDigits: 2,
|
|
4102
4110
|
maximumFractionDigits: 2
|
|
4103
|
-
})
|
|
4111
|
+
}),
|
|
4112
|
+
caption: slice.taxInPercent && slice.taxInPercent > 0 && summaryPrice > 0 ? formatMessage({
|
|
4113
|
+
id: 'sections.shopCheckout.summary.price.taxIncluded'
|
|
4114
|
+
}, {
|
|
4115
|
+
number: formatNumber(summaryPrice + summaryPrice * (slice.taxInPercent / 100), {
|
|
4116
|
+
style: 'currency',
|
|
4117
|
+
currency: slice.currency,
|
|
4118
|
+
minimumFractionDigits: 2,
|
|
4119
|
+
maximumFractionDigits: 2
|
|
4120
|
+
})
|
|
4121
|
+
}) : ''
|
|
4104
4122
|
})), React.createElement(Spacer, {
|
|
4105
4123
|
height: "6"
|
|
4106
4124
|
}), React.createElement(Button, {
|