@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
|
@@ -16,6 +16,8 @@ declare const rootMessagesDe: {
|
|
|
16
16
|
'sections.shopCheckout.contributionValue.validation.tooHigh': string;
|
|
17
17
|
'sections.shopCheckout.summary.kg': string;
|
|
18
18
|
'sections.shopCheckout.summary.price': string;
|
|
19
|
+
'sections.shopCheckout.summary.taxNotIncluded': string;
|
|
20
|
+
'sections.shopCheckout.summary.taxIncluded': string;
|
|
19
21
|
'sections.shopCheckout.submit': string;
|
|
20
22
|
'sections.projectsMap.link.text': string;
|
|
21
23
|
'sections.projectFacts.projectInfo.value': string;
|
|
@@ -16,6 +16,8 @@ declare const rootMessagesEn: {
|
|
|
16
16
|
'sections.shopCheckout.contributionValue.validation.tooHigh': string;
|
|
17
17
|
'sections.shopCheckout.summary.kg': string;
|
|
18
18
|
'sections.shopCheckout.summary.price': string;
|
|
19
|
+
'sections.shopCheckout.summary.price.taxNotIncluded': string;
|
|
20
|
+
'sections.shopCheckout.summary.price.taxIncluded': string;
|
|
19
21
|
'sections.shopCheckout.submit': string;
|
|
20
22
|
'sections.projectsMap.link.text': string;
|
|
21
23
|
'sections.projectFacts.projectInfo.value': string;
|
|
@@ -5,3 +5,4 @@ export declare const WithTagline: import("@storybook/types").AnnotatedStoryFn<im
|
|
|
5
5
|
export declare const WithText: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, import("./ShopCheckout").ShopCheckoutProps>;
|
|
6
6
|
export declare const WithBadge: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, import("./ShopCheckout").ShopCheckoutProps>;
|
|
7
7
|
export declare const WithCHF: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, import("./ShopCheckout").ShopCheckoutProps>;
|
|
8
|
+
export declare const WithTaxMessage: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, import("./ShopCheckout").ShopCheckoutProps>;
|
|
@@ -10,6 +10,8 @@ declare const messagesDe: {
|
|
|
10
10
|
'sections.shopCheckout.contributionValue.validation.tooHigh': string;
|
|
11
11
|
'sections.shopCheckout.summary.kg': string;
|
|
12
12
|
'sections.shopCheckout.summary.price': string;
|
|
13
|
+
'sections.shopCheckout.summary.taxNotIncluded': string;
|
|
14
|
+
'sections.shopCheckout.summary.taxIncluded': string;
|
|
13
15
|
'sections.shopCheckout.submit': string;
|
|
14
16
|
};
|
|
15
17
|
export default messagesDe;
|
|
@@ -10,6 +10,8 @@ declare const messagesEn: {
|
|
|
10
10
|
'sections.shopCheckout.contributionValue.validation.tooHigh': string;
|
|
11
11
|
'sections.shopCheckout.summary.kg': string;
|
|
12
12
|
'sections.shopCheckout.summary.price': string;
|
|
13
|
+
'sections.shopCheckout.summary.price.taxNotIncluded': string;
|
|
14
|
+
'sections.shopCheckout.summary.price.taxIncluded': string;
|
|
13
15
|
'sections.shopCheckout.submit': string;
|
|
14
16
|
};
|
|
15
17
|
export default messagesEn;
|
|
@@ -2265,6 +2265,8 @@ var messagesDe$3 = {
|
|
|
2265
2265
|
'sections.shopCheckout.contributionValue.validation.tooHigh': 'Für größere Einkäufe kontaktieren Sie bitte unser Verkaufsteam über office@tree.ly',
|
|
2266
2266
|
'sections.shopCheckout.summary.kg': 'Menge',
|
|
2267
2267
|
'sections.shopCheckout.summary.price': 'Preis',
|
|
2268
|
+
'sections.shopCheckout.summary.taxNotIncluded': 'ohne Steuern',
|
|
2269
|
+
'sections.shopCheckout.summary.taxIncluded': 'Preis inklusive Steuern: {number}',
|
|
2268
2270
|
'sections.shopCheckout.submit': 'Kaufen'
|
|
2269
2271
|
};
|
|
2270
2272
|
|
|
@@ -2382,6 +2384,8 @@ var messagesEn$1 = {
|
|
|
2382
2384
|
'sections.shopCheckout.contributionValue.validation.tooHigh': 'For bigger purchases please contact our sales team via office@tree.ly',
|
|
2383
2385
|
'sections.shopCheckout.summary.kg': 'Quantity',
|
|
2384
2386
|
'sections.shopCheckout.summary.price': 'Price',
|
|
2387
|
+
'sections.shopCheckout.summary.price.taxNotIncluded': 'not including tax',
|
|
2388
|
+
'sections.shopCheckout.summary.price.taxIncluded': 'Price including tax: {number}',
|
|
2385
2389
|
'sections.shopCheckout.submit': 'Checkout'
|
|
2386
2390
|
};
|
|
2387
2391
|
|
|
@@ -4051,7 +4055,10 @@ var ShopCheckout = function ShopCheckout(_ref) {
|
|
|
4051
4055
|
}) + "/" + formatNumber(100, {
|
|
4052
4056
|
style: 'unit',
|
|
4053
4057
|
unit: 'kilogram'
|
|
4054
|
-
}) + " CO\u2082"
|
|
4058
|
+
}) + " CO\u2082",
|
|
4059
|
+
caption: formatMessage({
|
|
4060
|
+
id: 'sections.shopCheckout.summary.price.taxNotIncluded'
|
|
4061
|
+
})
|
|
4055
4062
|
}), React__default.default.createElement(boemly.Spacer, {
|
|
4056
4063
|
height: "6"
|
|
4057
4064
|
}), React__default.default.createElement(boemly.Divider, null), React__default.default.createElement(boemly.Spacer, {
|
|
@@ -4067,6 +4074,7 @@ var ShopCheckout = function ShopCheckout(_ref) {
|
|
|
4067
4074
|
touched = _ref3.touched,
|
|
4068
4075
|
handleSubmit = _ref3.handleSubmit,
|
|
4069
4076
|
values = _ref3.values;
|
|
4077
|
+
var summaryPrice = Math.floor(values.contributionValue / slice.pricePerKg) * slice.pricePerKg;
|
|
4070
4078
|
return React__default.default.createElement(formik.Form, {
|
|
4071
4079
|
onSubmit: handleSubmit
|
|
4072
4080
|
}, React__default.default.createElement(boemly.Box, {
|
|
@@ -4110,12 +4118,22 @@ var ShopCheckout = function ShopCheckout(_ref) {
|
|
|
4110
4118
|
label: formatMessage({
|
|
4111
4119
|
id: 'sections.shopCheckout.summary.price'
|
|
4112
4120
|
}),
|
|
4113
|
-
number: formatNumber(
|
|
4121
|
+
number: formatNumber(summaryPrice, {
|
|
4114
4122
|
style: 'currency',
|
|
4115
4123
|
currency: slice.currency,
|
|
4116
4124
|
minimumFractionDigits: 2,
|
|
4117
4125
|
maximumFractionDigits: 2
|
|
4118
|
-
})
|
|
4126
|
+
}),
|
|
4127
|
+
caption: slice.taxInPercent && slice.taxInPercent > 0 && summaryPrice > 0 ? formatMessage({
|
|
4128
|
+
id: 'sections.shopCheckout.summary.price.taxIncluded'
|
|
4129
|
+
}, {
|
|
4130
|
+
number: formatNumber(summaryPrice + summaryPrice * (slice.taxInPercent / 100), {
|
|
4131
|
+
style: 'currency',
|
|
4132
|
+
currency: slice.currency,
|
|
4133
|
+
minimumFractionDigits: 2,
|
|
4134
|
+
maximumFractionDigits: 2
|
|
4135
|
+
})
|
|
4136
|
+
}) : ''
|
|
4119
4137
|
})), React__default.default.createElement(boemly.Spacer, {
|
|
4120
4138
|
height: "6"
|
|
4121
4139
|
}), React__default.default.createElement(boemly.Button, {
|