@treely/strapi-slices 5.9.0 → 5.10.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.
@@ -4,11 +4,12 @@ export interface SmallCheckoutProps {
4
4
  batchId: string;
5
5
  pricePerKg: number;
6
6
  initialContributionValue: number;
7
+ taxInPercent?: number;
7
8
  checkoutText?: string;
8
9
  currency: 'EUR' | 'CHF';
9
10
  title?: string;
10
11
  subtitle?: string;
11
12
  button?: StrapiLink;
12
13
  }
13
- declare const SmallCheckout: ({ pricePerKg, currency, batchId, initialContributionValue, checkoutText, title, subtitle, button, }: SmallCheckoutProps) => React.JSX.Element;
14
+ declare const SmallCheckout: ({ pricePerKg, currency, batchId, initialContributionValue, taxInPercent, checkoutText, title, subtitle, button, }: SmallCheckoutProps) => React.JSX.Element;
14
15
  export default SmallCheckout;
@@ -1,4 +1,6 @@
1
1
  declare const messagesDe: {
2
+ 'portfolio.smallCheckout.price.taxNotIncluded': string;
3
+ 'portfolio.smallCheckout.price.taxIncluded': string;
2
4
  'portfolio.smallCheckout.contributionValueCurrency.label.CHF': string;
3
5
  'portfolio.smallCheckout.contributionValueCurrency.label.EUR': string;
4
6
  'portfolio.smallCheckout.contributionValueCurrency.unit.EUR': string;
@@ -1,4 +1,6 @@
1
1
  declare const messagesEn: {
2
+ 'portfolio.smallCheckout.price.taxNotIncluded': string;
3
+ 'portfolio.smallCheckout.price.taxIncluded': string;
2
4
  'portfolio.smallCheckout.contributionValueCurrency.label.CHF': string;
3
5
  'portfolio.smallCheckout.contributionValueCurrency.label.EUR': string;
4
6
  'portfolio.smallCheckout.contributionValueCurrency.unit.EUR': string;
@@ -28,6 +28,8 @@ declare const rootMessagesDe: {
28
28
  'sections.cta.backgroundShapes': string;
29
29
  'sections.cta.backgroundShapesLight': string;
30
30
  'sections.comparison.backgroundShapes': string;
31
+ 'portfolio.smallCheckout.price.taxNotIncluded': string;
32
+ 'portfolio.smallCheckout.price.taxIncluded': string;
31
33
  'portfolio.smallCheckout.contributionValueCurrency.label.CHF': string;
32
34
  'portfolio.smallCheckout.contributionValueCurrency.label.EUR': string;
33
35
  'portfolio.smallCheckout.contributionValueCurrency.unit.EUR': string;
@@ -28,6 +28,8 @@ declare const rootMessagesEn: {
28
28
  'sections.cta.backgroundShapesDark': string;
29
29
  'sections.cta.backgroundShapesLight': string;
30
30
  'sections.comparison.backgroundShapes': string;
31
+ 'portfolio.smallCheckout.price.taxNotIncluded': string;
32
+ 'portfolio.smallCheckout.price.taxIncluded': string;
31
33
  'portfolio.smallCheckout.contributionValueCurrency.label.CHF': string;
32
34
  'portfolio.smallCheckout.contributionValueCurrency.label.EUR': string;
33
35
  'portfolio.smallCheckout.contributionValueCurrency.unit.EUR': string;
@@ -9,6 +9,7 @@ export interface ProjectFactsProps {
9
9
  batchId?: string;
10
10
  currency?: 'EUR' | 'CHF';
11
11
  pricePerKg?: number;
12
+ taxInPercent?: number;
12
13
  initialContributionValue?: number;
13
14
  checkoutText?: string;
14
15
  customTitle?: string;
@@ -2236,6 +2236,8 @@ var messagesDe$5 = {
2236
2236
  };
2237
2237
 
2238
2238
  var messagesDe$4 = {
2239
+ 'portfolio.smallCheckout.price.taxNotIncluded': 'ohne Steuern',
2240
+ 'portfolio.smallCheckout.price.taxIncluded': 'Preis inklusive Steuern: {number}',
2239
2241
  'portfolio.smallCheckout.contributionValueCurrency.label.CHF': 'Geben Sie den Beitrag in Fr. ein',
2240
2242
  'portfolio.smallCheckout.contributionValueCurrency.label.EUR': 'Geben Sie den Beitrag in € ein',
2241
2243
  'portfolio.smallCheckout.contributionValueCurrency.unit.EUR': '€',
@@ -2351,6 +2353,8 @@ var messagesEn$3 = {
2351
2353
  };
2352
2354
 
2353
2355
  var messagesEn$2 = {
2356
+ 'portfolio.smallCheckout.price.taxNotIncluded': 'not including tax',
2357
+ 'portfolio.smallCheckout.price.taxIncluded': 'Price including tax: {number}',
2354
2358
  'portfolio.smallCheckout.contributionValueCurrency.label.CHF': 'Contribution Amount in CHF',
2355
2359
  'portfolio.smallCheckout.contributionValueCurrency.label.EUR': 'Contribution Amount in €',
2356
2360
  'portfolio.smallCheckout.contributionValueCurrency.unit.EUR': '€',
@@ -4341,6 +4345,7 @@ var SmallCheckout = function SmallCheckout(_ref) {
4341
4345
  currency = _ref.currency,
4342
4346
  batchId = _ref.batchId,
4343
4347
  initialContributionValue = _ref.initialContributionValue,
4348
+ taxInPercent = _ref.taxInPercent,
4344
4349
  checkoutText = _ref.checkoutText,
4345
4350
  title = _ref.title,
4346
4351
  subtitle = _ref.subtitle,
@@ -4351,6 +4356,9 @@ var SmallCheckout = function SmallCheckout(_ref) {
4351
4356
  locale = _useContext.locale;
4352
4357
  var _useRouter = router.useRouter(),
4353
4358
  push = _useRouter.push;
4359
+ var _useState = React.useState(initialContributionValue),
4360
+ contributionValue = _useState[0],
4361
+ setContributionValue = _useState[1];
4354
4362
  var validateForm = React.useCallback(function (values) {
4355
4363
  var errors = {};
4356
4364
  var value = parseInt(values.contributionValueCurrency);
@@ -4400,7 +4408,7 @@ var SmallCheckout = function SmallCheckout(_ref) {
4400
4408
  padding: "6",
4401
4409
  direction: "column"
4402
4410
  }, React__default.default.createElement(boemly.Flex, {
4403
- gap: "1",
4411
+ gap: "2",
4404
4412
  alignItems: "end",
4405
4413
  mb: "6"
4406
4414
  }, React__default.default.createElement(boemly.Text, {
@@ -4418,6 +4426,10 @@ var SmallCheckout = function SmallCheckout(_ref) {
4418
4426
  currency: currency,
4419
4427
  maximumFractionDigits: 0
4420
4428
  }))
4429
+ })), React__default.default.createElement(boemly.Text, {
4430
+ size: "smLowNormal"
4431
+ }, React__default.default.createElement(reactIntl.FormattedMessage, {
4432
+ id: "portfolio.smallCheckout.price.taxNotIncluded"
4421
4433
  }))), React__default.default.createElement(formik.Formik, {
4422
4434
  initialValues: {
4423
4435
  contributionValueCurrency: initialContributionValue.toString(),
@@ -4448,6 +4460,7 @@ var SmallCheckout = function SmallCheckout(_ref) {
4448
4460
  value: field.value || '',
4449
4461
  onChange: function onChange(e) {
4450
4462
  var value = e.target.valueAsNumber;
4463
+ setContributionValue(value);
4451
4464
  setValues({
4452
4465
  contributionValueCurrency: value.toString(),
4453
4466
  contributionValueKgs: (value / pricePerKg / 1000).toString()
@@ -4494,7 +4507,18 @@ var SmallCheckout = function SmallCheckout(_ref) {
4494
4507
  isInvalid: !!errors.contributionValueKgs && touched.contributionValueKgs,
4495
4508
  errorMessage: errors.contributionValueKgs
4496
4509
  });
4497
- }))), React__default.default.createElement(boemly.Spacer, {
4510
+ }))), contributionValue > 0 && taxInPercent && taxInPercent > 0 && React__default.default.createElement(boemly.Text, {
4511
+ size: "smLowNormal",
4512
+ mt: "2"
4513
+ }, formatMessage({
4514
+ id: 'portfolio.smallCheckout.price.taxIncluded'
4515
+ }, {
4516
+ number: formatNumber(contributionValue + contributionValue * taxInPercent / 100, {
4517
+ style: 'currency',
4518
+ currency: currency,
4519
+ maximumFractionDigits: 2
4520
+ })
4521
+ })), React__default.default.createElement(boemly.Spacer, {
4498
4522
  height: "4"
4499
4523
  }), React__default.default.createElement(boemly.Button, {
4500
4524
  type: "submit",
@@ -4812,7 +4836,8 @@ var ProjectFacts = function ProjectFacts(_ref) {
4812
4836
  pricePerKg: slice.pricePerKg,
4813
4837
  title: slice.customTitle,
4814
4838
  subtitle: slice.customSubtitle,
4815
- button: slice.customButton
4839
+ button: slice.customButton,
4840
+ taxInPercent: slice.taxInPercent
4816
4841
  }) : (slice.contactTitle || slice.contactText || slice.contactButton || slice.contactAvatar) && React__default.default.createElement(Contact, {
4817
4842
  title: slice.contactTitle,
4818
4843
  text: slice.contactText,