@treely/strapi-slices 1.0.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/LICENSE +21 -0
- package/README.md +5 -0
- package/dist/components/CreditsAvailableBadge/CreditsAvailableBadge.d.ts +7 -0
- package/dist/components/CreditsAvailableBadge/index.d.ts +2 -0
- package/dist/components/CreditsAvailableBadge/messages.de.d.ts +7 -0
- package/dist/components/CreditsAvailableBadge/messages.en.d.ts +7 -0
- package/dist/components/FullScreenImage/FullScreenImage.d.ts +8 -0
- package/dist/components/FullScreenImage/ZoomableImage.d.ts +7 -0
- package/dist/components/FullScreenImage/index.d.ts +2 -0
- package/dist/components/MinimalProviders/MinimalProviders.d.ts +7 -0
- package/dist/components/MinimalProviders/index.d.ts +2 -0
- package/dist/components/SliceRenderer/SliceRenderer.d.ts +12 -0
- package/dist/components/SliceRenderer/index.d.ts +2 -0
- package/dist/components/StrapiLinkButton/StrapiLinkButton.d.ts +18 -0
- package/dist/components/StrapiLinkButton/index.d.ts +2 -0
- package/dist/components/StrapiLinkButtonWithIcon/StrapiLinkButtonWithIcon.d.ts +7 -0
- package/dist/components/StrapiLinkButtonWithIcon/index.d.ts +2 -0
- package/dist/components/portfolio/Contact/Contact.d.ts +10 -0
- package/dist/components/portfolio/Contact/index.d.ts +2 -0
- package/dist/components/portfolio/DocumentsDownloadList/DocumentsDownloadList.d.ts +6 -0
- package/dist/components/portfolio/DocumentsDownloadList/index.d.ts +2 -0
- package/dist/components/portfolio/DocumentsDownloadList/messages.de.d.ts +5 -0
- package/dist/components/portfolio/DocumentsDownloadList/messages.en.d.ts +5 -0
- package/dist/components/portfolio/ProjectInfo/ProjectInfo.d.ts +18 -0
- package/dist/components/portfolio/ProjectInfo/index.d.ts +2 -0
- package/dist/components/portfolio/ProjectInfo/messages.de.d.ts +15 -0
- package/dist/components/portfolio/ProjectInfo/messages.en.d.ts +15 -0
- package/dist/components/portfolio/SmallCheckout/SmallCheckout.d.ts +13 -0
- package/dist/components/portfolio/SmallCheckout/index.d.ts +2 -0
- package/dist/components/portfolio/SmallCheckout/messages.de.d.ts +16 -0
- package/dist/components/portfolio/SmallCheckout/messages.en.d.ts +16 -0
- package/dist/constants/animations.d.ts +1 -0
- package/dist/constants/api.d.ts +3 -0
- package/dist/constants/breakpoints.d.ts +8 -0
- package/dist/constants/domain.d.ts +2 -0
- package/dist/constants/fontCustomizations.d.ts +6 -0
- package/dist/constants/formatter.d.ts +6 -0
- package/dist/constants/globalStyle.d.ts +1 -0
- package/dist/constants/mapbox.d.ts +17 -0
- package/dist/constants/strapi.d.ts +1 -0
- package/dist/icons/LinkedInIcon.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +8 -0
- package/dist/models/BBox.d.ts +2 -0
- package/dist/models/CreditsAvailableState.d.ts +7 -0
- package/dist/models/Locale.d.ts +2 -0
- package/dist/models/PortfolioProject.d.ts +7 -0
- package/dist/models/forms/CheckoutForm.d.ts +4 -0
- package/dist/models/fpm/FPMProject.d.ts +37 -0
- package/dist/models/fpm/Issuer.d.ts +6 -0
- package/dist/models/strapi/IStrapi.d.ts +4 -0
- package/dist/models/strapi/IStrapiData.d.ts +5 -0
- package/dist/models/strapi/IStrapiResponse.d.ts +13 -0
- package/dist/models/strapi/StrapiAuthor.d.ts +10 -0
- package/dist/models/strapi/StrapiAvatarWithName.d.ts +8 -0
- package/dist/models/strapi/StrapiBanner.d.ts +9 -0
- package/dist/models/strapi/StrapiBlogPost.d.ts +25 -0
- package/dist/models/strapi/StrapiButtonWithVariant.d.ts +6 -0
- package/dist/models/strapi/StrapiCategory.d.ts +8 -0
- package/dist/models/strapi/StrapiContactArea.d.ts +10 -0
- package/dist/models/strapi/StrapiCustomerStory.d.ts +21 -0
- package/dist/models/strapi/StrapiDefaultHeader.d.ts +6 -0
- package/dist/models/strapi/StrapiGlobal.d.ts +26 -0
- package/dist/models/strapi/StrapiGlossaryItem.d.ts +6 -0
- package/dist/models/strapi/StrapiHeroCard.d.ts +13 -0
- package/dist/models/strapi/StrapiImage.d.ts +10 -0
- package/dist/models/strapi/StrapiImageFormat.d.ts +12 -0
- package/dist/models/strapi/StrapiImageWithLink.d.ts +6 -0
- package/dist/models/strapi/StrapiLink.d.ts +11 -0
- package/dist/models/strapi/StrapiLinkList.d.ts +7 -0
- package/dist/models/strapi/StrapiLinkPage.d.ts +10 -0
- package/dist/models/strapi/StrapiLinkWithIcon.d.ts +7 -0
- package/dist/models/strapi/StrapiLocalization.d.ts +7 -0
- package/dist/models/strapi/StrapiMedia.d.ts +27 -0
- package/dist/models/strapi/StrapiMetadata.d.ts +13 -0
- package/dist/models/strapi/StrapiNavMenu.d.ts +13 -0
- package/dist/models/strapi/StrapiPage.d.ts +17 -0
- package/dist/models/strapi/StrapiPortfolio.d.ts +10 -0
- package/dist/models/strapi/StrapiPortfolioCard.d.ts +15 -0
- package/dist/models/strapi/StrapiProject.d.ts +23 -0
- package/dist/models/strapi/StrapiProjectCard.d.ts +18 -0
- package/dist/models/strapi/StrapiQuoteCard.d.ts +7 -0
- package/dist/models/strapi/StrapiShapesCard.d.ts +11 -0
- package/dist/models/strapi/StrapiTextCardWithIcons.d.ts +8 -0
- package/dist/models/strapi/StrapiTopBanner.d.ts +7 -0
- package/dist/rootMessages.de.d.ts +58 -0
- package/dist/rootMessages.en.d.ts +58 -0
- package/dist/slices/Blog/Blog.d.ts +10 -0
- package/dist/slices/Blog/index.d.ts +2 -0
- package/dist/slices/Blog/styles.d.ts +9 -0
- package/dist/slices/BlogCards/BlogCards.d.ts +18 -0
- package/dist/slices/BlogCards/BlogCards.stories.d.ts +5 -0
- package/dist/slices/BlogCards/index.d.ts +2 -0
- package/dist/slices/Comparison/Comparison.d.ts +33 -0
- package/dist/slices/Comparison/Comparison.stories.d.ts +6 -0
- package/dist/slices/Comparison/Icon.d.ts +7 -0
- package/dist/slices/Comparison/index.d.ts +2 -0
- package/dist/slices/Comparison/messages.de.d.ts +4 -0
- package/dist/slices/Comparison/messages.en.d.ts +4 -0
- package/dist/slices/Cta/Cta.d.ts +26 -0
- package/dist/slices/Cta/Cta.stories.d.ts +9 -0
- package/dist/slices/Cta/index.d.ts +2 -0
- package/dist/slices/Cta/messages.de.d.ts +5 -0
- package/dist/slices/Cta/messages.en.d.ts +5 -0
- package/dist/slices/CtaOnly/CtaOnly.d.ts +8 -0
- package/dist/slices/CtaOnly/CtaOnly.stories.d.ts +3 -0
- package/dist/slices/CtaOnly/index.d.ts +2 -0
- package/dist/slices/CustomerStories/CustomerStories.d.ts +10 -0
- package/dist/slices/CustomerStories/CustomerStories.stories.d.ts +3 -0
- package/dist/slices/CustomerStories/index.d.ts +2 -0
- package/dist/slices/CustomerStories/messages.de.d.ts +4 -0
- package/dist/slices/CustomerStories/messages.en.d.ts +4 -0
- package/dist/slices/Facts/Facts.d.ts +16 -0
- package/dist/slices/Facts/Facts.stories.d.ts +7 -0
- package/dist/slices/Facts/index.d.ts +2 -0
- package/dist/slices/FullWidthHighlightQuote/FullWidthHighlightQuote.d.ts +10 -0
- package/dist/slices/FullWidthHighlightQuote/FullWidthHighlightQuote.stories.d.ts +4 -0
- package/dist/slices/FullWidthHighlightQuote/index.d.ts +2 -0
- package/dist/slices/FullWidthImage/FullWidthImage.d.ts +11 -0
- package/dist/slices/FullWidthImage/FullWidthImage.stories.d.ts +5 -0
- package/dist/slices/FullWidthImage/index.d.ts +2 -0
- package/dist/slices/FullWidthImage/styles.d.ts +5 -0
- package/dist/slices/FullWidthImageSlider/FullWidthImageSlider.d.ts +12 -0
- package/dist/slices/FullWidthImageSlider/FullWidthImageSlider.stories.d.ts +3 -0
- package/dist/slices/FullWidthImageSlider/index.d.ts +2 -0
- package/dist/slices/FullWidthImageSlider/styles.d.ts +295 -0
- package/dist/slices/FullWidthImageSlider/utils.d.ts +1 -0
- package/dist/slices/Glossary/Glossary.d.ts +9 -0
- package/dist/slices/Glossary/Glossary.stories.d.ts +3 -0
- package/dist/slices/Glossary/index.d.ts +2 -0
- package/dist/slices/Glossary/messages.de.d.ts +6 -0
- package/dist/slices/Glossary/messages.en.d.ts +6 -0
- package/dist/slices/Hero/Hero.d.ts +17 -0
- package/dist/slices/Hero/Hero.stories.d.ts +9 -0
- package/dist/slices/Hero/index.d.ts +2 -0
- package/dist/slices/Hero/styles.d.ts +17 -0
- package/dist/slices/IconGrid/IconGrid.d.ts +18 -0
- package/dist/slices/IconGrid/IconGrid.stories.d.ts +5 -0
- package/dist/slices/IconGrid/index.d.ts +2 -0
- package/dist/slices/IconGrid/styles.d.ts +9 -0
- package/dist/slices/ImageGrid/ImageGrid.d.ts +18 -0
- package/dist/slices/ImageGrid/ImageGrid.stories.d.ts +5 -0
- package/dist/slices/ImageGrid/index.d.ts +2 -0
- package/dist/slices/ImageGrid/styles.d.ts +5 -0
- package/dist/slices/ImageTextSequence/ImageTextSequence.d.ts +19 -0
- package/dist/slices/ImageTextSequence/ImageTextSequence.stories.d.ts +7 -0
- package/dist/slices/ImageTextSequence/index.d.ts +2 -0
- package/dist/slices/ImageTextSequence/styles.d.ts +13 -0
- package/dist/slices/LeftTextRightCard/LeftTextRightCard.d.ts +17 -0
- package/dist/slices/LeftTextRightCard/LeftTextRightCard.stories.d.ts +8 -0
- package/dist/slices/LeftTextRightCard/index.d.ts +2 -0
- package/dist/slices/LinkCardsGrid/LinkCardsGrid.d.ts +18 -0
- package/dist/slices/LinkCardsGrid/LinkCardsGrid.stories.d.ts +5 -0
- package/dist/slices/LinkCardsGrid/index.d.ts +2 -0
- package/dist/slices/LogoGridWithText/LogoGridWithText.d.ts +12 -0
- package/dist/slices/LogoGridWithText/LogoGridWithText.stories.d.ts +6 -0
- package/dist/slices/LogoGridWithText/index.d.ts +2 -0
- package/dist/slices/LogoGridWithText/styles.d.ts +5 -0
- package/dist/slices/MapHero/MapHero.d.ts +15 -0
- package/dist/slices/MapHero/MapHero.stories.d.ts +8 -0
- package/dist/slices/MapHero/index.d.ts +2 -0
- package/dist/slices/MapHero/styles.d.ts +21 -0
- package/dist/slices/ProjectFacts/ProjectFacts.d.ts +34 -0
- package/dist/slices/ProjectFacts/ProjectFacts.stories.d.ts +6 -0
- package/dist/slices/ProjectFacts/index.d.ts +2 -0
- package/dist/slices/ProjectFacts/messages.de.d.ts +5 -0
- package/dist/slices/ProjectFacts/messages.en.d.ts +5 -0
- package/dist/slices/ProjectsGrid/ProjectsGrid.d.ts +8 -0
- package/dist/slices/ProjectsGrid/ProjectsGrid.stories.d.ts +3 -0
- package/dist/slices/ProjectsGrid/index.d.ts +2 -0
- package/dist/slices/ProjectsMap/MapMarker.d.ts +10 -0
- package/dist/slices/ProjectsMap/ProjectsMap.d.ts +17 -0
- package/dist/slices/ProjectsMap/ProjectsMap.stories.d.ts +6 -0
- package/dist/slices/ProjectsMap/index.d.ts +2 -0
- package/dist/slices/ProjectsMap/messages.de.d.ts +4 -0
- package/dist/slices/ProjectsMap/messages.en.d.ts +4 -0
- package/dist/slices/QAndA/QAndA.d.ts +43 -0
- package/dist/slices/QAndA/QAndA.stories.d.ts +7 -0
- package/dist/slices/QAndA/index.d.ts +2 -0
- package/dist/slices/QuoteCards/QuoteCards.d.ts +15 -0
- package/dist/slices/QuoteCards/QuoteCards.stories.d.ts +8 -0
- package/dist/slices/QuoteCards/index.d.ts +2 -0
- package/dist/slices/QuoteCards/styles.d.ts +13 -0
- package/dist/slices/RichTextSection/RichTextSection.d.ts +7 -0
- package/dist/slices/RichTextSection/RichTextSection.stories.d.ts +3 -0
- package/dist/slices/RichTextSection/index.d.ts +2 -0
- package/dist/slices/ShopCheckout/ShopCheckout.d.ts +16 -0
- package/dist/slices/ShopCheckout/ShopCheckout.stories.d.ts +7 -0
- package/dist/slices/ShopCheckout/index.d.ts +2 -0
- package/dist/slices/ShopCheckout/messages.de.d.ts +15 -0
- package/dist/slices/ShopCheckout/messages.en.d.ts +15 -0
- package/dist/slices/SideBySideImages/SideBySideImages.d.ts +12 -0
- package/dist/slices/SideBySideImages/SideBySideImages.stories.d.ts +3 -0
- package/dist/slices/SideBySideImages/index.d.ts +2 -0
- package/dist/slices/SmallHero/SmallHero.d.ts +20 -0
- package/dist/slices/SmallHero/SmallHero.stories.d.ts +11 -0
- package/dist/slices/SmallHero/index.d.ts +2 -0
- package/dist/slices/SmallHero/styles.d.ts +9 -0
- package/dist/slices/Steps/Steps.d.ts +19 -0
- package/dist/slices/Steps/Steps.stories.d.ts +7 -0
- package/dist/slices/Steps/index.d.ts +2 -0
- package/dist/slices/Steps/styles.d.ts +25 -0
- package/dist/slices/TextCardGrid/TextCardGrid.d.ts +20 -0
- package/dist/slices/TextCardGrid/TextCardGrid.stories.d.ts +8 -0
- package/dist/slices/TextCardGrid/index.d.ts +2 -0
- package/dist/slices/TextCarousel/TextCarousel.d.ts +13 -0
- package/dist/slices/TextCarousel/TextCarousel.stories.d.ts +6 -0
- package/dist/slices/TextCarousel/index.d.ts +2 -0
- package/dist/slices/TextCarousel/styles.d.ts +284 -0
- package/dist/slices/TextWithCard/TextWithCard.d.ts +20 -0
- package/dist/slices/TextWithCard/TextWithCard.stories.d.ts +9 -0
- package/dist/slices/TextWithCard/index.d.ts +2 -0
- package/dist/slices/TextWithTextCards/TextWithTextCards.d.ts +15 -0
- package/dist/slices/TextWithTextCards/TextWithTextCards.stories.d.ts +7 -0
- package/dist/slices/TextWithTextCards/index.d.ts +2 -0
- package/dist/slices/TextWithTextCards/styles.d.ts +5 -0
- package/dist/slices/Video/Video.d.ts +10 -0
- package/dist/slices/Video/Video.stories.d.ts +3 -0
- package/dist/slices/Video/index.d.ts +2 -0
- package/dist/strapi-slices.cjs.development.js +39 -0
- package/dist/strapi-slices.cjs.development.js.map +1 -0
- package/dist/strapi-slices.cjs.production.min.js +2 -0
- package/dist/strapi-slices.cjs.production.min.js.map +1 -0
- package/dist/strapi-slices.esm.js +36 -0
- package/dist/strapi-slices.esm.js.map +1 -0
- package/dist/test/defaultMocks/next.d.ts +2 -0
- package/dist/test/integrationMocks/fpmProjectMock.d.ts +3 -0
- package/dist/test/mocks/portfolioProjectMock.d.ts +3 -0
- package/dist/test/setupTests.d.ts +1 -0
- package/dist/test/storybookMocks/storybookMedia.d.ts +1 -0
- package/dist/test/storybookMocks/storybookStrapiMedia.d.ts +8 -0
- package/dist/test/strapiMocks/minimalGlobalData.d.ts +4 -0
- package/dist/test/strapiMocks/strapiAvatarWithName.d.ts +12 -0
- package/dist/test/strapiMocks/strapiBlogPost.d.ts +3 -0
- package/dist/test/strapiMocks/strapiContact.d.ts +2 -0
- package/dist/test/strapiMocks/strapiCustomerStory.d.ts +3 -0
- package/dist/test/strapiMocks/strapiHeroCard.d.ts +2 -0
- package/dist/test/strapiMocks/strapiLinkPage.d.ts +3 -0
- package/dist/test/strapiMocks/strapiMedia.d.ts +3 -0
- package/dist/test/strapiMocks/strapiMetadata.d.ts +2 -0
- package/dist/test/strapiMocks/strapiPage.d.ts +3 -0
- package/dist/test/strapiMocks/strapiPortfolioCard.d.ts +2 -0
- package/dist/test/strapiMocks/strapiPortfolioMock.d.ts +3 -0
- package/dist/test/strapiMocks/strapiProject.d.ts +3 -0
- package/dist/test/strapiMocks/strapiProjectCard.d.ts +2 -0
- package/dist/test/strapiMocks/strapiQuoteCard.d.ts +2 -0
- package/dist/test/testUtils.d.ts +6 -0
- package/dist/unit.messages.de.d.ts +5 -0
- package/dist/unit.messages.en.d.ts +5 -0
- package/dist/utils/convertAreaM2ToHa.d.ts +2 -0
- package/dist/utils/convertCo2AmountKgToTons.d.ts +2 -0
- package/dist/utils/convertToKebabCase.d.ts +2 -0
- package/dist/utils/getTimeSpanInYears.d.ts +2 -0
- package/dist/utils/mergeBoundingBoxes.d.ts +3 -0
- package/dist/utils/mergeDeep.d.ts +12 -0
- package/dist/utils/openHubSpotChat.d.ts +2 -0
- package/dist/utils/strapiLinkUrl.d.ts +3 -0
- package/dist/utils/strapiMediaUrl.d.ts +5 -0
- package/package.json +132 -0
- package/src/components/CreditsAvailableBadge/CreditsAvailableBadge.test.tsx +65 -0
- package/src/components/CreditsAvailableBadge/CreditsAvailableBadge.tsx +55 -0
- package/src/components/CreditsAvailableBadge/index.ts +3 -0
- package/src/components/CreditsAvailableBadge/messages.de.ts +7 -0
- package/src/components/CreditsAvailableBadge/messages.en.ts +6 -0
- package/src/components/FullScreenImage/FullScreenImage.test.tsx +45 -0
- package/src/components/FullScreenImage/FullScreenImage.tsx +119 -0
- package/src/components/FullScreenImage/ZoomableImage.tsx +84 -0
- package/src/components/FullScreenImage/index.ts +3 -0
- package/src/components/MinimalProviders/MinimalProviders.tsx +25 -0
- package/src/components/MinimalProviders/index.ts +3 -0
- package/src/components/SliceRenderer/SliceRenderer.test.tsx +35 -0
- package/src/components/SliceRenderer/SliceRenderer.tsx +294 -0
- package/src/components/SliceRenderer/index.ts +3 -0
- package/src/components/StrapiLinkButton/StrapiLinkButton.test.tsx +58 -0
- package/src/components/StrapiLinkButton/StrapiLinkButton.tsx +55 -0
- package/src/components/StrapiLinkButton/index.ts +3 -0
- package/src/components/StrapiLinkButtonWithIcon/StrapiLinkButtonWithIcon.test.tsx +57 -0
- package/src/components/StrapiLinkButtonWithIcon/StrapiLinkButtonWithIcon.tsx +36 -0
- package/src/components/StrapiLinkButtonWithIcon/index.ts +3 -0
- package/src/components/portfolio/Contact/Contact.test.tsx +51 -0
- package/src/components/portfolio/Contact/Contact.tsx +73 -0
- package/src/components/portfolio/Contact/index.ts +3 -0
- package/src/components/portfolio/DocumentsDownloadList/DocumentsDownloadList.test.tsx +49 -0
- package/src/components/portfolio/DocumentsDownloadList/DocumentsDownloadList.tsx +76 -0
- package/src/components/portfolio/DocumentsDownloadList/index.ts +3 -0
- package/src/components/portfolio/DocumentsDownloadList/messages.de.ts +6 -0
- package/src/components/portfolio/DocumentsDownloadList/messages.en.ts +6 -0
- package/src/components/portfolio/ProjectInfo/ProjectInfo.test.tsx +81 -0
- package/src/components/portfolio/ProjectInfo/ProjectInfo.tsx +252 -0
- package/src/components/portfolio/ProjectInfo/index.ts +3 -0
- package/src/components/portfolio/ProjectInfo/messages.de.ts +19 -0
- package/src/components/portfolio/ProjectInfo/messages.en.ts +19 -0
- package/src/components/portfolio/SmallCheckout/SmallCheckout.test.tsx +166 -0
- package/src/components/portfolio/SmallCheckout/SmallCheckout.tsx +265 -0
- package/src/components/portfolio/SmallCheckout/index.ts +3 -0
- package/src/components/portfolio/SmallCheckout/messages.de.ts +26 -0
- package/src/components/portfolio/SmallCheckout/messages.en.ts +26 -0
- package/src/constants/animations.ts +1 -0
- package/src/constants/api.ts +5 -0
- package/src/constants/breakpoints.ts +9 -0
- package/src/constants/domain.ts +3 -0
- package/src/constants/fontCustomizations.ts +6 -0
- package/src/constants/formatter.ts +29 -0
- package/src/constants/globalStyle.ts +55 -0
- package/src/constants/mapbox.ts +24 -0
- package/src/constants/strapi.ts +2 -0
- package/src/icons/LinkedInIcon.tsx +23 -0
- package/src/index.tsx +1 -0
- package/src/models/BBox.ts +3 -0
- package/src/models/CreditsAvailableState.ts +8 -0
- package/src/models/Locale.ts +3 -0
- package/src/models/PortfolioProject.ts +9 -0
- package/src/models/forms/CheckoutForm.ts +5 -0
- package/src/models/fpm/FPMProject.ts +41 -0
- package/src/models/fpm/Issuer.ts +7 -0
- package/src/models/strapi/IStrapi.ts +5 -0
- package/src/models/strapi/IStrapiData.ts +6 -0
- package/src/models/strapi/IStrapiResponse.ts +15 -0
- package/src/models/strapi/StrapiAuthor.ts +12 -0
- package/src/models/strapi/StrapiAvatarWithName.ts +10 -0
- package/src/models/strapi/StrapiBanner.ts +11 -0
- package/src/models/strapi/StrapiBlogPost.ts +27 -0
- package/src/models/strapi/StrapiButtonWithVariant.ts +8 -0
- package/src/models/strapi/StrapiCategory.ts +10 -0
- package/src/models/strapi/StrapiContactArea.ts +12 -0
- package/src/models/strapi/StrapiCustomerStory.ts +23 -0
- package/src/models/strapi/StrapiDefaultHeader.ts +7 -0
- package/src/models/strapi/StrapiGlobal.ts +28 -0
- package/src/models/strapi/StrapiGlossaryItem.ts +7 -0
- package/src/models/strapi/StrapiHeroCard.ts +15 -0
- package/src/models/strapi/StrapiImage.ts +12 -0
- package/src/models/strapi/StrapiImageFormat.ts +13 -0
- package/src/models/strapi/StrapiImageWithLink.ts +8 -0
- package/src/models/strapi/StrapiLink.ts +13 -0
- package/src/models/strapi/StrapiLinkList.ts +9 -0
- package/src/models/strapi/StrapiLinkPage.ts +12 -0
- package/src/models/strapi/StrapiLinkWithIcon.ts +9 -0
- package/src/models/strapi/StrapiLocalization.ts +9 -0
- package/src/models/strapi/StrapiMedia.ts +29 -0
- package/src/models/strapi/StrapiMetadata.ts +15 -0
- package/src/models/strapi/StrapiNavMenu.ts +16 -0
- package/src/models/strapi/StrapiPage.ts +19 -0
- package/src/models/strapi/StrapiPortfolio.ts +12 -0
- package/src/models/strapi/StrapiPortfolioCard.ts +17 -0
- package/src/models/strapi/StrapiProject.ts +25 -0
- package/src/models/strapi/StrapiProjectCard.ts +20 -0
- package/src/models/strapi/StrapiQuoteCard.ts +9 -0
- package/src/models/strapi/StrapiShapesCard.ts +13 -0
- package/src/models/strapi/StrapiTextCardWithIcons.ts +10 -0
- package/src/models/strapi/StrapiTopBanner.ts +9 -0
- package/src/rootMessages.de.ts +41 -0
- package/src/rootMessages.en.ts +41 -0
- package/src/slices/Blog/Blog.test.tsx +146 -0
- package/src/slices/Blog/Blog.tsx +114 -0
- package/src/slices/Blog/index.ts +3 -0
- package/src/slices/Blog/styles.ts +34 -0
- package/src/slices/BlogCards/BlogCards.stories.tsx +148 -0
- package/src/slices/BlogCards/BlogCards.test.tsx +277 -0
- package/src/slices/BlogCards/BlogCards.tsx +210 -0
- package/src/slices/BlogCards/index.ts +3 -0
- package/src/slices/Comparison/Comparison.stories.tsx +123 -0
- package/src/slices/Comparison/Comparison.test.tsx +173 -0
- package/src/slices/Comparison/Comparison.tsx +265 -0
- package/src/slices/Comparison/Icon.test.tsx +43 -0
- package/src/slices/Comparison/Icon.tsx +34 -0
- package/src/slices/Comparison/index.ts +3 -0
- package/src/slices/Comparison/messages.de.ts +3 -0
- package/src/slices/Comparison/messages.en.ts +3 -0
- package/src/slices/Cta/Cta.stories.tsx +149 -0
- package/src/slices/Cta/Cta.test.tsx +249 -0
- package/src/slices/Cta/Cta.tsx +412 -0
- package/src/slices/Cta/index.ts +3 -0
- package/src/slices/Cta/messages.de.ts +4 -0
- package/src/slices/Cta/messages.en.ts +4 -0
- package/src/slices/CtaOnly/CtaOnly.stories.tsx +47 -0
- package/src/slices/CtaOnly/CtaOnly.test.tsx +26 -0
- package/src/slices/CtaOnly/CtaOnly.tsx +17 -0
- package/src/slices/CtaOnly/index.ts +3 -0
- package/src/slices/CustomerStories/CustomerStories.stories.tsx +20 -0
- package/src/slices/CustomerStories/CustomerStories.test.tsx +43 -0
- package/src/slices/CustomerStories/CustomerStories.tsx +84 -0
- package/src/slices/CustomerStories/index.ts +3 -0
- package/src/slices/CustomerStories/messages.de.ts +3 -0
- package/src/slices/CustomerStories/messages.en.ts +3 -0
- package/src/slices/Facts/Facts.stories.tsx +97 -0
- package/src/slices/Facts/Facts.test.tsx +99 -0
- package/src/slices/Facts/Facts.tsx +140 -0
- package/src/slices/Facts/index.ts +3 -0
- package/src/slices/FullWidthHighlightQuote/FullWidthHighlightQuote.stories.tsx +41 -0
- package/src/slices/FullWidthHighlightQuote/FullWidthHighlightQuote.test.tsx +39 -0
- package/src/slices/FullWidthHighlightQuote/FullWidthHighlightQuote.tsx +57 -0
- package/src/slices/FullWidthHighlightQuote/index.ts +3 -0
- package/src/slices/FullWidthImage/FullWidthImage.stories.tsx +40 -0
- package/src/slices/FullWidthImage/FullWidthImage.test.tsx +33 -0
- package/src/slices/FullWidthImage/FullWidthImage.tsx +63 -0
- package/src/slices/FullWidthImage/index.ts +3 -0
- package/src/slices/FullWidthImage/styles.ts +17 -0
- package/src/slices/FullWidthImageSlider/FullWidthImageSlider.stories.tsx +75 -0
- package/src/slices/FullWidthImageSlider/FullWidthImageSlider.test.tsx +49 -0
- package/src/slices/FullWidthImageSlider/FullWidthImageSlider.tsx +149 -0
- package/src/slices/FullWidthImageSlider/index.ts +3 -0
- package/src/slices/FullWidthImageSlider/styles.ts +96 -0
- package/src/slices/FullWidthImageSlider/utils.test.ts +10 -0
- package/src/slices/FullWidthImageSlider/utils.ts +17 -0
- package/src/slices/Glossary/Glossary.stories.tsx +42 -0
- package/src/slices/Glossary/Glossary.test.tsx +102 -0
- package/src/slices/Glossary/Glossary.tsx +107 -0
- package/src/slices/Glossary/index.ts +3 -0
- package/src/slices/Glossary/messages.de.ts +7 -0
- package/src/slices/Glossary/messages.en.ts +6 -0
- package/src/slices/Hero/Hero.stories.tsx +129 -0
- package/src/slices/Hero/Hero.test.tsx +89 -0
- package/src/slices/Hero/Hero.tsx +95 -0
- package/src/slices/Hero/index.ts +3 -0
- package/src/slices/Hero/styles.ts +52 -0
- package/src/slices/IconGrid/IconGrid.stories.tsx +178 -0
- package/src/slices/IconGrid/IconGrid.test.tsx +81 -0
- package/src/slices/IconGrid/IconGrid.tsx +97 -0
- package/src/slices/IconGrid/index.ts +3 -0
- package/src/slices/IconGrid/styles.ts +21 -0
- package/src/slices/ImageGrid/ImageGrid.stories.tsx +92 -0
- package/src/slices/ImageGrid/ImageGrid.test.tsx +82 -0
- package/src/slices/ImageGrid/ImageGrid.tsx +89 -0
- package/src/slices/ImageGrid/index.ts +3 -0
- package/src/slices/ImageGrid/styles.ts +12 -0
- package/src/slices/ImageTextSequence/ImageTextSequence.stories.tsx +124 -0
- package/src/slices/ImageTextSequence/ImageTextSequence.test.tsx +91 -0
- package/src/slices/ImageTextSequence/ImageTextSequence.tsx +143 -0
- package/src/slices/ImageTextSequence/index.ts +3 -0
- package/src/slices/ImageTextSequence/styles.ts +33 -0
- package/src/slices/LeftTextRightCard/LeftTextRightCard.stories.tsx +93 -0
- package/src/slices/LeftTextRightCard/LeftTextRightCard.test.tsx +72 -0
- package/src/slices/LeftTextRightCard/LeftTextRightCard.tsx +108 -0
- package/src/slices/LeftTextRightCard/index.ts +3 -0
- package/src/slices/LinkCardsGrid/LinkCardsGrid.stories.tsx +60 -0
- package/src/slices/LinkCardsGrid/LinkCardsGrid.test.tsx +36 -0
- package/src/slices/LinkCardsGrid/LinkCardsGrid.tsx +95 -0
- package/src/slices/LinkCardsGrid/index.ts +3 -0
- package/src/slices/LogoGridWithText/LogoGridWithText.stories.tsx +73 -0
- package/src/slices/LogoGridWithText/LogoGridWithText.test.tsx +55 -0
- package/src/slices/LogoGridWithText/LogoGridWithText.tsx +95 -0
- package/src/slices/LogoGridWithText/index.ts +3 -0
- package/src/slices/LogoGridWithText/styles.ts +13 -0
- package/src/slices/MapHero/MapHero.stories.tsx +112 -0
- package/src/slices/MapHero/MapHero.test.tsx +85 -0
- package/src/slices/MapHero/MapHero.tsx +89 -0
- package/src/slices/MapHero/index.ts +3 -0
- package/src/slices/MapHero/styles.ts +105 -0
- package/src/slices/ProjectFacts/ProjectFacts.stories.tsx +91 -0
- package/src/slices/ProjectFacts/ProjectFacts.test.tsx +34 -0
- package/src/slices/ProjectFacts/ProjectFacts.tsx +95 -0
- package/src/slices/ProjectFacts/index.ts +3 -0
- package/src/slices/ProjectFacts/messages.de.ts +4 -0
- package/src/slices/ProjectFacts/messages.en.ts +4 -0
- package/src/slices/ProjectsGrid/ProjectsGrid.stories.tsx +72 -0
- package/src/slices/ProjectsGrid/ProjectsGrid.test.tsx +31 -0
- package/src/slices/ProjectsGrid/ProjectsGrid.tsx +80 -0
- package/src/slices/ProjectsGrid/index.ts +3 -0
- package/src/slices/ProjectsMap/MapMarker.test.tsx +79 -0
- package/src/slices/ProjectsMap/MapMarker.tsx +99 -0
- package/src/slices/ProjectsMap/ProjectsMap.stories.tsx +101 -0
- package/src/slices/ProjectsMap/ProjectsMap.test.tsx +95 -0
- package/src/slices/ProjectsMap/ProjectsMap.tsx +150 -0
- package/src/slices/ProjectsMap/index.ts +3 -0
- package/src/slices/ProjectsMap/messages.de.ts +3 -0
- package/src/slices/ProjectsMap/messages.en.ts +3 -0
- package/src/slices/QAndA/QAndA.stories.tsx +103 -0
- package/src/slices/QAndA/QAndA.test.tsx +67 -0
- package/src/slices/QAndA/QAndA.tsx +157 -0
- package/src/slices/QAndA/index.ts +3 -0
- package/src/slices/QuoteCards/QuoteCards.stories.tsx +118 -0
- package/src/slices/QuoteCards/QuoteCards.test.tsx +52 -0
- package/src/slices/QuoteCards/QuoteCards.tsx +135 -0
- package/src/slices/QuoteCards/index.ts +3 -0
- package/src/slices/QuoteCards/styles.ts +17 -0
- package/src/slices/RichTextSection/RichTextSection.stories.tsx +27 -0
- package/src/slices/RichTextSection/RichTextSection.test.tsx +20 -0
- package/src/slices/RichTextSection/RichTextSection.tsx +27 -0
- package/src/slices/RichTextSection/index.ts +3 -0
- package/src/slices/ShopCheckout/ShopCheckout.stories.tsx +76 -0
- package/src/slices/ShopCheckout/ShopCheckout.test.tsx +186 -0
- package/src/slices/ShopCheckout/ShopCheckout.tsx +228 -0
- package/src/slices/ShopCheckout/index.ts +3 -0
- package/src/slices/ShopCheckout/messages.de.ts +23 -0
- package/src/slices/ShopCheckout/messages.en.ts +23 -0
- package/src/slices/SideBySideImages/SideBySideImages.stories.tsx +39 -0
- package/src/slices/SideBySideImages/SideBySideImages.test.tsx +52 -0
- package/src/slices/SideBySideImages/SideBySideImages.tsx +57 -0
- package/src/slices/SideBySideImages/index.ts +3 -0
- package/src/slices/SmallHero/SmallHero.stories.tsx +138 -0
- package/src/slices/SmallHero/SmallHero.test.tsx +70 -0
- package/src/slices/SmallHero/SmallHero.tsx +116 -0
- package/src/slices/SmallHero/index.ts +3 -0
- package/src/slices/SmallHero/styles.ts +39 -0
- package/src/slices/Steps/Steps.stories.tsx +95 -0
- package/src/slices/Steps/Steps.test.tsx +68 -0
- package/src/slices/Steps/Steps.tsx +178 -0
- package/src/slices/Steps/index.ts +3 -0
- package/src/slices/Steps/styles.ts +64 -0
- package/src/slices/TextCardGrid/TextCardGrid.stories.tsx +156 -0
- package/src/slices/TextCardGrid/TextCardGrid.test.tsx +103 -0
- package/src/slices/TextCardGrid/TextCardGrid.tsx +285 -0
- package/src/slices/TextCardGrid/index.ts +3 -0
- package/src/slices/TextCarousel/TextCarousel.stories.tsx +104 -0
- package/src/slices/TextCarousel/TextCarousel.test.tsx +90 -0
- package/src/slices/TextCarousel/TextCarousel.tsx +91 -0
- package/src/slices/TextCarousel/index.ts +3 -0
- package/src/slices/TextCarousel/styles.ts +65 -0
- package/src/slices/TextWithCard/TextWithCard.stories.tsx +113 -0
- package/src/slices/TextWithCard/TextWithCard.test.tsx +87 -0
- package/src/slices/TextWithCard/TextWithCard.tsx +115 -0
- package/src/slices/TextWithCard/index.ts +3 -0
- package/src/slices/TextWithTextCards/TextWithTextCards.stories.tsx +121 -0
- package/src/slices/TextWithTextCards/TextWithTextCards.test.tsx +57 -0
- package/src/slices/TextWithTextCards/TextWithTextCards.tsx +167 -0
- package/src/slices/TextWithTextCards/index.ts +3 -0
- package/src/slices/TextWithTextCards/styles.ts +26 -0
- package/src/slices/Video/Video.stories.tsx +18 -0
- package/src/slices/Video/Video.test.tsx +26 -0
- package/src/slices/Video/Video.tsx +35 -0
- package/src/slices/Video/index.ts +3 -0
- package/src/test/defaultMocks/next.ts +29 -0
- package/src/test/integrationMocks/fpmProjectMock.ts +37 -0
- package/src/test/mocks/portfolioProjectMock.ts +11 -0
- package/src/test/setupTests.ts +5 -0
- package/src/test/storybookMocks/storybookMedia.ts +2 -0
- package/src/test/storybookMocks/storybookStrapiMedia.ts +58 -0
- package/src/test/strapiMocks/minimalGlobalData.ts +24 -0
- package/src/test/strapiMocks/strapiAvatarWithName.ts +12 -0
- package/src/test/strapiMocks/strapiBlogPost.ts +216 -0
- package/src/test/strapiMocks/strapiContact.ts +15 -0
- package/src/test/strapiMocks/strapiCustomerStory.ts +195 -0
- package/src/test/strapiMocks/strapiHeroCard.ts +7 -0
- package/src/test/strapiMocks/strapiLinkPage.ts +14 -0
- package/src/test/strapiMocks/strapiMedia.ts +91 -0
- package/src/test/strapiMocks/strapiMetadata.ts +12 -0
- package/src/test/strapiMocks/strapiPage.ts +683 -0
- package/src/test/strapiMocks/strapiPortfolioCard.ts +40 -0
- package/src/test/strapiMocks/strapiPortfolioMock.ts +20 -0
- package/src/test/strapiMocks/strapiProject.ts +34 -0
- package/src/test/strapiMocks/strapiProjectCard.ts +20 -0
- package/src/test/strapiMocks/strapiQuoteCard.ts +8 -0
- package/src/test/testUtils.tsx +25 -0
- package/src/unit.messages.de.ts +4 -0
- package/src/unit.messages.en.ts +4 -0
- package/src/utils/convertAreaM2ToHa.test.ts +9 -0
- package/src/utils/convertAreaM2ToHa.ts +4 -0
- package/src/utils/convertCo2AmountKgToTons.ts +4 -0
- package/src/utils/convertToKebabCase.test.ts +9 -0
- package/src/utils/convertToKebabCase.ts +10 -0
- package/src/utils/getTimeSpanInYears.test.ts +35 -0
- package/src/utils/getTimeSpanInYears.ts +14 -0
- package/src/utils/mergeBoundingBoxes.test.ts +13 -0
- package/src/utils/mergeBoundingBoxes.ts +19 -0
- package/src/utils/mergeDeep.ts +31 -0
- package/src/utils/openHubSpotChat.ts +15 -0
- package/src/utils/strapiLinkUrl.test.ts +26 -0
- package/src/utils/strapiLinkUrl.ts +13 -0
- package/src/utils/strapiMediaUrl.test.ts +54 -0
- package/src/utils/strapiMediaUrl.ts +32 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { StoryFn, Meta } from '@storybook/react';
|
|
2
|
+
|
|
3
|
+
import ShopCheckout from '.';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'shop/ShopCheckout',
|
|
7
|
+
component: ShopCheckout,
|
|
8
|
+
} as Meta<typeof ShopCheckout>;
|
|
9
|
+
|
|
10
|
+
const Template: StoryFn<typeof ShopCheckout> = (args) => (
|
|
11
|
+
<ShopCheckout {...args} />
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
export const Minimal = Template.bind({});
|
|
15
|
+
Minimal.args = {
|
|
16
|
+
slice: {
|
|
17
|
+
title: 'Title',
|
|
18
|
+
batchId: 'batchId',
|
|
19
|
+
pricePerKg: 0.06,
|
|
20
|
+
initialContributionValue: 60,
|
|
21
|
+
checkoutText: 'Checkout Text',
|
|
22
|
+
currency: 'EUR',
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const WithTagline = Template.bind({});
|
|
27
|
+
WithTagline.args = {
|
|
28
|
+
slice: {
|
|
29
|
+
title: 'Title',
|
|
30
|
+
batchId: 'batchId',
|
|
31
|
+
pricePerKg: 0.06,
|
|
32
|
+
initialContributionValue: 60,
|
|
33
|
+
checkoutText: 'Checkout Text',
|
|
34
|
+
tagline: 'Tagline',
|
|
35
|
+
currency: 'EUR',
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const WithText = Template.bind({});
|
|
40
|
+
WithText.args = {
|
|
41
|
+
slice: {
|
|
42
|
+
title: 'Title',
|
|
43
|
+
batchId: 'batchId',
|
|
44
|
+
pricePerKg: 0.06,
|
|
45
|
+
initialContributionValue: 60,
|
|
46
|
+
checkoutText: 'Checkout Text',
|
|
47
|
+
text: 'Text',
|
|
48
|
+
currency: 'EUR',
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const WithBadge = Template.bind({});
|
|
53
|
+
WithBadge.args = {
|
|
54
|
+
slice: {
|
|
55
|
+
title: 'Title',
|
|
56
|
+
batchId: 'batchId',
|
|
57
|
+
pricePerKg: 0.06,
|
|
58
|
+
initialContributionValue: 60,
|
|
59
|
+
checkoutText: 'Checkout Text',
|
|
60
|
+
badge: 'Badge Text',
|
|
61
|
+
currency: 'EUR',
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const WithCHF = Template.bind({});
|
|
66
|
+
WithCHF.args = {
|
|
67
|
+
slice: {
|
|
68
|
+
title: 'Title',
|
|
69
|
+
batchId: 'batchId',
|
|
70
|
+
pricePerKg: 0.06,
|
|
71
|
+
initialContributionValue: 60,
|
|
72
|
+
checkoutText: 'Checkout Text',
|
|
73
|
+
badge: 'Badge Text',
|
|
74
|
+
currency: 'CHF',
|
|
75
|
+
},
|
|
76
|
+
};
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { render, screen, userEvent, waitFor } from '@/test/testUtils';
|
|
2
|
+
import { DEFAULT_USE_ROUTER_RETURN_VALUE } from '@/test/defaultMocks/next';
|
|
3
|
+
import { ShopCheckoutProps } from './ShopCheckout';
|
|
4
|
+
import ShopCheckout from '.';
|
|
5
|
+
import { useRouter } from '../../../__mocks__/next/router';
|
|
6
|
+
import messagesEn from './messages.en';
|
|
7
|
+
|
|
8
|
+
const pushSpy = jest.fn();
|
|
9
|
+
|
|
10
|
+
const defaultProps: ShopCheckoutProps = {
|
|
11
|
+
slice: {
|
|
12
|
+
title: 'Title',
|
|
13
|
+
batchId: 'batchId',
|
|
14
|
+
pricePerKg: 0.06,
|
|
15
|
+
initialContributionValue: 60,
|
|
16
|
+
checkoutText: 'Checkout Text',
|
|
17
|
+
currency: 'EUR',
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const setup = (props = {}) => {
|
|
22
|
+
const combinedProps = { ...defaultProps, ...props };
|
|
23
|
+
render(<ShopCheckout {...combinedProps} />);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
describe('The ShowCheckout section', () => {
|
|
27
|
+
beforeEach(() => {
|
|
28
|
+
useRouter.mockReturnValue({
|
|
29
|
+
...DEFAULT_USE_ROUTER_RETURN_VALUE,
|
|
30
|
+
push: pushSpy,
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
afterEach(() => {
|
|
35
|
+
pushSpy.mockRestore();
|
|
36
|
+
useRouter.mockRestore();
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('displays the title', () => {
|
|
40
|
+
setup();
|
|
41
|
+
|
|
42
|
+
expect(screen.getByText('Title')).toBeInTheDocument();
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('displays the badge', () => {
|
|
46
|
+
setup({ slice: { ...defaultProps.slice, badge: 'Badge Text' } });
|
|
47
|
+
|
|
48
|
+
expect(screen.getByText('Badge Text')).toBeInTheDocument();
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('navigates to the checkout on submit', async () => {
|
|
52
|
+
setup();
|
|
53
|
+
|
|
54
|
+
await userEvent.click(
|
|
55
|
+
screen.getByText(messagesEn['sections.shopCheckout.submit'])
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
await waitFor(() => {
|
|
59
|
+
expect(pushSpy).toHaveBeenCalledWith(
|
|
60
|
+
'https://api.fpm.t-staging.com/v1/webhooks/shop/checkout?batchId=batchId&quantity=1000'
|
|
61
|
+
);
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it('adds the coupon-id to the url if it is set', async () => {
|
|
66
|
+
setup({ slice: { ...defaultProps.slice, couponId: 'coupon-id' } });
|
|
67
|
+
|
|
68
|
+
await userEvent.click(
|
|
69
|
+
screen.getByText(messagesEn['sections.shopCheckout.submit'])
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
await waitFor(() => {
|
|
73
|
+
expect(pushSpy).toHaveBeenCalledWith(
|
|
74
|
+
'https://api.fpm.t-staging.com/v1/webhooks/shop/checkout?batchId=batchId&quantity=1000&couponId=coupon-id'
|
|
75
|
+
);
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it('works with CHF', async () => {
|
|
80
|
+
setup({ slice: { ...defaultProps.slice, currency: 'CHF' } });
|
|
81
|
+
|
|
82
|
+
expect(
|
|
83
|
+
screen.getByLabelText(
|
|
84
|
+
messagesEn['sections.shopCheckout.contributionValue.label.CHF']
|
|
85
|
+
)
|
|
86
|
+
).toBeInTheDocument();
|
|
87
|
+
|
|
88
|
+
await userEvent.clear(
|
|
89
|
+
screen.getByLabelText(
|
|
90
|
+
messagesEn['sections.shopCheckout.contributionValue.label.CHF']
|
|
91
|
+
)
|
|
92
|
+
);
|
|
93
|
+
await userEvent.type(
|
|
94
|
+
screen.getByLabelText(
|
|
95
|
+
messagesEn['sections.shopCheckout.contributionValue.label.CHF']
|
|
96
|
+
),
|
|
97
|
+
'1'
|
|
98
|
+
);
|
|
99
|
+
await userEvent.click(
|
|
100
|
+
screen.getByText(messagesEn['sections.shopCheckout.submit'])
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
expect(
|
|
104
|
+
await screen.findByText(
|
|
105
|
+
messagesEn[
|
|
106
|
+
'sections.shopCheckout.contributionValue.validation.tooLow.CHF'
|
|
107
|
+
]
|
|
108
|
+
)
|
|
109
|
+
).toBeInTheDocument();
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
describe('does not submit', () => {
|
|
113
|
+
it('if the value is empty', async () => {
|
|
114
|
+
setup();
|
|
115
|
+
|
|
116
|
+
await userEvent.clear(
|
|
117
|
+
screen.getByLabelText(
|
|
118
|
+
messagesEn['sections.shopCheckout.contributionValue.label.EUR']
|
|
119
|
+
)
|
|
120
|
+
);
|
|
121
|
+
await userEvent.click(
|
|
122
|
+
screen.getByText(messagesEn['sections.shopCheckout.submit'])
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
expect(
|
|
126
|
+
await screen.findByText(
|
|
127
|
+
messagesEn['sections.shopCheckout.contributionValue.validation.empty']
|
|
128
|
+
)
|
|
129
|
+
).toBeInTheDocument();
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
it('if the value is too low', async () => {
|
|
133
|
+
setup();
|
|
134
|
+
|
|
135
|
+
await userEvent.clear(
|
|
136
|
+
screen.getByLabelText(
|
|
137
|
+
messagesEn['sections.shopCheckout.contributionValue.label.EUR']
|
|
138
|
+
)
|
|
139
|
+
);
|
|
140
|
+
await userEvent.type(
|
|
141
|
+
screen.getByLabelText(
|
|
142
|
+
messagesEn['sections.shopCheckout.contributionValue.label.EUR']
|
|
143
|
+
),
|
|
144
|
+
'1'
|
|
145
|
+
);
|
|
146
|
+
await userEvent.click(
|
|
147
|
+
screen.getByText(messagesEn['sections.shopCheckout.submit'])
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
expect(
|
|
151
|
+
await screen.findByText(
|
|
152
|
+
messagesEn[
|
|
153
|
+
'sections.shopCheckout.contributionValue.validation.tooLow.EUR'
|
|
154
|
+
]
|
|
155
|
+
)
|
|
156
|
+
).toBeInTheDocument();
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
it('if the value is too high', async () => {
|
|
160
|
+
setup();
|
|
161
|
+
|
|
162
|
+
await userEvent.clear(
|
|
163
|
+
screen.getByLabelText(
|
|
164
|
+
messagesEn['sections.shopCheckout.contributionValue.label.EUR']
|
|
165
|
+
)
|
|
166
|
+
);
|
|
167
|
+
await userEvent.type(
|
|
168
|
+
screen.getByLabelText(
|
|
169
|
+
messagesEn['sections.shopCheckout.contributionValue.label.EUR']
|
|
170
|
+
),
|
|
171
|
+
'1000000'
|
|
172
|
+
);
|
|
173
|
+
await userEvent.click(
|
|
174
|
+
screen.getByText(messagesEn['sections.shopCheckout.submit'])
|
|
175
|
+
);
|
|
176
|
+
|
|
177
|
+
expect(
|
|
178
|
+
await screen.findByText(
|
|
179
|
+
messagesEn[
|
|
180
|
+
'sections.shopCheckout.contributionValue.validation.tooHigh'
|
|
181
|
+
]
|
|
182
|
+
)
|
|
183
|
+
).toBeInTheDocument();
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
});
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Badge,
|
|
3
|
+
BoemlyFormControl,
|
|
4
|
+
Box,
|
|
5
|
+
Button,
|
|
6
|
+
Container,
|
|
7
|
+
DefaultSectionContainer,
|
|
8
|
+
DefaultSectionHeader,
|
|
9
|
+
Divider,
|
|
10
|
+
Flex,
|
|
11
|
+
InputRightAddon,
|
|
12
|
+
LabelNumberPair,
|
|
13
|
+
RichText,
|
|
14
|
+
SimpleGrid,
|
|
15
|
+
Spacer,
|
|
16
|
+
useToken,
|
|
17
|
+
Wrapper,
|
|
18
|
+
} from 'boemly';
|
|
19
|
+
import { Field, FieldProps, Form, Formik, FormikProps } from 'formik';
|
|
20
|
+
import { useRouter } from 'next/router';
|
|
21
|
+
import { useCallback } from 'react';
|
|
22
|
+
import { FormattedMessage, useIntl } from 'react-intl';
|
|
23
|
+
import { FPM_API_URI } from '@/constants/api';
|
|
24
|
+
import CheckoutForm from '@/models/forms/CheckoutForm';
|
|
25
|
+
import {
|
|
26
|
+
MAXIMUM_CONTRIBUTION_VALUE_IN_MONEY,
|
|
27
|
+
MINIMUM_CONTRIBUTION_VALUE_IN_MONEY,
|
|
28
|
+
} from '@/constants/domain';
|
|
29
|
+
|
|
30
|
+
export interface ShopCheckoutProps {
|
|
31
|
+
slice: {
|
|
32
|
+
tagline?: string;
|
|
33
|
+
title: string;
|
|
34
|
+
text?: string;
|
|
35
|
+
badge?: string;
|
|
36
|
+
batchId: string;
|
|
37
|
+
pricePerKg: number;
|
|
38
|
+
couponId?: string;
|
|
39
|
+
initialContributionValue: number;
|
|
40
|
+
checkoutText: string;
|
|
41
|
+
currency: 'EUR' | 'CHF';
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const ShopCheckout = ({ slice }: ShopCheckoutProps): JSX.Element => {
|
|
46
|
+
const [primary50] = useToken('colors', ['primary.50']);
|
|
47
|
+
const { formatMessage, formatNumber } = useIntl();
|
|
48
|
+
const { push } = useRouter();
|
|
49
|
+
|
|
50
|
+
const validateForm = useCallback((values: CheckoutForm) => {
|
|
51
|
+
const errors: Partial<{ contributionValue: string }> = {};
|
|
52
|
+
|
|
53
|
+
if (!values.contributionValue) {
|
|
54
|
+
errors.contributionValue = formatMessage({
|
|
55
|
+
id: 'sections.shopCheckout.contributionValue.validation.empty',
|
|
56
|
+
});
|
|
57
|
+
} else if (values.contributionValue < MINIMUM_CONTRIBUTION_VALUE_IN_MONEY) {
|
|
58
|
+
errors.contributionValue = formatMessage({
|
|
59
|
+
id: `sections.shopCheckout.contributionValue.validation.tooLow.${slice.currency}`,
|
|
60
|
+
});
|
|
61
|
+
} else if (values.contributionValue > MAXIMUM_CONTRIBUTION_VALUE_IN_MONEY) {
|
|
62
|
+
errors.contributionValue = formatMessage({
|
|
63
|
+
id: 'sections.shopCheckout.contributionValue.validation.tooHigh',
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return errors;
|
|
68
|
+
}, []);
|
|
69
|
+
|
|
70
|
+
const onSubmit = ({ contributionValue }: CheckoutForm) => {
|
|
71
|
+
const url = new URL(`${FPM_API_URI}/v1/webhooks/shop/checkout`);
|
|
72
|
+
|
|
73
|
+
url.searchParams.append('batchId', slice.batchId);
|
|
74
|
+
|
|
75
|
+
url.searchParams.append(
|
|
76
|
+
'quantity',
|
|
77
|
+
Math.floor(contributionValue / slice.pricePerKg).toString()
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
if (slice.couponId) url.searchParams.append('couponId', slice.couponId);
|
|
81
|
+
|
|
82
|
+
push(url.toString());
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<DefaultSectionContainer backgroundColor={primary50} title={slice.title}>
|
|
87
|
+
<Wrapper>
|
|
88
|
+
<Flex
|
|
89
|
+
flexDir={['column', null, null, null, 'row']}
|
|
90
|
+
justifyContent="space-between"
|
|
91
|
+
alignItems={['left', null, null, null, 'center']}
|
|
92
|
+
>
|
|
93
|
+
<Box marginRight={['0', null, null, null, '36']} flexShrink={2}>
|
|
94
|
+
<DefaultSectionHeader
|
|
95
|
+
tagline={slice.tagline}
|
|
96
|
+
title={slice.title}
|
|
97
|
+
text={slice.text}
|
|
98
|
+
/>
|
|
99
|
+
</Box>
|
|
100
|
+
<Container maxWidth="md" padding="lg" shadow="lg">
|
|
101
|
+
{slice.badge ? (
|
|
102
|
+
<>
|
|
103
|
+
<Badge
|
|
104
|
+
colorScheme="green"
|
|
105
|
+
textTransform="none"
|
|
106
|
+
whiteSpace="unset"
|
|
107
|
+
>
|
|
108
|
+
{slice.badge}
|
|
109
|
+
</Badge>
|
|
110
|
+
<Spacer height="3" />
|
|
111
|
+
</>
|
|
112
|
+
) : (
|
|
113
|
+
<></>
|
|
114
|
+
)}
|
|
115
|
+
|
|
116
|
+
<RichText
|
|
117
|
+
content={slice.checkoutText}
|
|
118
|
+
textProps={{ color: 'gray.500' }}
|
|
119
|
+
/>
|
|
120
|
+
|
|
121
|
+
<Spacer height="6" />
|
|
122
|
+
<Divider />
|
|
123
|
+
<Spacer height="6" />
|
|
124
|
+
|
|
125
|
+
<LabelNumberPair
|
|
126
|
+
label={formatMessage({ id: 'sections.shopCheckout.intro.price' })}
|
|
127
|
+
number={`${formatNumber(slice.pricePerKg * 100, {
|
|
128
|
+
style: 'currency',
|
|
129
|
+
currency: slice.currency,
|
|
130
|
+
})}/${formatNumber(100, {
|
|
131
|
+
style: 'unit',
|
|
132
|
+
unit: 'kilogram',
|
|
133
|
+
})} CO₂`}
|
|
134
|
+
/>
|
|
135
|
+
|
|
136
|
+
<Spacer height="6" />
|
|
137
|
+
<Divider />
|
|
138
|
+
<Spacer height="6" />
|
|
139
|
+
|
|
140
|
+
<Formik
|
|
141
|
+
initialValues={{
|
|
142
|
+
contributionValue: slice.initialContributionValue,
|
|
143
|
+
}}
|
|
144
|
+
validate={validateForm}
|
|
145
|
+
onSubmit={onSubmit}
|
|
146
|
+
>
|
|
147
|
+
{({
|
|
148
|
+
errors,
|
|
149
|
+
touched,
|
|
150
|
+
handleSubmit,
|
|
151
|
+
values,
|
|
152
|
+
}: FormikProps<CheckoutForm>) => (
|
|
153
|
+
<Form onSubmit={handleSubmit}>
|
|
154
|
+
<Box width="full">
|
|
155
|
+
<Field name="contributionValue">
|
|
156
|
+
{({ field }: FieldProps) => (
|
|
157
|
+
<BoemlyFormControl
|
|
158
|
+
id="contributionValue"
|
|
159
|
+
size="md"
|
|
160
|
+
inputProps={{ type: 'number', ...field }}
|
|
161
|
+
label={formatMessage({
|
|
162
|
+
id: `sections.shopCheckout.contributionValue.label.${slice.currency}`,
|
|
163
|
+
})}
|
|
164
|
+
rightAddonsOrElements={[
|
|
165
|
+
<InputRightAddon key="1">
|
|
166
|
+
<FormattedMessage
|
|
167
|
+
id={`sections.shopCheckout.contributionValue.unit.${slice.currency}`}
|
|
168
|
+
/>
|
|
169
|
+
</InputRightAddon>,
|
|
170
|
+
]}
|
|
171
|
+
isInvalid={
|
|
172
|
+
!!errors.contributionValue &&
|
|
173
|
+
touched.contributionValue
|
|
174
|
+
}
|
|
175
|
+
errorMessage={errors.contributionValue}
|
|
176
|
+
/>
|
|
177
|
+
)}
|
|
178
|
+
</Field>
|
|
179
|
+
</Box>
|
|
180
|
+
|
|
181
|
+
<Spacer height="6" />
|
|
182
|
+
|
|
183
|
+
<SimpleGrid columns={2} gap="4">
|
|
184
|
+
<LabelNumberPair
|
|
185
|
+
label={formatMessage({
|
|
186
|
+
id: 'sections.shopCheckout.summary.kg',
|
|
187
|
+
})}
|
|
188
|
+
number={`${formatNumber(
|
|
189
|
+
Math.floor(values.contributionValue / slice.pricePerKg),
|
|
190
|
+
{
|
|
191
|
+
style: 'unit',
|
|
192
|
+
unit: 'kilogram',
|
|
193
|
+
maximumFractionDigits: 0,
|
|
194
|
+
}
|
|
195
|
+
)} CO₂`}
|
|
196
|
+
/>
|
|
197
|
+
<LabelNumberPair
|
|
198
|
+
label={formatMessage({
|
|
199
|
+
id: 'sections.shopCheckout.summary.price',
|
|
200
|
+
})}
|
|
201
|
+
number={formatNumber(
|
|
202
|
+
Math.floor(
|
|
203
|
+
values.contributionValue / slice.pricePerKg
|
|
204
|
+
) * slice.pricePerKg,
|
|
205
|
+
{
|
|
206
|
+
style: 'currency',
|
|
207
|
+
currency: slice.currency,
|
|
208
|
+
minimumFractionDigits: 2,
|
|
209
|
+
maximumFractionDigits: 2,
|
|
210
|
+
}
|
|
211
|
+
)}
|
|
212
|
+
/>
|
|
213
|
+
</SimpleGrid>
|
|
214
|
+
|
|
215
|
+
<Spacer height="6" />
|
|
216
|
+
|
|
217
|
+
<Button type="submit" width="full">
|
|
218
|
+
<FormattedMessage id="sections.shopCheckout.submit" />
|
|
219
|
+
</Button>
|
|
220
|
+
</Form>
|
|
221
|
+
)}
|
|
222
|
+
</Formik>
|
|
223
|
+
</Container>
|
|
224
|
+
</Flex>
|
|
225
|
+
</Wrapper>
|
|
226
|
+
</DefaultSectionContainer>
|
|
227
|
+
);
|
|
228
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
'sections.shopCheckout.intro.price': 'Preis',
|
|
3
|
+
|
|
4
|
+
'sections.shopCheckout.contributionValue.label.EUR':
|
|
5
|
+
'Geben sie einen Betrag in € ein',
|
|
6
|
+
'sections.shopCheckout.contributionValue.label.CHF':
|
|
7
|
+
'Geben sie einen Betrag in CHF ein',
|
|
8
|
+
'sections.shopCheckout.contributionValue.unit.EUR': '€',
|
|
9
|
+
'sections.shopCheckout.contributionValue.unit.CHF': 'CHF',
|
|
10
|
+
'sections.shopCheckout.contributionValue.validation.empty':
|
|
11
|
+
'Bitte geben sie einen Betrag ein',
|
|
12
|
+
'sections.shopCheckout.contributionValue.validation.tooLow.EUR':
|
|
13
|
+
'Der Betrag muss mindestens 10 Euro sein',
|
|
14
|
+
'sections.shopCheckout.contributionValue.validation.tooLow.CHF':
|
|
15
|
+
'Der Betrag muss mindestens 10 CHF sein',
|
|
16
|
+
'sections.shopCheckout.contributionValue.validation.tooHigh':
|
|
17
|
+
'Für größere Einkäufe kontaktieren Sie bitte unser Verkaufsteam über office@tree.ly',
|
|
18
|
+
|
|
19
|
+
'sections.shopCheckout.summary.kg': 'Menge',
|
|
20
|
+
'sections.shopCheckout.summary.price': 'Preis',
|
|
21
|
+
|
|
22
|
+
'sections.shopCheckout.submit': 'Kaufen',
|
|
23
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
'sections.shopCheckout.intro.price': 'Price',
|
|
3
|
+
|
|
4
|
+
'sections.shopCheckout.contributionValue.label.EUR':
|
|
5
|
+
'Enter contribution value in €',
|
|
6
|
+
'sections.shopCheckout.contributionValue.label.CHF':
|
|
7
|
+
'Enter contribution value in CHF',
|
|
8
|
+
'sections.shopCheckout.contributionValue.unit.EUR': '€',
|
|
9
|
+
'sections.shopCheckout.contributionValue.unit.CHF': 'CHF',
|
|
10
|
+
'sections.shopCheckout.contributionValue.validation.empty':
|
|
11
|
+
'Please enter a value',
|
|
12
|
+
'sections.shopCheckout.contributionValue.validation.tooLow.EUR':
|
|
13
|
+
'Der Betrag muss mindestens 10 Euro sein',
|
|
14
|
+
'sections.shopCheckout.contributionValue.validation.tooLow.CHF':
|
|
15
|
+
'Der Betrag muss mindestens 10 CHF sein',
|
|
16
|
+
'sections.shopCheckout.contributionValue.validation.tooHigh':
|
|
17
|
+
'For bigger purchases please contact our sales team via office@tree.ly',
|
|
18
|
+
|
|
19
|
+
'sections.shopCheckout.summary.kg': 'Quantity',
|
|
20
|
+
'sections.shopCheckout.summary.price': 'Price',
|
|
21
|
+
|
|
22
|
+
'sections.shopCheckout.submit': 'Checkout',
|
|
23
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { StoryFn, Meta } from '@storybook/react';
|
|
2
|
+
|
|
3
|
+
import { storybookStrapiCoverMock } from '@/test/storybookMocks/storybookStrapiMedia';
|
|
4
|
+
import SideBySideImages from '.';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'sections/SideBySideImages',
|
|
8
|
+
component: SideBySideImages,
|
|
9
|
+
} as Meta<typeof SideBySideImages>;
|
|
10
|
+
|
|
11
|
+
const Template: StoryFn<typeof SideBySideImages> = (args) => (
|
|
12
|
+
<SideBySideImages {...args} />
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
export const Minimal = Template.bind({});
|
|
16
|
+
Minimal.args = {
|
|
17
|
+
slice: {
|
|
18
|
+
images: [
|
|
19
|
+
{
|
|
20
|
+
id: 1,
|
|
21
|
+
caption: 'Caption 1',
|
|
22
|
+
img: {
|
|
23
|
+
id: 1,
|
|
24
|
+
alt: 'Alt text 1',
|
|
25
|
+
img: { data: storybookStrapiCoverMock },
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: 2,
|
|
30
|
+
caption: 'Caption 2',
|
|
31
|
+
img: {
|
|
32
|
+
id: 2,
|
|
33
|
+
alt: 'Alt text 2',
|
|
34
|
+
img: { data: storybookStrapiCoverMock },
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { render, screen } from '@/test/testUtils';
|
|
2
|
+
import { strapiMediaMock } from '@/test/strapiMocks/strapiMedia';
|
|
3
|
+
import { SideBySideImagesProps } from './SideBySideImages';
|
|
4
|
+
import SideBySideImages from '.';
|
|
5
|
+
|
|
6
|
+
const defaultProps: SideBySideImagesProps = {
|
|
7
|
+
slice: {
|
|
8
|
+
images: [
|
|
9
|
+
{
|
|
10
|
+
id: 1,
|
|
11
|
+
caption: 'Caption 1',
|
|
12
|
+
img: { id: 1, alt: 'Alt text 1', img: { data: strapiMediaMock } },
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
id: 2,
|
|
16
|
+
caption: 'Caption 2',
|
|
17
|
+
img: { id: 2, alt: 'Alt text 2', img: { data: strapiMediaMock } },
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const setup = (props = {}) => {
|
|
24
|
+
const combinedProps = { ...defaultProps, ...props };
|
|
25
|
+
render(<SideBySideImages {...combinedProps} />);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
describe('The SideBySideImages component', () => {
|
|
29
|
+
it('displays the captions', () => {
|
|
30
|
+
setup();
|
|
31
|
+
|
|
32
|
+
expect(
|
|
33
|
+
screen.getByText(defaultProps.slice.images[0].caption)
|
|
34
|
+
).toBeInTheDocument();
|
|
35
|
+
expect(
|
|
36
|
+
screen.getByText(defaultProps.slice.images[1].caption)
|
|
37
|
+
).toBeInTheDocument();
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('displays the images', () => {
|
|
41
|
+
setup();
|
|
42
|
+
|
|
43
|
+
expect(screen.getAllByRole('img')[0]).toHaveAttribute(
|
|
44
|
+
'alt',
|
|
45
|
+
defaultProps.slice.images[0].img.alt
|
|
46
|
+
);
|
|
47
|
+
expect(screen.getAllByRole('img')[1]).toHaveAttribute(
|
|
48
|
+
'alt',
|
|
49
|
+
defaultProps.slice.images[1].img.alt
|
|
50
|
+
);
|
|
51
|
+
});
|
|
52
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Box,
|
|
3
|
+
DefaultSectionContainer,
|
|
4
|
+
Grid,
|
|
5
|
+
GridItem,
|
|
6
|
+
SimpleGrid,
|
|
7
|
+
Text,
|
|
8
|
+
Wrapper,
|
|
9
|
+
} from 'boemly';
|
|
10
|
+
import Image from 'next/image';
|
|
11
|
+
import StrapiImage from '@/models/strapi/StrapiImage';
|
|
12
|
+
import strapiMediaUrl from '@/utils/strapiMediaUrl';
|
|
13
|
+
|
|
14
|
+
export interface SideBySideImagesProps {
|
|
15
|
+
slice: {
|
|
16
|
+
images: {
|
|
17
|
+
id: number;
|
|
18
|
+
caption: string;
|
|
19
|
+
img: StrapiImage;
|
|
20
|
+
}[];
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export const SideBySideImages: React.FC<SideBySideImagesProps> = ({
|
|
24
|
+
slice,
|
|
25
|
+
}: SideBySideImagesProps) => (
|
|
26
|
+
<DefaultSectionContainer>
|
|
27
|
+
<Wrapper>
|
|
28
|
+
<Grid templateColumns="repeat(12, 1fr)" gap="4">
|
|
29
|
+
<GridItem colSpan={[12, null, null, 7]}>
|
|
30
|
+
<SimpleGrid
|
|
31
|
+
columns={[1, null, null, 2]}
|
|
32
|
+
gap={['12', null, null, '6']}
|
|
33
|
+
>
|
|
34
|
+
{slice.images.map((image) => (
|
|
35
|
+
<Box key={image.id}>
|
|
36
|
+
<Box height="md" position="relative" borderRadius="xl">
|
|
37
|
+
<Image
|
|
38
|
+
src={strapiMediaUrl(image.img.img, 'large')}
|
|
39
|
+
alt={image.img.alt}
|
|
40
|
+
fill
|
|
41
|
+
style={{
|
|
42
|
+
objectFit: image.img.objectFit || 'cover',
|
|
43
|
+
borderRadius: 'var(--boemly-radii-xl)',
|
|
44
|
+
}}
|
|
45
|
+
/>
|
|
46
|
+
</Box>
|
|
47
|
+
<Text mt="3" size="xsLowNormal">
|
|
48
|
+
{image.caption}
|
|
49
|
+
</Text>
|
|
50
|
+
</Box>
|
|
51
|
+
))}
|
|
52
|
+
</SimpleGrid>
|
|
53
|
+
</GridItem>
|
|
54
|
+
</Grid>
|
|
55
|
+
</Wrapper>
|
|
56
|
+
</DefaultSectionContainer>
|
|
57
|
+
);
|