@treely/strapi-slices 2.2.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ContextProvider/ContextProvider.d.ts +8 -0
- package/dist/components/ContextProvider/index.d.ts +1 -0
- package/dist/components/CreditsAvailableBadge/CreditsAvailableBadge.d.ts +8 -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 +9 -0
- package/dist/components/FullScreenImage/ZoomableImage.d.ts +8 -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/SEOTags/SEOTags.d.ts +14 -0
- package/dist/components/SEOTags/index.d.ts +1 -0
- package/dist/components/SliceRenderer/SliceRenderer.d.ts +19 -0
- package/dist/components/SliceRenderer/index.d.ts +1 -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 +14 -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/metadata.d.ts +2 -0
- package/dist/constants/sectionsConfig.d.ts +5 -0
- package/dist/constants/strapi.d.ts +1 -0
- package/dist/icons/LinkedInIcon.d.ts +3 -0
- package/dist/index.d.ts +54 -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/HeaderType.d.ts +5 -0
- package/dist/models/Image.d.ts +5 -0
- package/dist/models/Locale.d.ts +2 -0
- package/dist/models/PageMetadata.d.ts +9 -0
- package/dist/models/PageProps.d.ts +21 -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/StrapiBlogPostProps.d.ts +6 -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/StrapiCustomerStoryProps.d.ts +6 -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/StrapiPageProps.d.ts +6 -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/StrapiProjectProps.d.ts +6 -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 +7 -0
- package/dist/slices/BlogCards/BlogCards.d.ts +18 -0
- package/dist/slices/BlogCards/index.d.ts +2 -0
- package/dist/slices/Comparison/Comparison.d.ts +33 -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/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/index.d.ts +2 -0
- package/dist/slices/CustomerStories/CustomerStories.d.ts +10 -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/index.d.ts +2 -0
- package/dist/slices/FullWidthHighlightQuote/FullWidthHighlightQuote.d.ts +10 -0
- package/dist/slices/FullWidthHighlightQuote/index.d.ts +2 -0
- package/dist/slices/FullWidthImage/FullWidthImage.d.ts +11 -0
- package/dist/slices/FullWidthImage/index.d.ts +2 -0
- package/dist/slices/FullWidthImageSlider/FullWidthImageSlider.d.ts +12 -0
- package/dist/slices/FullWidthImageSlider/index.d.ts +2 -0
- package/dist/slices/FullWidthImageSlider/styles.d.ts +291 -0
- package/dist/slices/FullWidthImageSlider/utils.d.ts +1 -0
- package/dist/slices/FullWidthImageSlider/utils.test.d.ts +1 -0
- package/dist/slices/Glossary/Glossary.d.ts +9 -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/index.d.ts +2 -0
- package/dist/slices/IconGrid/IconGrid.d.ts +18 -0
- package/dist/slices/IconGrid/index.d.ts +2 -0
- package/dist/slices/ImageGrid/ImageGrid.d.ts +18 -0
- package/dist/slices/ImageGrid/index.d.ts +2 -0
- package/dist/slices/ImageTextSequence/ImageTextSequence.d.ts +19 -0
- package/dist/slices/ImageTextSequence/index.d.ts +2 -0
- package/dist/slices/LeftTextRightCard/LeftTextRightCard.d.ts +17 -0
- package/dist/slices/LeftTextRightCard/index.d.ts +2 -0
- package/dist/slices/LinkCardsGrid/LinkCardsGrid.d.ts +18 -0
- package/dist/slices/LinkCardsGrid/index.d.ts +2 -0
- package/dist/slices/LogoGridWithText/LogoGridWithText.d.ts +12 -0
- package/dist/slices/LogoGridWithText/index.d.ts +2 -0
- package/dist/slices/MapHero/MapHero.d.ts +15 -0
- package/dist/slices/MapHero/index.d.ts +2 -0
- package/dist/slices/MapHero/styles.d.ts +16 -0
- package/dist/slices/ProjectFacts/ProjectFacts.d.ts +34 -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/index.d.ts +2 -0
- package/dist/slices/ProjectsMap/MapMarker.d.ts +11 -0
- package/dist/slices/ProjectsMap/ProjectsMap.d.ts +16 -0
- package/dist/slices/ProjectsMap/index.d.ts +2 -0
- package/dist/slices/ProjectsMap/mapboxStyle.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/index.d.ts +2 -0
- package/dist/slices/QuoteCards/QuoteCards.d.ts +15 -0
- package/dist/slices/QuoteCards/index.d.ts +2 -0
- package/dist/slices/RichTextSection/RichTextSection.d.ts +7 -0
- package/dist/slices/RichTextSection/index.d.ts +2 -0
- package/dist/slices/ShopCheckout/ShopCheckout.d.ts +16 -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/index.d.ts +2 -0
- package/dist/slices/SmallHero/SmallHero.d.ts +20 -0
- package/dist/slices/SmallHero/index.d.ts +2 -0
- package/dist/slices/Steps/Steps.d.ts +19 -0
- package/dist/slices/Steps/index.d.ts +2 -0
- package/dist/slices/TextCardGrid/TextCardGrid.d.ts +20 -0
- package/dist/slices/TextCardGrid/index.d.ts +2 -0
- package/dist/slices/TextCarousel/TextCarousel.d.ts +13 -0
- package/dist/slices/TextCarousel/index.d.ts +2 -0
- package/dist/slices/TextCarousel/styles.d.ts +282 -0
- package/dist/slices/TextWithCard/TextWithCard.d.ts +20 -0
- package/dist/slices/TextWithCard/index.d.ts +2 -0
- package/dist/slices/TextWithTextCards/TextWithTextCards.d.ts +15 -0
- package/dist/slices/TextWithTextCards/index.d.ts +2 -0
- package/dist/slices/Video/Video.d.ts +10 -0
- package/dist/slices/Video/index.d.ts +2 -0
- package/dist/strapi-slices.cjs.development.js +4876 -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 +4853 -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/getStaticPropsContext.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/convertAreaM2ToHa.test.d.ts +1 -0
- package/dist/utils/convertCo2AmountKgToTons.d.ts +2 -0
- package/dist/utils/convertToKebabCase.d.ts +2 -0
- package/dist/utils/convertToKebabCase.test.d.ts +1 -0
- package/dist/utils/getTimeSpanInYears.d.ts +2 -0
- package/dist/utils/getTimeSpanInYears.test.d.ts +1 -0
- package/dist/utils/mergeBoundingBoxes.d.ts +3 -0
- package/dist/utils/mergeBoundingBoxes.test.d.ts +1 -0
- package/dist/utils/mergeDeep.d.ts +12 -0
- package/dist/utils/mergeGlobalAndStrapiBlogPostData.d.ts +5 -0
- package/dist/utils/mergeGlobalAndStrapiBlogPostData.test.d.ts +1 -0
- package/dist/utils/mergeGlobalAndStrapiCustomerStoryData.d.ts +4 -0
- package/dist/utils/mergeGlobalAndStrapiCustomerStoryData.test.d.ts +1 -0
- package/dist/utils/mergeGlobalAndStrapiPageData.d.ts +5 -0
- package/dist/utils/mergeGlobalAndStrapiPageData.test.d.ts +1 -0
- package/dist/utils/mergeGlobalAndStrapiProjectData.d.ts +5 -0
- package/dist/utils/mergeGlobalAndStrapiProjectData.test.d.ts +1 -0
- package/dist/utils/openHubSpotChat.d.ts +2 -0
- package/dist/utils/strapiLinkUrl.d.ts +3 -0
- package/dist/utils/strapiLinkUrl.test.d.ts +1 -0
- package/dist/utils/strapiMediaUrl.d.ts +5 -0
- package/dist/utils/strapiMediaUrl.test.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/portfolio/SmallCheckout/SmallCheckout.tsx +14 -15
- package/src/index.tsx +4 -0
- package/src/slices/ProjectFacts/ProjectFacts.stories.tsx +53 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const storybookAvatarUrl = "https://cdn.tree.ly/storybook/v1/avatar.jpeg";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import IStrapiData from '../../models/strapi/IStrapiData';
|
|
2
|
+
import StrapiMedia from '../../models/strapi/StrapiMedia';
|
|
3
|
+
export declare const storybookStrapiAvatarMock: IStrapiData<StrapiMedia>;
|
|
4
|
+
export declare const storybookStrapiCoverMock: IStrapiData<StrapiMedia>;
|
|
5
|
+
export declare const storybookStrapiGradientTopDownMock: IStrapiData<StrapiMedia>;
|
|
6
|
+
export declare const storybookStrapiGradientBottomUpMock: IStrapiData<StrapiMedia>;
|
|
7
|
+
export declare const storybookStrapiTreeIconMock: IStrapiData<StrapiMedia>;
|
|
8
|
+
export declare const storybookStrapiMapMock: IStrapiData<StrapiMedia>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const strapiAvatarWithNameMock: {
|
|
2
|
+
id: number;
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
image: {
|
|
6
|
+
id: number;
|
|
7
|
+
alt: string;
|
|
8
|
+
img: {
|
|
9
|
+
data: import("../../models/strapi/IStrapiData").default<import("../../models/strapi/StrapiMedia").default>;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import userEvent from '@testing-library/user-event';
|
|
2
|
+
declare const render: (ui: any, { locale, ...renderOptions }?: {
|
|
3
|
+
locale?: string | undefined;
|
|
4
|
+
}) => import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
|
|
5
|
+
export * from '@testing-library/react';
|
|
6
|
+
export { render, userEvent };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple object check.
|
|
3
|
+
* @param item
|
|
4
|
+
* @returns {boolean}
|
|
5
|
+
*/
|
|
6
|
+
export declare function isObject(item: any): any;
|
|
7
|
+
/**
|
|
8
|
+
* Deep merge two objects.
|
|
9
|
+
* @param target
|
|
10
|
+
* @param ...sources
|
|
11
|
+
*/
|
|
12
|
+
export declare function mergeDeep(target: any, ...sources: any): any;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { GetStaticPropsContext } from 'next';
|
|
2
|
+
import { IStrapiData, StrapiBlogPost, StrapiBlogPostProps, StrapiGlobal } from '..';
|
|
3
|
+
import PortfolioProject from '../models/PortfolioProject';
|
|
4
|
+
declare const mergeGlobalAndStrapiBlogPostData: (context: GetStaticPropsContext, global: IStrapiData<StrapiGlobal>, post: IStrapiData<StrapiBlogPost>, blog: IStrapiData<StrapiBlogPost>[], projects: PortfolioProject[]) => StrapiBlogPostProps;
|
|
5
|
+
export default mergeGlobalAndStrapiBlogPostData;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { GetStaticPropsContext } from 'next';
|
|
2
|
+
import { IStrapiData, StrapiCustomerStory, StrapiCustomerStoryProps, StrapiGlobal } from '..';
|
|
3
|
+
declare const mergeGlobalAndStrapiCustomerStoryData: (context: GetStaticPropsContext, global: IStrapiData<StrapiGlobal>, customerStory: IStrapiData<StrapiCustomerStory>, customerStories: IStrapiData<StrapiCustomerStory>[]) => StrapiCustomerStoryProps;
|
|
4
|
+
export default mergeGlobalAndStrapiCustomerStoryData;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { GetStaticPropsContext } from 'next';
|
|
2
|
+
import { IStrapiData, StrapiBlogPost, StrapiCustomerStory, StrapiGlobal, StrapiPage, StrapiPageProps } from '..';
|
|
3
|
+
import PortfolioProject from '../models/PortfolioProject';
|
|
4
|
+
declare const mergeGlobalAndStrapiPageData: (context: GetStaticPropsContext, global: IStrapiData<StrapiGlobal>, page: IStrapiData<StrapiPage>, blogPosts: IStrapiData<StrapiBlogPost>[], customerStories: IStrapiData<StrapiCustomerStory>[], projects: PortfolioProject[]) => StrapiPageProps;
|
|
5
|
+
export default mergeGlobalAndStrapiPageData;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { GetStaticPropsContext } from 'next';
|
|
2
|
+
import { IStrapiData, StrapiBlogPost, StrapiGlobal, StrapiProject, StrapiProjectProps } from '..';
|
|
3
|
+
import PortfolioProject from '../models/PortfolioProject';
|
|
4
|
+
declare const mergeGlobalAndStrapiProject: (context: GetStaticPropsContext, global: IStrapiData<StrapiGlobal>, project: IStrapiData<StrapiProject>, blogPosts: IStrapiData<StrapiBlogPost>[], projects: PortfolioProject[]) => StrapiProjectProps;
|
|
5
|
+
export default mergeGlobalAndStrapiProject;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import IStrapi from '../models/strapi/IStrapi';
|
|
2
|
+
import IStrapiData from '../models/strapi/IStrapiData';
|
|
3
|
+
import StrapiMedia from '../models/strapi/StrapiMedia';
|
|
4
|
+
declare const strapiMediaUrl: (media: IStrapi<IStrapiData<StrapiMedia>>, preferredSize?: 'native' | 'thumbnail' | 'xSmall' | 'small' | 'medium' | 'large' | 'xLarge') => string;
|
|
5
|
+
export default strapiMediaUrl;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import { CDN_URI, FPM_API_URI } from '../../../constants/api';
|
|
3
|
-
import StrapiLinkButton from '../../../components/StrapiLinkButton';
|
|
1
|
+
import React, { useCallback, useContext } from 'react';
|
|
4
2
|
import {
|
|
5
3
|
BoemlyFormControl,
|
|
6
4
|
Box,
|
|
@@ -21,12 +19,14 @@ import {
|
|
|
21
19
|
} from 'formik';
|
|
22
20
|
import { useRouter } from 'next/router';
|
|
23
21
|
import Image from 'next/image';
|
|
24
|
-
import StrapiLink from '
|
|
22
|
+
import { StrapiLink } from '../../..';
|
|
23
|
+
import { IntlContext } from '../../ContextProvider';
|
|
25
24
|
import {
|
|
26
25
|
MAXIMUM_CONTRIBUTION_VALUE_IN_MONEY,
|
|
27
26
|
MINIMUM_CONTRIBUTION_VALUE_IN_MONEY,
|
|
28
27
|
} from '../../../constants/domain';
|
|
29
|
-
import {
|
|
28
|
+
import { CDN_URI, FPM_API_URI } from '../../../constants/api';
|
|
29
|
+
import StrapiLinkButton from '../../StrapiLinkButton';
|
|
30
30
|
|
|
31
31
|
export interface SmallCheckoutProps {
|
|
32
32
|
batchId: string;
|
|
@@ -85,13 +85,12 @@ const SmallCheckout = ({
|
|
|
85
85
|
[locale]
|
|
86
86
|
);
|
|
87
87
|
|
|
88
|
-
const onSubmit = async ({ contributionValueCurrency }: SmallCheckoutForm) =>
|
|
88
|
+
const onSubmit = async ({ contributionValueCurrency }: SmallCheckoutForm) =>
|
|
89
89
|
push(
|
|
90
90
|
`${FPM_API_URI}/v1/webhooks/shop/checkout?batchId=${batchId}&quantity=${Math.floor(
|
|
91
91
|
contributionValueCurrency / pricePerKg
|
|
92
92
|
)}`
|
|
93
93
|
);
|
|
94
|
-
};
|
|
95
94
|
|
|
96
95
|
return (
|
|
97
96
|
<Flex
|
|
@@ -143,12 +142,12 @@ const SmallCheckout = ({
|
|
|
143
142
|
<BoemlyFormControl
|
|
144
143
|
id="contributionValueCurrency"
|
|
145
144
|
size="md"
|
|
146
|
-
|
|
147
|
-
|
|
145
|
+
inputProps={{
|
|
146
|
+
type: 'number',
|
|
148
147
|
value: field.value,
|
|
149
|
-
onChange: (
|
|
148
|
+
onChange: (e) => {
|
|
150
149
|
// valueAsNumber might be NaN
|
|
151
|
-
const value =
|
|
150
|
+
const value = e.target.valueAsNumber || 0;
|
|
152
151
|
|
|
153
152
|
setValues({
|
|
154
153
|
contributionValueCurrency: value,
|
|
@@ -182,11 +181,11 @@ const SmallCheckout = ({
|
|
|
182
181
|
<BoemlyFormControl
|
|
183
182
|
id="contributionValueKgs"
|
|
184
183
|
size="md"
|
|
185
|
-
|
|
186
|
-
|
|
184
|
+
inputProps={{
|
|
185
|
+
type: 'number',
|
|
187
186
|
value: field.value,
|
|
188
|
-
onChange: (
|
|
189
|
-
const value =
|
|
187
|
+
onChange: (e) => {
|
|
188
|
+
const value = e.target.valueAsNumber || 0;
|
|
190
189
|
|
|
191
190
|
setValues({
|
|
192
191
|
contributionValueCurrency:
|
package/src/index.tsx
CHANGED
|
@@ -47,6 +47,8 @@ import mergeGlobalAndStrapiBlogPostData from './utils/mergeGlobalAndStrapiBlogPo
|
|
|
47
47
|
import mergeGlobalAndStrapiCustomerStoryData from './utils/mergeGlobalAndStrapiCustomerStoryData';
|
|
48
48
|
import mergeGlobalAndStrapiPageData from './utils/mergeGlobalAndStrapiPageData';
|
|
49
49
|
import mergeGlobalAndStrapiProjectData from './utils/mergeGlobalAndStrapiProjectData';
|
|
50
|
+
import strapiLinkUrl from './utils/strapiLinkUrl';
|
|
51
|
+
import strapiMediaUrl from './utils/strapiMediaUrl';
|
|
50
52
|
|
|
51
53
|
import {
|
|
52
54
|
SECTIONS_WITH_BLOG_POSTS,
|
|
@@ -63,6 +65,8 @@ export {
|
|
|
63
65
|
mergeGlobalAndStrapiCustomerStoryData,
|
|
64
66
|
mergeGlobalAndStrapiPageData,
|
|
65
67
|
mergeGlobalAndStrapiProjectData,
|
|
68
|
+
strapiLinkUrl,
|
|
69
|
+
strapiMediaUrl,
|
|
66
70
|
|
|
67
71
|
// Constants
|
|
68
72
|
SECTIONS_WITH_BLOG_POSTS,
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { StoryFn, Meta } from '@storybook/react';
|
|
3
3
|
|
|
4
4
|
import fpmProjectMock from '../../test/integrationMocks/fpmProjectMock';
|
|
5
|
+
import { storybookStrapiAvatarMock } from '../../test/storybookMocks/storybookStrapiMedia';
|
|
5
6
|
import CreditsAvailableState from '../../models/CreditsAvailableState';
|
|
6
7
|
import ProjectFacts from '.';
|
|
7
8
|
|
|
@@ -90,3 +91,55 @@ FullProps.args = {
|
|
|
90
91
|
},
|
|
91
92
|
},
|
|
92
93
|
};
|
|
94
|
+
|
|
95
|
+
export const WithContact = Template.bind({});
|
|
96
|
+
WithContact.args = {
|
|
97
|
+
project: fpmProjectMock,
|
|
98
|
+
slice: {
|
|
99
|
+
projectId: fpmProjectMock.id,
|
|
100
|
+
|
|
101
|
+
contactTitle: 'Contact Title',
|
|
102
|
+
contactText: 'Contact Text',
|
|
103
|
+
contactButton: {
|
|
104
|
+
id: 1,
|
|
105
|
+
text: 'Contact our Sales Team',
|
|
106
|
+
url: 'https://example.org',
|
|
107
|
+
},
|
|
108
|
+
contactAvatar: {
|
|
109
|
+
id: 1,
|
|
110
|
+
alt: 'Avatar image alt text',
|
|
111
|
+
img: {
|
|
112
|
+
data: storybookStrapiAvatarMock,
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export const WithDocumentsAndContact = Template.bind({});
|
|
119
|
+
WithDocumentsAndContact.args = {
|
|
120
|
+
project: fpmProjectMock,
|
|
121
|
+
slice: {
|
|
122
|
+
projectId: fpmProjectMock.id,
|
|
123
|
+
|
|
124
|
+
documentUrls: [
|
|
125
|
+
{ id: 1, text: 'Document 1', url: 'https://example.org' },
|
|
126
|
+
{ id: 2, text: 'Document 2', url: 'https://example.org' },
|
|
127
|
+
{ id: 3, text: 'Document 3', url: 'https://example.org' },
|
|
128
|
+
],
|
|
129
|
+
|
|
130
|
+
contactTitle: 'Contact Title',
|
|
131
|
+
contactText: 'Contact Text',
|
|
132
|
+
contactButton: {
|
|
133
|
+
id: 1,
|
|
134
|
+
text: 'Contact our Sales Team',
|
|
135
|
+
url: 'https://example.org',
|
|
136
|
+
},
|
|
137
|
+
contactAvatar: {
|
|
138
|
+
id: 1,
|
|
139
|
+
alt: 'Avatar image alt text',
|
|
140
|
+
img: {
|
|
141
|
+
data: storybookStrapiAvatarMock,
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
};
|