@treely/strapi-slices 1.0.0 → 1.0.2
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/components/ContextProvider/ContextProvider.d.ts +8 -0
- package/dist/components/ContextProvider/index.d.ts +1 -0
- package/dist/components/CreditsAvailableBadge/CreditsAvailableBadge.d.ts +3 -2
- package/dist/components/FullScreenImage/FullScreenImage.d.ts +3 -2
- package/dist/components/FullScreenImage/ZoomableImage.d.ts +3 -2
- package/dist/components/MinimalProviders/MinimalProviders.d.ts +2 -2
- package/dist/components/SliceRenderer/SliceRenderer.d.ts +7 -5
- package/dist/components/SliceRenderer/index.d.ts +1 -2
- package/dist/components/StrapiLinkButton/StrapiLinkButton.d.ts +2 -2
- package/dist/components/StrapiLinkButtonWithIcon/StrapiLinkButtonWithIcon.d.ts +2 -2
- package/dist/components/portfolio/Contact/Contact.d.ts +3 -3
- package/dist/components/portfolio/DocumentsDownloadList/DocumentsDownloadList.d.ts +2 -2
- package/dist/components/portfolio/ProjectInfo/ProjectInfo.d.ts +2 -2
- package/dist/components/portfolio/SmallCheckout/SmallCheckout.d.ts +3 -2
- package/dist/icons/LinkedInIcon.d.ts +2 -1
- package/dist/slices/Blog/Blog.d.ts +3 -3
- package/dist/slices/Blog/styles.d.ts +4 -6
- package/dist/slices/BlogCards/BlogCards.d.ts +6 -6
- package/dist/slices/Comparison/Comparison.d.ts +3 -3
- package/dist/slices/Cta/Cta.d.ts +3 -3
- package/dist/slices/CtaOnly/CtaOnly.d.ts +2 -2
- package/dist/slices/CustomerStories/CustomerStories.d.ts +2 -2
- package/dist/slices/Facts/Facts.d.ts +2 -2
- package/dist/slices/FullWidthHighlightQuote/FullWidthHighlightQuote.d.ts +2 -2
- package/dist/slices/FullWidthImage/FullWidthImage.d.ts +3 -3
- package/dist/slices/FullWidthImageSlider/FullWidthImageSlider.d.ts +2 -2
- package/dist/slices/FullWidthImageSlider/styles.d.ts +10 -15
- package/dist/slices/FullWidthImageSlider/utils.test.d.ts +1 -0
- package/dist/slices/Glossary/Glossary.d.ts +3 -3
- package/dist/slices/Hero/Hero.d.ts +4 -4
- package/dist/slices/IconGrid/IconGrid.d.ts +3 -3
- package/dist/slices/ImageGrid/ImageGrid.d.ts +4 -4
- package/dist/slices/ImageTextSequence/ImageTextSequence.d.ts +4 -4
- package/dist/slices/LeftTextRightCard/LeftTextRightCard.d.ts +4 -4
- package/dist/slices/LinkCardsGrid/LinkCardsGrid.d.ts +2 -2
- package/dist/slices/LogoGridWithText/LogoGridWithText.d.ts +3 -3
- package/dist/slices/MapHero/MapHero.d.ts +3 -3
- package/dist/slices/MapHero/styles.d.ts +10 -15
- package/dist/slices/ProjectFacts/ProjectFacts.d.ts +4 -4
- package/dist/slices/ProjectsGrid/ProjectsGrid.d.ts +2 -2
- package/dist/slices/ProjectsMap/MapMarker.d.ts +3 -2
- package/dist/slices/ProjectsMap/ProjectsMap.d.ts +2 -3
- package/dist/slices/ProjectsMap/mapboxStyle.d.ts +2 -0
- package/dist/slices/QAndA/QAndA.d.ts +3 -3
- package/dist/slices/QuoteCards/QuoteCards.d.ts +5 -5
- package/dist/slices/RichTextSection/RichTextSection.d.ts +1 -1
- package/dist/slices/SideBySideImages/SideBySideImages.d.ts +2 -2
- package/dist/slices/SmallHero/SmallHero.d.ts +3 -3
- package/dist/slices/Steps/Steps.d.ts +4 -4
- package/dist/slices/TextCardGrid/TextCardGrid.d.ts +4 -4
- package/dist/slices/TextCarousel/TextCarousel.d.ts +4 -4
- package/dist/slices/TextCarousel/styles.d.ts +6 -9
- package/dist/slices/TextWithCard/TextWithCard.d.ts +3 -3
- package/dist/slices/TextWithTextCards/TextWithTextCards.d.ts +5 -5
- package/dist/slices/Video/Video.d.ts +1 -1
- package/dist/strapi-slices.cjs.development.js +4639 -35
- 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 +4629 -35
- package/dist/strapi-slices.esm.js.map +1 -1
- package/dist/test/integrationMocks/fpmProjectMock.d.ts +1 -1
- package/dist/test/mocks/portfolioProjectMock.d.ts +1 -1
- package/dist/test/storybookMocks/storybookStrapiMedia.d.ts +2 -2
- package/dist/test/strapiMocks/minimalGlobalData.d.ts +2 -2
- package/dist/test/strapiMocks/strapiBlogPost.d.ts +2 -2
- package/dist/test/strapiMocks/strapiContact.d.ts +1 -1
- package/dist/test/strapiMocks/strapiCustomerStory.d.ts +2 -2
- package/dist/test/strapiMocks/strapiHeroCard.d.ts +1 -1
- package/dist/test/strapiMocks/strapiLinkPage.d.ts +2 -2
- package/dist/test/strapiMocks/strapiMedia.d.ts +2 -2
- package/dist/test/strapiMocks/strapiMetadata.d.ts +1 -1
- package/dist/test/strapiMocks/strapiPage.d.ts +2 -2
- package/dist/test/strapiMocks/strapiPortfolioCard.d.ts +1 -1
- package/dist/test/strapiMocks/strapiPortfolioMock.d.ts +2 -2
- package/dist/test/strapiMocks/strapiProject.d.ts +2 -2
- package/dist/test/strapiMocks/strapiProjectCard.d.ts +1 -1
- package/dist/test/strapiMocks/strapiQuoteCard.d.ts +1 -1
- package/dist/utils/convertAreaM2ToHa.test.d.ts +1 -0
- package/dist/utils/convertToKebabCase.test.d.ts +1 -0
- package/dist/utils/getTimeSpanInYears.test.d.ts +1 -0
- package/dist/utils/mergeBoundingBoxes.d.ts +1 -1
- package/dist/utils/mergeBoundingBoxes.test.d.ts +1 -0
- package/dist/utils/strapiLinkUrl.d.ts +1 -1
- package/dist/utils/strapiLinkUrl.test.d.ts +1 -0
- package/dist/utils/strapiMediaUrl.d.ts +3 -3
- package/dist/utils/strapiMediaUrl.test.d.ts +1 -0
- package/package.json +7 -4
- package/src/components/ContextProvider/ContextProvider.tsx +40 -0
- package/src/components/ContextProvider/index.ts +1 -0
- package/src/components/CreditsAvailableBadge/CreditsAvailableBadge.test.tsx +3 -2
- package/src/components/CreditsAvailableBadge/CreditsAvailableBadge.tsx +4 -3
- package/src/components/FullScreenImage/FullScreenImage.test.tsx +3 -2
- package/src/components/FullScreenImage/FullScreenImage.tsx +2 -2
- package/src/components/FullScreenImage/ZoomableImage.tsx +2 -2
- package/src/components/MinimalProviders/MinimalProviders.tsx +4 -3
- package/src/components/SliceRenderer/SliceRenderer.test.tsx +3 -2
- package/src/components/SliceRenderer/SliceRenderer.tsx +45 -40
- package/src/components/SliceRenderer/index.ts +1 -3
- package/src/components/StrapiLinkButton/StrapiLinkButton.test.tsx +2 -1
- package/src/components/StrapiLinkButton/StrapiLinkButton.tsx +10 -13
- package/src/components/StrapiLinkButtonWithIcon/StrapiLinkButtonWithIcon.test.tsx +2 -1
- package/src/components/StrapiLinkButtonWithIcon/StrapiLinkButtonWithIcon.tsx +3 -2
- package/src/components/portfolio/Contact/Contact.test.tsx +4 -3
- package/src/components/portfolio/Contact/Contact.tsx +5 -4
- package/src/components/portfolio/DocumentsDownloadList/DocumentsDownloadList.test.tsx +2 -1
- package/src/components/portfolio/DocumentsDownloadList/DocumentsDownloadList.tsx +7 -4
- package/src/components/portfolio/ProjectInfo/ProjectInfo.test.tsx +3 -2
- package/src/components/portfolio/ProjectInfo/ProjectInfo.tsx +10 -9
- package/src/components/portfolio/SmallCheckout/SmallCheckout.test.tsx +2 -1
- package/src/components/portfolio/SmallCheckout/SmallCheckout.tsx +35 -32
- package/src/constants/globalStyle.ts +4 -0
- package/src/icons/LinkedInIcon.tsx +2 -0
- package/src/rootMessages.de.ts +12 -12
- package/src/rootMessages.en.ts +12 -12
- package/src/slices/Blog/Blog.test.tsx +5 -4
- package/src/slices/Blog/Blog.tsx +63 -65
- package/src/slices/Blog/styles.ts +8 -4
- package/src/slices/BlogCards/BlogCards.stories.tsx +5 -4
- package/src/slices/BlogCards/BlogCards.test.tsx +5 -4
- package/src/slices/BlogCards/BlogCards.tsx +67 -70
- package/src/slices/Comparison/Comparison.stories.tsx +3 -2
- package/src/slices/Comparison/Comparison.test.tsx +4 -3
- package/src/slices/Comparison/Comparison.tsx +8 -7
- package/src/slices/Comparison/Icon.test.tsx +3 -2
- package/src/slices/Comparison/Icon.tsx +1 -0
- package/src/slices/Cta/Cta.stories.tsx +3 -2
- package/src/slices/Cta/Cta.test.tsx +4 -3
- package/src/slices/Cta/Cta.tsx +8 -7
- package/src/slices/CtaOnly/CtaOnly.stories.tsx +2 -1
- package/src/slices/CtaOnly/CtaOnly.test.tsx +2 -1
- package/src/slices/CtaOnly/CtaOnly.tsx +3 -2
- package/src/slices/CustomerStories/CustomerStories.stories.tsx +3 -2
- package/src/slices/CustomerStories/CustomerStories.test.tsx +4 -3
- package/src/slices/CustomerStories/CustomerStories.tsx +64 -59
- package/src/slices/Facts/Facts.stories.tsx +2 -1
- package/src/slices/Facts/Facts.test.tsx +2 -1
- package/src/slices/Facts/Facts.tsx +3 -2
- package/src/slices/FullWidthHighlightQuote/FullWidthHighlightQuote.stories.tsx +3 -2
- package/src/slices/FullWidthHighlightQuote/FullWidthHighlightQuote.test.tsx +3 -2
- package/src/slices/FullWidthHighlightQuote/FullWidthHighlightQuote.tsx +3 -2
- package/src/slices/FullWidthImage/FullWidthImage.stories.tsx +3 -2
- package/src/slices/FullWidthImage/FullWidthImage.test.tsx +3 -2
- package/src/slices/FullWidthImage/FullWidthImage.tsx +10 -9
- package/src/slices/FullWidthImageSlider/FullWidthImageSlider.stories.tsx +3 -2
- package/src/slices/FullWidthImageSlider/FullWidthImageSlider.test.tsx +3 -2
- package/src/slices/FullWidthImageSlider/FullWidthImageSlider.tsx +5 -5
- package/src/slices/FullWidthImageSlider/styles.ts +11 -8
- package/src/slices/Glossary/Glossary.stories.tsx +2 -1
- package/src/slices/Glossary/Glossary.test.tsx +2 -2
- package/src/slices/Glossary/Glossary.tsx +6 -6
- package/src/slices/Hero/Hero.stories.tsx +3 -2
- package/src/slices/Hero/Hero.test.tsx +3 -2
- package/src/slices/Hero/Hero.tsx +38 -14
- package/src/slices/IconGrid/IconGrid.stories.tsx +3 -2
- package/src/slices/IconGrid/IconGrid.test.tsx +3 -2
- package/src/slices/IconGrid/IconGrid.tsx +18 -9
- package/src/slices/ImageGrid/ImageGrid.stories.tsx +4 -3
- package/src/slices/ImageGrid/ImageGrid.test.tsx +3 -2
- package/src/slices/ImageGrid/ImageGrid.tsx +12 -9
- package/src/slices/ImageTextSequence/ImageTextSequence.stories.tsx +3 -2
- package/src/slices/ImageTextSequence/ImageTextSequence.test.tsx +3 -2
- package/src/slices/ImageTextSequence/ImageTextSequence.tsx +28 -19
- package/src/slices/LeftTextRightCard/LeftTextRightCard.stories.tsx +3 -2
- package/src/slices/LeftTextRightCard/LeftTextRightCard.test.tsx +3 -2
- package/src/slices/LeftTextRightCard/LeftTextRightCard.tsx +7 -6
- package/src/slices/LinkCardsGrid/LinkCardsGrid.stories.tsx +2 -1
- package/src/slices/LinkCardsGrid/LinkCardsGrid.test.tsx +2 -1
- package/src/slices/LinkCardsGrid/LinkCardsGrid.tsx +45 -43
- package/src/slices/LogoGridWithText/LogoGridWithText.stories.tsx +3 -2
- package/src/slices/LogoGridWithText/LogoGridWithText.test.tsx +3 -2
- package/src/slices/LogoGridWithText/LogoGridWithText.tsx +8 -8
- package/src/slices/MapHero/MapHero.stories.tsx +3 -2
- package/src/slices/MapHero/MapHero.test.tsx +3 -2
- package/src/slices/MapHero/MapHero.tsx +6 -5
- package/src/slices/MapHero/styles.ts +7 -6
- package/src/slices/ProjectFacts/ProjectFacts.stories.tsx +4 -3
- package/src/slices/ProjectFacts/ProjectFacts.test.tsx +3 -2
- package/src/slices/ProjectFacts/ProjectFacts.tsx +8 -7
- package/src/slices/ProjectsGrid/ProjectsGrid.stories.tsx +4 -3
- package/src/slices/ProjectsGrid/ProjectsGrid.test.tsx +3 -2
- package/src/slices/ProjectsGrid/ProjectsGrid.tsx +4 -3
- package/src/slices/ProjectsMap/MapMarker.test.tsx +3 -2
- package/src/slices/ProjectsMap/MapMarker.tsx +6 -4
- package/src/slices/ProjectsMap/ProjectsMap.stories.tsx +4 -3
- package/src/slices/ProjectsMap/ProjectsMap.test.tsx +4 -3
- package/src/slices/ProjectsMap/ProjectsMap.tsx +49 -38
- package/src/slices/ProjectsMap/mapboxStyle.ts +670 -0
- package/src/slices/QAndA/QAndA.stories.tsx +3 -2
- package/src/slices/QAndA/QAndA.test.tsx +3 -2
- package/src/slices/QAndA/QAndA.tsx +7 -6
- package/src/slices/QuoteCards/QuoteCards.stories.tsx +3 -2
- package/src/slices/QuoteCards/QuoteCards.test.tsx +5 -4
- package/src/slices/QuoteCards/QuoteCards.tsx +15 -13
- package/src/slices/RichTextSection/RichTextSection.stories.tsx +2 -1
- package/src/slices/RichTextSection/RichTextSection.test.tsx +2 -1
- package/src/slices/RichTextSection/RichTextSection.tsx +1 -0
- package/src/slices/ShopCheckout/ShopCheckout.stories.tsx +1 -0
- package/src/slices/ShopCheckout/ShopCheckout.test.tsx +3 -2
- package/src/slices/ShopCheckout/ShopCheckout.tsx +36 -29
- package/src/slices/SideBySideImages/SideBySideImages.stories.tsx +3 -2
- package/src/slices/SideBySideImages/SideBySideImages.test.tsx +3 -2
- package/src/slices/SideBySideImages/SideBySideImages.tsx +3 -2
- package/src/slices/SmallHero/SmallHero.stories.tsx +3 -2
- package/src/slices/SmallHero/SmallHero.test.tsx +3 -2
- package/src/slices/SmallHero/SmallHero.tsx +14 -7
- package/src/slices/Steps/Steps.stories.tsx +3 -2
- package/src/slices/Steps/Steps.test.tsx +3 -2
- package/src/slices/Steps/Steps.tsx +46 -26
- package/src/slices/TextCardGrid/TextCardGrid.stories.tsx +3 -2
- package/src/slices/TextCardGrid/TextCardGrid.test.tsx +3 -2
- package/src/slices/TextCardGrid/TextCardGrid.tsx +6 -5
- package/src/slices/TextCarousel/TextCarousel.stories.tsx +3 -2
- package/src/slices/TextCarousel/TextCarousel.test.tsx +4 -3
- package/src/slices/TextCarousel/TextCarousel.tsx +6 -6
- package/src/slices/TextCarousel/styles.ts +9 -6
- package/src/slices/TextWithCard/TextWithCard.stories.tsx +3 -2
- package/src/slices/TextWithCard/TextWithCard.test.tsx +3 -2
- package/src/slices/TextWithCard/TextWithCard.tsx +5 -4
- package/src/slices/TextWithTextCards/TextWithTextCards.stories.tsx +3 -2
- package/src/slices/TextWithTextCards/TextWithTextCards.test.tsx +4 -3
- package/src/slices/TextWithTextCards/TextWithTextCards.tsx +22 -11
- package/src/slices/Video/Video.stories.tsx +2 -1
- package/src/slices/Video/Video.test.tsx +2 -1
- package/src/slices/Video/Video.tsx +1 -0
- package/src/test/integrationMocks/fpmProjectMock.ts +1 -1
- package/src/test/mocks/portfolioProjectMock.ts +3 -3
- package/src/test/storybookMocks/storybookStrapiMedia.ts +2 -2
- package/src/test/strapiMocks/minimalGlobalData.ts +2 -2
- package/src/test/strapiMocks/strapiBlogPost.ts +2 -2
- package/src/test/strapiMocks/strapiContact.ts +1 -1
- package/src/test/strapiMocks/strapiCustomerStory.ts +2 -2
- package/src/test/strapiMocks/strapiHeroCard.ts +1 -1
- package/src/test/strapiMocks/strapiLinkPage.ts +2 -2
- package/src/test/strapiMocks/strapiMedia.ts +2 -2
- package/src/test/strapiMocks/strapiMetadata.ts +1 -1
- package/src/test/strapiMocks/strapiPage.ts +2 -2
- package/src/test/strapiMocks/strapiPortfolioCard.ts +1 -1
- package/src/test/strapiMocks/strapiPortfolioMock.ts +2 -2
- package/src/test/strapiMocks/strapiProject.ts +3 -3
- package/src/test/strapiMocks/strapiProjectCard.ts +1 -1
- package/src/test/strapiMocks/strapiQuoteCard.ts +1 -1
- package/src/test/testUtils.tsx +3 -3
- package/src/utils/mergeBoundingBoxes.ts +1 -1
- package/src/utils/strapiLinkUrl.test.ts +1 -1
- package/src/utils/strapiLinkUrl.ts +1 -1
- package/src/utils/strapiMediaUrl.test.ts +2 -2
- package/src/utils/strapiMediaUrl.ts +4 -4
- package/dist/slices/BlogCards/BlogCards.stories.d.ts +0 -5
- package/dist/slices/Comparison/Comparison.stories.d.ts +0 -6
- package/dist/slices/Cta/Cta.stories.d.ts +0 -9
- package/dist/slices/CtaOnly/CtaOnly.stories.d.ts +0 -3
- package/dist/slices/CustomerStories/CustomerStories.stories.d.ts +0 -3
- package/dist/slices/Facts/Facts.stories.d.ts +0 -7
- package/dist/slices/FullWidthHighlightQuote/FullWidthHighlightQuote.stories.d.ts +0 -4
- package/dist/slices/FullWidthImage/FullWidthImage.stories.d.ts +0 -5
- package/dist/slices/FullWidthImage/styles.d.ts +0 -5
- package/dist/slices/FullWidthImageSlider/FullWidthImageSlider.stories.d.ts +0 -3
- package/dist/slices/Glossary/Glossary.stories.d.ts +0 -3
- package/dist/slices/Hero/Hero.stories.d.ts +0 -9
- package/dist/slices/Hero/styles.d.ts +0 -17
- package/dist/slices/IconGrid/IconGrid.stories.d.ts +0 -5
- package/dist/slices/IconGrid/styles.d.ts +0 -9
- package/dist/slices/ImageGrid/ImageGrid.stories.d.ts +0 -5
- package/dist/slices/ImageGrid/styles.d.ts +0 -5
- package/dist/slices/ImageTextSequence/ImageTextSequence.stories.d.ts +0 -7
- package/dist/slices/ImageTextSequence/styles.d.ts +0 -13
- package/dist/slices/LeftTextRightCard/LeftTextRightCard.stories.d.ts +0 -8
- package/dist/slices/LinkCardsGrid/LinkCardsGrid.stories.d.ts +0 -5
- package/dist/slices/LogoGridWithText/LogoGridWithText.stories.d.ts +0 -6
- package/dist/slices/LogoGridWithText/styles.d.ts +0 -5
- package/dist/slices/MapHero/MapHero.stories.d.ts +0 -8
- package/dist/slices/ProjectFacts/ProjectFacts.stories.d.ts +0 -6
- package/dist/slices/ProjectsGrid/ProjectsGrid.stories.d.ts +0 -3
- package/dist/slices/ProjectsMap/ProjectsMap.stories.d.ts +0 -6
- package/dist/slices/QAndA/QAndA.stories.d.ts +0 -7
- package/dist/slices/QuoteCards/QuoteCards.stories.d.ts +0 -8
- package/dist/slices/QuoteCards/styles.d.ts +0 -13
- package/dist/slices/RichTextSection/RichTextSection.stories.d.ts +0 -3
- package/dist/slices/ShopCheckout/ShopCheckout.stories.d.ts +0 -7
- package/dist/slices/SideBySideImages/SideBySideImages.stories.d.ts +0 -3
- package/dist/slices/SmallHero/SmallHero.stories.d.ts +0 -11
- package/dist/slices/SmallHero/styles.d.ts +0 -9
- package/dist/slices/Steps/Steps.stories.d.ts +0 -7
- package/dist/slices/Steps/styles.d.ts +0 -25
- package/dist/slices/TextCardGrid/TextCardGrid.stories.d.ts +0 -8
- package/dist/slices/TextCarousel/TextCarousel.stories.d.ts +0 -6
- package/dist/slices/TextWithCard/TextWithCard.stories.d.ts +0 -9
- package/dist/slices/TextWithTextCards/TextWithTextCards.stories.d.ts +0 -7
- package/dist/slices/TextWithTextCards/styles.d.ts +0 -5
- package/dist/slices/Video/Video.stories.d.ts +0 -3
- package/src/slices/FullWidthImage/styles.ts +0 -17
- package/src/slices/Hero/styles.ts +0 -52
- package/src/slices/IconGrid/styles.ts +0 -21
- package/src/slices/ImageGrid/styles.ts +0 -12
- package/src/slices/ImageTextSequence/styles.ts +0 -33
- package/src/slices/LogoGridWithText/styles.ts +0 -13
- package/src/slices/QuoteCards/styles.ts +0 -17
- package/src/slices/SmallHero/styles.ts +0 -39
- package/src/slices/Steps/styles.ts +0 -64
- package/src/slices/TextWithTextCards/styles.ts +0 -26
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React, { useContext } from 'react';
|
|
1
2
|
import {
|
|
2
3
|
Box,
|
|
3
4
|
Container,
|
|
@@ -8,17 +9,17 @@ import {
|
|
|
8
9
|
SimpleGrid,
|
|
9
10
|
Spacer,
|
|
10
11
|
} from 'boemly';
|
|
11
|
-
import { FormattedMessage, useIntl } from 'react-intl';
|
|
12
12
|
import Image from 'next/image';
|
|
13
|
-
import convertAreaM2ToHa from '
|
|
14
|
-
import convertCo2AmountKgToTons from '
|
|
15
|
-
import CreditsAvailableBadge from '
|
|
16
|
-
import PortfolioProject from '
|
|
13
|
+
import convertAreaM2ToHa from '../../../utils/convertAreaM2ToHa';
|
|
14
|
+
import convertCo2AmountKgToTons from '../../../utils/convertCo2AmountKgToTons';
|
|
15
|
+
import CreditsAvailableBadge from '../../../components/CreditsAvailableBadge';
|
|
16
|
+
import PortfolioProject from '../../../models/PortfolioProject';
|
|
17
17
|
import {
|
|
18
18
|
FORMAT_AS_HECTARE_CONFIG,
|
|
19
19
|
FORMAT_AS_PERCENT_CONFIG,
|
|
20
|
-
} from '
|
|
21
|
-
import getTimeSpanInYears from '
|
|
20
|
+
} from '../../../constants/formatter';
|
|
21
|
+
import getTimeSpanInYears from '../../../utils/getTimeSpanInYears';
|
|
22
|
+
import { IntlContext } from '../../ContextProvider';
|
|
22
23
|
|
|
23
24
|
export interface ProjectInfoProps {
|
|
24
25
|
project: PortfolioProject;
|
|
@@ -40,12 +41,12 @@ export const ProjectInfo: React.FC<ProjectInfoProps> = ({
|
|
|
40
41
|
project,
|
|
41
42
|
subtitles,
|
|
42
43
|
}: ProjectInfoProps) => {
|
|
43
|
-
const { formatMessage, formatNumber, formatDate } =
|
|
44
|
+
const { formatMessage, formatNumber, formatDate } = useContext(IntlContext);
|
|
44
45
|
|
|
45
46
|
return (
|
|
46
47
|
<Container p="2" width="full">
|
|
47
48
|
<Heading size="xl" textAlign="left">
|
|
48
|
-
|
|
49
|
+
{formatMessage({ id: 'features.projectInfo.projectInfo.value' })}
|
|
49
50
|
</Heading>
|
|
50
51
|
|
|
51
52
|
<Spacer height="8" />
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, screen, userEvent, waitFor } from '../../../test/testUtils';
|
|
2
3
|
import { pushSpy } from '../../../../__mocks__/next/router';
|
|
3
4
|
|
|
4
5
|
import SmallCheckout from '.';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import React, { useContext, useCallback } from 'react';
|
|
2
|
+
import { CDN_URI, FPM_API_URI } from '../../../constants/api';
|
|
3
|
+
import StrapiLinkButton from '../../../components/StrapiLinkButton';
|
|
3
4
|
import {
|
|
4
5
|
BoemlyFormControl,
|
|
5
6
|
Box,
|
|
@@ -19,14 +20,13 @@ import {
|
|
|
19
20
|
FormikProps,
|
|
20
21
|
} from 'formik';
|
|
21
22
|
import { useRouter } from 'next/router';
|
|
22
|
-
import { FormattedMessage, useIntl } from 'react-intl';
|
|
23
23
|
import Image from 'next/image';
|
|
24
|
-
import
|
|
25
|
-
import StrapiLink from '@/models/strapi/StrapiLink';
|
|
24
|
+
import StrapiLink from '../../../models/strapi/StrapiLink';
|
|
26
25
|
import {
|
|
27
26
|
MAXIMUM_CONTRIBUTION_VALUE_IN_MONEY,
|
|
28
27
|
MINIMUM_CONTRIBUTION_VALUE_IN_MONEY,
|
|
29
|
-
} from '
|
|
28
|
+
} from '../../../constants/domain';
|
|
29
|
+
import { IntlContext } from '../../ContextProvider';
|
|
30
30
|
|
|
31
31
|
export interface SmallCheckoutProps {
|
|
32
32
|
batchId: string;
|
|
@@ -55,32 +55,35 @@ const SmallCheckout = ({
|
|
|
55
55
|
subtitle,
|
|
56
56
|
button,
|
|
57
57
|
}: SmallCheckoutProps) => {
|
|
58
|
-
const { formatNumber, formatMessage } =
|
|
58
|
+
const { formatNumber, formatMessage, locale } = useContext(IntlContext);
|
|
59
59
|
const { push } = useRouter();
|
|
60
60
|
|
|
61
|
-
const validateForm = useCallback(
|
|
62
|
-
|
|
61
|
+
const validateForm = useCallback(
|
|
62
|
+
(values: SmallCheckoutForm) => {
|
|
63
|
+
const errors: FormikErrors<SmallCheckoutForm> = {};
|
|
63
64
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
65
|
+
if (!values.contributionValueCurrency) {
|
|
66
|
+
errors.contributionValueCurrency = formatMessage({
|
|
67
|
+
id: 'portfolio.smallCheckout.contributionValueCurrency.validation.empty',
|
|
68
|
+
});
|
|
69
|
+
} else if (
|
|
70
|
+
values.contributionValueCurrency < MINIMUM_CONTRIBUTION_VALUE_IN_MONEY
|
|
71
|
+
) {
|
|
72
|
+
errors.contributionValueCurrency = formatMessage({
|
|
73
|
+
id: `portfolio.smallCheckout.contributionValueCurrency.validation.tooLow.${currency}`,
|
|
74
|
+
});
|
|
75
|
+
} else if (
|
|
76
|
+
values.contributionValueCurrency > MAXIMUM_CONTRIBUTION_VALUE_IN_MONEY
|
|
77
|
+
) {
|
|
78
|
+
errors.contributionValueCurrency = formatMessage({
|
|
79
|
+
id: 'portfolio.smallCheckout.contributionValueCurrency.validation.tooHigh',
|
|
80
|
+
});
|
|
81
|
+
}
|
|
81
82
|
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
return errors;
|
|
84
|
+
},
|
|
85
|
+
[locale]
|
|
86
|
+
);
|
|
84
87
|
|
|
85
88
|
const onSubmit = async ({ contributionValueCurrency }: SmallCheckoutForm) => {
|
|
86
89
|
push(
|
|
@@ -158,9 +161,9 @@ const SmallCheckout = ({
|
|
|
158
161
|
})}
|
|
159
162
|
rightAddonsOrElements={[
|
|
160
163
|
<InputRightAddon key="currencyUnit">
|
|
161
|
-
|
|
162
|
-
id
|
|
163
|
-
|
|
164
|
+
{formatMessage({
|
|
165
|
+
id: `portfolio.smallCheckout.contributionValueCurrency.unit.${currency}`,
|
|
166
|
+
})}
|
|
164
167
|
</InputRightAddon>,
|
|
165
168
|
]}
|
|
166
169
|
isInvalid={
|
|
@@ -212,7 +215,7 @@ const SmallCheckout = ({
|
|
|
212
215
|
<Spacer height="4" />
|
|
213
216
|
|
|
214
217
|
<Button type="submit" width="full">
|
|
215
|
-
|
|
218
|
+
{formatMessage({ id: 'portfolio.smallCheckout.submitButton' })}
|
|
216
219
|
</Button>
|
|
217
220
|
</Form>
|
|
218
221
|
)}
|
package/src/rootMessages.de.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import comparisonMessagesDe from '
|
|
2
|
-
import ctaMessagesDe from '
|
|
3
|
-
import customerStoriesDe from '
|
|
4
|
-
import glossaryMessagesDe from '
|
|
5
|
-
import projectFactsMessagesDe from '
|
|
6
|
-
import projectsMapMessagesDe from '
|
|
7
|
-
import shopCheckoutMessagesDe from '
|
|
8
|
-
import creditsAvailableBadgeMessagesDe from '
|
|
9
|
-
import portfolioDocumentsDownloadListMessagesDe from '
|
|
10
|
-
import portfolioProjectInfoMessagesDe from '
|
|
11
|
-
import portfolioSmallCheckoutMessagesDe from '
|
|
1
|
+
import comparisonMessagesDe from './slices/Comparison/messages.de';
|
|
2
|
+
import ctaMessagesDe from './slices/Cta/messages.de';
|
|
3
|
+
import customerStoriesDe from './slices/CustomerStories/messages.de';
|
|
4
|
+
import glossaryMessagesDe from './slices/Glossary/messages.de';
|
|
5
|
+
import projectFactsMessagesDe from './slices/ProjectFacts/messages.de';
|
|
6
|
+
import projectsMapMessagesDe from './slices/ProjectsMap/messages.de';
|
|
7
|
+
import shopCheckoutMessagesDe from './slices/ShopCheckout/messages.de';
|
|
8
|
+
import creditsAvailableBadgeMessagesDe from './components/CreditsAvailableBadge/messages.de';
|
|
9
|
+
import portfolioDocumentsDownloadListMessagesDe from './components/portfolio/DocumentsDownloadList/messages.de';
|
|
10
|
+
import portfolioProjectInfoMessagesDe from './components/portfolio/ProjectInfo/messages.de';
|
|
11
|
+
import portfolioSmallCheckoutMessagesDe from './components/portfolio/SmallCheckout/messages.de';
|
|
12
12
|
|
|
13
13
|
import unitMessagesDe from './unit.messages.en';
|
|
14
14
|
|
|
@@ -22,7 +22,7 @@ const rootMessagesDe = {
|
|
|
22
22
|
...portfolioSmallCheckoutMessagesDe,
|
|
23
23
|
|
|
24
24
|
//
|
|
25
|
-
//
|
|
25
|
+
// Slices
|
|
26
26
|
//
|
|
27
27
|
...comparisonMessagesDe,
|
|
28
28
|
...ctaMessagesDe,
|
package/src/rootMessages.en.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import comparisonMessagesEn from '
|
|
2
|
-
import ctaMessagesEn from '
|
|
3
|
-
import customerStoriesEn from '
|
|
4
|
-
import glossaryMessagesEn from '
|
|
5
|
-
import projectFactsMessagesEn from '
|
|
6
|
-
import projectsMapMessagesEn from '
|
|
7
|
-
import shopCheckoutMessagesEn from '
|
|
8
|
-
import creditsAvailableBadgeMessagesEn from '
|
|
9
|
-
import portfolioDocumentsDownloadListMessagesEn from '
|
|
10
|
-
import portfolioProjectInfoMessagesEn from '
|
|
11
|
-
import portfolioSmallCheckoutMessagesEn from '
|
|
1
|
+
import comparisonMessagesEn from './slices/Comparison/messages.en';
|
|
2
|
+
import ctaMessagesEn from './slices/Cta/messages.en';
|
|
3
|
+
import customerStoriesEn from './slices/CustomerStories/messages.en';
|
|
4
|
+
import glossaryMessagesEn from './slices/Glossary/messages.en';
|
|
5
|
+
import projectFactsMessagesEn from './slices/ProjectFacts/messages.en';
|
|
6
|
+
import projectsMapMessagesEn from './slices/ProjectsMap/messages.en';
|
|
7
|
+
import shopCheckoutMessagesEn from './slices/ShopCheckout/messages.en';
|
|
8
|
+
import creditsAvailableBadgeMessagesEn from './components/CreditsAvailableBadge/messages.en';
|
|
9
|
+
import portfolioDocumentsDownloadListMessagesEn from './components/portfolio/DocumentsDownloadList/messages.en';
|
|
10
|
+
import portfolioProjectInfoMessagesEn from './components/portfolio/ProjectInfo/messages.en';
|
|
11
|
+
import portfolioSmallCheckoutMessagesEn from './components/portfolio/SmallCheckout/messages.en';
|
|
12
12
|
|
|
13
13
|
import unitMessagesEn from './unit.messages.en';
|
|
14
14
|
|
|
@@ -22,7 +22,7 @@ const rootMessagesEn = {
|
|
|
22
22
|
...portfolioSmallCheckoutMessagesEn,
|
|
23
23
|
|
|
24
24
|
//
|
|
25
|
-
//
|
|
25
|
+
// Slices
|
|
26
26
|
//
|
|
27
27
|
...comparisonMessagesEn,
|
|
28
28
|
...ctaMessagesEn,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, screen } from '../../test/testUtils';
|
|
3
|
+
import { strapiBlogPostMock } from '../../test/strapiMocks/strapiBlogPost';
|
|
4
|
+
import { strapiMediaMock } from '../../test/strapiMocks/strapiMedia';
|
|
5
|
+
import { mergeDeep } from '../../utils/mergeDeep';
|
|
5
6
|
import { BlogProps } from './Blog';
|
|
6
7
|
import Blog from '.';
|
|
7
8
|
|
package/src/slices/Blog/Blog.tsx
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React, { useContext } from 'react';
|
|
1
2
|
import {
|
|
2
3
|
Box,
|
|
3
4
|
DatePersonPair,
|
|
@@ -9,12 +10,12 @@ import {
|
|
|
9
10
|
Wrapper,
|
|
10
11
|
} from 'boemly';
|
|
11
12
|
import Image from 'next/image';
|
|
12
|
-
import { useIntl } from 'react-intl';
|
|
13
13
|
import Link from 'next/link';
|
|
14
|
-
import StrapiBlogPost from '
|
|
15
|
-
import strapiMediaUrl from '
|
|
16
|
-
import IStrapiData from '
|
|
14
|
+
import StrapiBlogPost from '../../models/strapi/StrapiBlogPost';
|
|
15
|
+
import strapiMediaUrl from '../../utils/strapiMediaUrl';
|
|
16
|
+
import IStrapiData from '../../models/strapi/IStrapiData';
|
|
17
17
|
import { BlogItemContainer, ImageContainer } from './styles';
|
|
18
|
+
import { IntlContext } from '../../components/ContextProvider';
|
|
18
19
|
|
|
19
20
|
export interface BlogProps {
|
|
20
21
|
slice: {
|
|
@@ -24,7 +25,7 @@ export interface BlogProps {
|
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
export const Blog: React.FC<BlogProps> = ({ slice, blogPosts }: BlogProps) => {
|
|
27
|
-
const { formatDate } =
|
|
28
|
+
const { formatDate } = useContext(IntlContext);
|
|
28
29
|
const sortedBlogPosts = slice.blog_posts.sort(
|
|
29
30
|
(a, b) =>
|
|
30
31
|
new Date(b.attributes.createdAt).getTime() -
|
|
@@ -42,69 +43,66 @@ export const Blog: React.FC<BlogProps> = ({ slice, blogPosts }: BlogProps) => {
|
|
|
42
43
|
return null;
|
|
43
44
|
}
|
|
44
45
|
return (
|
|
45
|
-
<
|
|
46
|
-
href={`/blog/${blogPost.attributes.slug}`}
|
|
47
|
-
passHref
|
|
46
|
+
<BlogItemContainer
|
|
48
47
|
key={blogPost.attributes.slug}
|
|
49
|
-
|
|
48
|
+
as={Link}
|
|
49
|
+
href={`/blog/${blogPost.attributes.slug}`}
|
|
50
50
|
>
|
|
51
|
-
<
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
name
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
51
|
+
<ImageContainer>
|
|
52
|
+
<Image
|
|
53
|
+
src={strapiMediaUrl(blogPost.attributes.img.img, 'large')}
|
|
54
|
+
alt={blogPost.attributes.img.alt}
|
|
55
|
+
fill
|
|
56
|
+
style={{
|
|
57
|
+
objectFit: blogPost.attributes.img.objectFit || 'cover',
|
|
58
|
+
}}
|
|
59
|
+
/>
|
|
60
|
+
</ImageContainer>
|
|
61
|
+
<Box px="2" py="8">
|
|
62
|
+
{blogPost.attributes.category && (
|
|
63
|
+
<Text size="smMonoUppercase" color="primary.800" mb="2">
|
|
64
|
+
{blogPost.attributes.category.data.attributes.name}
|
|
65
|
+
</Text>
|
|
66
|
+
)}
|
|
67
|
+
<Heading size="lg">{blogPost.attributes.title}</Heading>
|
|
68
|
+
{blogPost.attributes.teaser && (
|
|
69
|
+
<Text size="mdRegularNormal" mt="2">
|
|
70
|
+
{blogPost.attributes.teaser}
|
|
71
|
+
</Text>
|
|
72
|
+
)}
|
|
73
|
+
<Spacer height="4" />
|
|
74
|
+
<DatePersonPair
|
|
75
|
+
date={formatDate(blogPost.attributes.createdAt)}
|
|
76
|
+
person={
|
|
77
|
+
blogPost.attributes.author
|
|
78
|
+
? {
|
|
79
|
+
name: blogPost.attributes.author.data.attributes
|
|
80
|
+
.name,
|
|
81
|
+
image: (
|
|
82
|
+
<Image
|
|
83
|
+
src={strapiMediaUrl(
|
|
84
|
+
blogPost.attributes.author.data.attributes.img
|
|
85
|
+
.img,
|
|
86
|
+
'thumbnail'
|
|
87
|
+
)}
|
|
88
|
+
alt={
|
|
89
|
+
blogPost.attributes.author.data.attributes.img
|
|
90
|
+
.alt
|
|
91
|
+
}
|
|
92
|
+
fill
|
|
93
|
+
style={{
|
|
94
|
+
objectFit:
|
|
90
95
|
blogPost.attributes.author.data.attributes
|
|
91
|
-
.img.
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
: undefined
|
|
103
|
-
}
|
|
104
|
-
/>
|
|
105
|
-
</Box>
|
|
106
|
-
</BlogItemContainer>
|
|
107
|
-
</Link>
|
|
96
|
+
.img.objectFit || 'cover',
|
|
97
|
+
}}
|
|
98
|
+
/>
|
|
99
|
+
),
|
|
100
|
+
}
|
|
101
|
+
: undefined
|
|
102
|
+
}
|
|
103
|
+
/>
|
|
104
|
+
</Box>
|
|
105
|
+
</BlogItemContainer>
|
|
108
106
|
);
|
|
109
107
|
})}
|
|
110
108
|
</SimpleGrid>
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import styled from '@emotion/styled';
|
|
2
|
-
import { BREAKPOINT_MD } from '
|
|
2
|
+
import { BREAKPOINT_MD } from '../../constants/breakpoints';
|
|
3
|
+
import { Box, Link } from 'boemly';
|
|
4
|
+
|
|
5
|
+
export const BlogItemContainer = styled(Link)`
|
|
6
|
+
text-decoration: none;
|
|
3
7
|
|
|
4
|
-
export const BlogItemContainer = styled.a`
|
|
5
|
-
cursor: pointer;
|
|
6
8
|
& div img {
|
|
7
9
|
transition: transform var(--default-ease) var(--medium-transition-duration);
|
|
8
10
|
}
|
|
9
11
|
|
|
10
12
|
&:hover {
|
|
13
|
+
text-decoration: none;
|
|
14
|
+
|
|
11
15
|
& > div:first-of-type img {
|
|
12
16
|
transform: scale(1.03);
|
|
13
17
|
}
|
|
14
18
|
}
|
|
15
19
|
`;
|
|
16
20
|
|
|
17
|
-
export const ImageContainer = styled
|
|
21
|
+
export const ImageContainer = styled(Box)`
|
|
18
22
|
width: 100%;
|
|
19
23
|
height: var(--boemly-sizes-xs);
|
|
20
24
|
position: relative;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { Meta, StoryFn } from '@storybook/react';
|
|
2
3
|
import {
|
|
3
4
|
storybookStrapiAvatarMock,
|
|
4
5
|
storybookStrapiCoverMock,
|
|
5
|
-
} from '
|
|
6
|
-
import StrapiBlogPost from '
|
|
7
|
-
import IStrapiData from '
|
|
6
|
+
} from '../../test/storybookMocks/storybookStrapiMedia';
|
|
7
|
+
import StrapiBlogPost from '../../models/strapi/StrapiBlogPost';
|
|
8
|
+
import IStrapiData from '../../models/strapi/IStrapiData';
|
|
8
9
|
import BlogCards from '.';
|
|
9
10
|
|
|
10
11
|
export default {
|
|
11
|
-
title: '
|
|
12
|
+
title: 'slices/BlogCards',
|
|
12
13
|
component: BlogCards,
|
|
13
14
|
} as Meta<typeof BlogCards>;
|
|
14
15
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, screen } from '../../test/testUtils';
|
|
3
|
+
import { strapiBlogPostMock } from '../../test/strapiMocks/strapiBlogPost';
|
|
4
|
+
import { strapiMediaMock } from '../../test/strapiMocks/strapiMedia';
|
|
5
|
+
import { mergeDeep } from '../../utils/mergeDeep';
|
|
5
6
|
import BlogCards from '.';
|
|
6
7
|
import { BlogCardsProps } from './BlogCards';
|
|
7
8
|
|