@treely/strapi-slices 5.15.1 → 5.17.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/README.md +6 -0
- package/dist/components/CreditsAvailableBadge/CreditsAvailableBadge.d.ts +2 -2
- package/dist/models/PortfolioProject.d.ts +0 -3
- package/dist/models/fpm/FPMProject.d.ts +8 -0
- package/dist/models/strapi/StrapiProject.d.ts +0 -2
- package/dist/rootMessages.de.d.ts +2 -5
- package/dist/rootMessages.en.d.ts +2 -5
- package/dist/slices/ProjectFacts/messages.de.d.ts +0 -1
- package/dist/slices/ProjectFacts/messages.en.d.ts +0 -1
- package/dist/slices/ProjectGridCard/ProjectGridCard.d.ts +6 -0
- package/dist/slices/ProjectGridCard/index.d.ts +2 -0
- package/dist/slices/ProjectGridCard/messages.de.d.ts +5 -0
- package/dist/slices/ProjectGridCard/messages.en.d.ts +5 -0
- package/dist/slices/ProjectsGrid/ProjectsGrid.d.ts +3 -1
- package/dist/slices/ProjectsGrid/ProjectsGrid.stories.d.ts +2 -0
- package/dist/slices/ProjectsMap/MapMarker.d.ts +3 -3
- package/dist/strapi-slices.cjs.development.js +144 -137
- 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 +146 -139
- package/dist/strapi-slices.esm.js.map +1 -1
- package/dist/utils/getMessages.d.ts +4 -10
- package/package.json +1 -1
- package/src/components/CreditsAvailableBadge/CreditsAvailableBadge.test.tsx +8 -6
- package/src/components/CreditsAvailableBadge/CreditsAvailableBadge.tsx +31 -22
- package/src/components/CreditsAvailableBadge/messages.de.ts +1 -1
- package/src/components/portfolio/ProjectInfo/ProjectInfo.tsx +3 -7
- package/src/integrations/strapi/getPortfolioProjects.test.ts +2 -2
- package/src/integrations/strapi/getPortfolioProjects.ts +0 -6
- package/src/models/PortfolioProject.ts +0 -3
- package/src/models/fpm/FPMProject.ts +9 -0
- package/src/models/strapi/StrapiProject.ts +0 -2
- package/src/rootMessages.de.ts +2 -2
- package/src/rootMessages.en.ts +2 -2
- package/src/slices/ProjectFacts/ProjectFacts.stories.tsx +1 -2
- package/src/slices/ProjectFacts/messages.de.ts +0 -1
- package/src/slices/ProjectFacts/messages.en.ts +0 -1
- package/src/slices/ProjectGridCard/ProjectGridCard.test.tsx +60 -0
- package/src/slices/ProjectGridCard/ProjectGridCard.tsx +75 -0
- package/src/slices/ProjectGridCard/index.ts +3 -0
- package/src/slices/ProjectGridCard/messages.de.ts +6 -0
- package/src/slices/ProjectGridCard/messages.en.ts +6 -0
- package/src/slices/ProjectsGrid/ProjectsGrid.stories.tsx +35 -1
- package/src/slices/ProjectsGrid/ProjectsGrid.test.tsx +0 -3
- package/src/slices/ProjectsGrid/ProjectsGrid.tsx +5 -3
- package/src/slices/ProjectsMap/MapMarker.test.tsx +3 -2
- package/src/slices/ProjectsMap/MapMarker.tsx +9 -12
- package/src/slices/ProjectsMap/ProjectsMap.stories.tsx +0 -2
- package/src/slices/ProjectsMap/ProjectsMap.tsx +1 -1
- package/src/slices/TextWithCard/TextWithCard.stories.tsx +2 -3
- package/src/slices/TextWithCard/TextWithCard.tsx +2 -2
- package/src/test/integrationMocks/fpmProjectMock.ts +3 -1
- package/src/test/integrationMocks/portfolioProjectMock.ts +1 -3
- package/src/test/mocks/portfolioProjectMock.ts +0 -2
- package/src/test/strapiMocks/strapiProject.ts +0 -2
- package/dist/components/portfolio/PortfolioProjectCard/PortfolioProjectCard.d.ts +0 -6
- package/dist/components/portfolio/PortfolioProjectCard/index.d.ts +0 -2
- package/dist/components/portfolio/PortfolioProjectCard/messages.de.d.ts +0 -7
- package/dist/components/portfolio/PortfolioProjectCard/messages.en.d.ts +0 -7
- package/dist/models/CreditsAvailableState.d.ts +0 -7
- package/src/components/portfolio/PortfolioProjectCard/PortfolioProjectCard.test.tsx +0 -53
- package/src/components/portfolio/PortfolioProjectCard/PortfolioProjectCard.tsx +0 -69
- package/src/components/portfolio/PortfolioProjectCard/index.ts +0 -3
- package/src/components/portfolio/PortfolioProjectCard/messages.de.ts +0 -8
- package/src/components/portfolio/PortfolioProjectCard/messages.en.ts +0 -8
- package/src/models/CreditsAvailableState.ts +0 -8
|
@@ -2,7 +2,7 @@ import axios from 'axios';
|
|
|
2
2
|
import qs from 'qs';
|
|
3
3
|
import { setupCache } from 'axios-cache-interceptor';
|
|
4
4
|
import React, { useState, useRef, useMemo, useCallback, useEffect, Fragment, createRef, createContext, useContext } from 'react';
|
|
5
|
-
import { Box, BoemlyAlert, BoemlyModal, Flex, IconButton, useMediaQuery, DefaultSectionContainer, Wrapper, DefaultSectionHeader, Button, Gradient, Spacer, SimpleGrid, Heading, Text, useToken, Grid, GridItem, BoemlyList, PortfolioCard, RichText, BoemlyAccordion, HeroCard, Shape, QuoteCard, Center, ShapesCard, TextCardWithIcon, ContactArea,
|
|
5
|
+
import { Box, BoemlyAlert, BoemlyModal, Flex, IconButton, useMediaQuery, DefaultSectionContainer, Wrapper, DefaultSectionHeader, Button, Gradient, Spacer, SimpleGrid, Heading, Text, useToken, Grid, GridItem, BoemlyList, PortfolioCard, RichText, BoemlyAccordion, HeroCard, Shape, QuoteCard, Center, ShapesCard, TextCardWithIcon, ContactArea, Tag, Container, ProjectCard, Link as Link$1, DatePersonPair, BoemlyThemeProvider, useDisclosure, AvatarWithName, Divider, Badge, LabelNumberPair, BoemlyFormControl, InputRightAddon, LabelTextPair, Tooltip } from 'boemly';
|
|
6
6
|
import Head from 'next/head';
|
|
7
7
|
import Image from 'next/image';
|
|
8
8
|
import { useLockBodyScroll, useKey, useWindowScroll, useWindowSize, useMeasure, useCopyToClipboard } from 'react-use';
|
|
@@ -13,7 +13,7 @@ import { useRouter } from 'next/router';
|
|
|
13
13
|
import styled from '@emotion/styled';
|
|
14
14
|
import { css, Global } from '@emotion/react';
|
|
15
15
|
import { motion, AnimatePresence } from 'framer-motion';
|
|
16
|
-
import { createIntl, createIntlCache,
|
|
16
|
+
import { createIntl, createIntlCache, IntlContext as IntlContext$1, IntlProvider, FormattedMessage } from 'react-intl';
|
|
17
17
|
import mapboxgl, { Map as Map$1, Marker } from 'mapbox-gl';
|
|
18
18
|
import { createRoot } from 'react-dom/client';
|
|
19
19
|
import { Formik, Form, Field } from 'formik';
|
|
@@ -519,15 +519,9 @@ var getPortfolioProjects = /*#__PURE__*/function () {
|
|
|
519
519
|
if (strapiProject != null && strapiProject.attributes.slug) {
|
|
520
520
|
toReturn.slug = strapiProject.attributes.slug;
|
|
521
521
|
}
|
|
522
|
-
if (strapiProject != null && strapiProject.attributes.creditsAvailable) {
|
|
523
|
-
toReturn.creditsAvailable = strapiProject == null ? void 0 : strapiProject.attributes.creditsAvailable;
|
|
524
|
-
}
|
|
525
522
|
if (strapiProject != null && strapiProject.attributes.thumbnail) {
|
|
526
523
|
toReturn.thumbnail = strapiProject == null ? void 0 : strapiProject.attributes.thumbnail;
|
|
527
524
|
}
|
|
528
|
-
if (strapiProject != null && strapiProject.attributes.footerSubTitle) {
|
|
529
|
-
toReturn.footerSubTitle = strapiProject == null ? void 0 : strapiProject.attributes.footerSubTitle;
|
|
530
|
-
}
|
|
531
525
|
if (strapiProject != null && (_strapiProject$attrib = strapiProject.attributes.portfolio.data) != null && _strapiProject$attrib.attributes.host) {
|
|
532
526
|
toReturn.portfolioHost = strapiProject.attributes.portfolio.data.attributes.host;
|
|
533
527
|
}
|
|
@@ -2341,44 +2335,48 @@ var CardContainer = /*#__PURE__*/styled(Box)(_templateObject3$1 || (_templateObj
|
|
|
2341
2335
|
var _templateObject$4;
|
|
2342
2336
|
var GLOBAL_STYLE = /*#__PURE__*/css(_templateObject$4 || (_templateObject$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n :root {\n --default-hero-height: calc(100vh - var(--boemly-space-24));\n }\n\n a {\n text-decoration: none;\n }\n"])));
|
|
2343
2337
|
|
|
2344
|
-
var messagesDe$
|
|
2338
|
+
var messagesDe$g = {
|
|
2345
2339
|
'sections.comparison.backgroundShapes': 'Hintergrundformen'
|
|
2346
2340
|
};
|
|
2347
2341
|
|
|
2348
|
-
var messagesDe$
|
|
2342
|
+
var messagesDe$f = {
|
|
2349
2343
|
'components.creditsAvailableBadge.text.yes': 'Credits verfügbar',
|
|
2350
2344
|
'components.creditsAvailableBadge.text.some': 'Einige verbleibende Credits',
|
|
2351
2345
|
'components.creditsAvailableBadge.text.no': 'Keine verbleibenden Credits',
|
|
2352
|
-
'components.creditsAvailableBadge.text.notYet': '
|
|
2346
|
+
'components.creditsAvailableBadge.text.notYet': 'Credits bald verfügbar'
|
|
2353
2347
|
};
|
|
2354
2348
|
|
|
2355
|
-
var messagesDe$
|
|
2349
|
+
var messagesDe$e = {
|
|
2356
2350
|
'sections.cta.backgroundShapes': 'Dunkle Hintergrundformen',
|
|
2357
2351
|
'sections.cta.backgroundShapesLight': 'Helle Hintergrundformen'
|
|
2358
2352
|
};
|
|
2359
2353
|
|
|
2360
|
-
var messagesDe$
|
|
2354
|
+
var messagesDe$d = {
|
|
2361
2355
|
'sections.customerCard.more': 'Weiterlesen'
|
|
2362
2356
|
};
|
|
2363
2357
|
|
|
2364
|
-
var messagesDe$
|
|
2358
|
+
var messagesDe$c = {
|
|
2365
2359
|
'sections.customerQuoteCard.more': 'Weiterlesen'
|
|
2366
2360
|
};
|
|
2367
2361
|
|
|
2368
|
-
var messagesDe$
|
|
2362
|
+
var messagesDe$b = {
|
|
2369
2363
|
'sections.glossary.copyButtonLabel': 'Kopiere den Link zu diesem Abschnitt in die Zwischenablage',
|
|
2370
2364
|
'sections.glossary.copySuccessMessage': 'Link in die Zwischenablage kopiert',
|
|
2371
2365
|
'sections.glossary.copyFailureMessage': 'Link konnte nicht in die Zwischenablage kopiert werden'
|
|
2372
2366
|
};
|
|
2373
2367
|
|
|
2374
|
-
var messagesDe$
|
|
2368
|
+
var messagesDe$a = {
|
|
2375
2369
|
'features.portfolio.documentsDownloadList.projectDocuments': 'Projektdokumente',
|
|
2376
2370
|
'features.portfolio.documentsDownloadList.downloadDocument': 'Dokument herunterladen'
|
|
2377
2371
|
};
|
|
2378
2372
|
|
|
2373
|
+
var messagesDe$9 = {
|
|
2374
|
+
'sections.projectFacts.projectInfo.value': 'Projekt Infos'
|
|
2375
|
+
};
|
|
2376
|
+
|
|
2379
2377
|
var messagesDe$8 = {
|
|
2380
|
-
'sections.
|
|
2381
|
-
'
|
|
2378
|
+
'sections.projectCardGrid.certified': 'Zertifiziert, {year}',
|
|
2379
|
+
'sections.projectCardGrid.certificationInProgres': 'Zertifizierung ist in Arbeit'
|
|
2382
2380
|
};
|
|
2383
2381
|
|
|
2384
2382
|
var messagesDe$7 = {
|
|
@@ -2403,13 +2401,6 @@ var messagesDe$6 = {
|
|
|
2403
2401
|
};
|
|
2404
2402
|
|
|
2405
2403
|
var messagesDe$5 = {
|
|
2406
|
-
'components.portfolioProjectCard.text.yes': 'Credits verfügbar',
|
|
2407
|
-
'components.portfolioProjectCard.text.some': 'Einige verbleibende Credits',
|
|
2408
|
-
'components.portfolioProjectCard.text.no': 'Keine verbleibenden Credits',
|
|
2409
|
-
'components.portfolioProjectCard.text.notYet': 'Gutschriften bald verfügbar'
|
|
2410
|
-
};
|
|
2411
|
-
|
|
2412
|
-
var messagesDe$4 = {
|
|
2413
2404
|
'portfolio.smallCheckout.price.taxNotIncluded': 'ohne Steuern',
|
|
2414
2405
|
'portfolio.smallCheckout.price.taxIncluded': 'Preis inklusive Steuern: {number}',
|
|
2415
2406
|
'portfolio.smallCheckout.contributionValueCurrency.label.CHF': 'Geben Sie den Beitrag in Fr. ein',
|
|
@@ -2427,7 +2418,7 @@ var messagesDe$4 = {
|
|
|
2427
2418
|
'portfolio.smallCheckout.cta.button': 'Unser Vertriebsteam kontaktieren'
|
|
2428
2419
|
};
|
|
2429
2420
|
|
|
2430
|
-
var messagesDe$
|
|
2421
|
+
var messagesDe$4 = {
|
|
2431
2422
|
'sections.shopCheckout.intro.price': 'Preis',
|
|
2432
2423
|
'sections.shopCheckout.contributionValue.label.EUR': 'Geben sie einen Betrag in € ein',
|
|
2433
2424
|
'sections.shopCheckout.contributionValue.label.CHF': 'Geben sie einen Betrag in CHF ein',
|
|
@@ -2444,12 +2435,12 @@ var messagesDe$3 = {
|
|
|
2444
2435
|
'sections.shopCheckout.submit': 'Kaufen'
|
|
2445
2436
|
};
|
|
2446
2437
|
|
|
2447
|
-
var messagesDe$
|
|
2438
|
+
var messagesDe$3 = {
|
|
2448
2439
|
'sections.textCarousel.moveRight': 'Nach rechts bewegen',
|
|
2449
2440
|
'sections.textCarousel.moveLeft': 'Nach links bewegen'
|
|
2450
2441
|
};
|
|
2451
2442
|
|
|
2452
|
-
var messagesDe$
|
|
2443
|
+
var messagesDe$2 = {
|
|
2453
2444
|
'sections.timeline.backgroundShapes': 'Hintergrundformen',
|
|
2454
2445
|
'sections.timeline.showMoreButton': 'Drei weitere Meilensteine anzeigen'
|
|
2455
2446
|
};
|
|
@@ -2459,53 +2450,57 @@ var unitMessagesDe = {
|
|
|
2459
2450
|
'unit.formatter.tonsCo2PerYear': '{number} tCO₂/Jahr'
|
|
2460
2451
|
};
|
|
2461
2452
|
|
|
2462
|
-
var rootMessagesDe = /*#__PURE__*/_extends({}, messagesDe$
|
|
2453
|
+
var rootMessagesDe = /*#__PURE__*/_extends({}, messagesDe$f, messagesDe$a, messagesDe$6, messagesDe$5, messagesDe$g, messagesDe$e, messagesDe$d, messagesDe$c, messagesDe$b, messagesDe$9, messagesDe$8, messagesDe$7, messagesDe$4, messagesDe$3, messagesDe$2, unitMessagesDe);
|
|
2463
2454
|
|
|
2464
|
-
var messagesEn$
|
|
2455
|
+
var messagesEn$c = {
|
|
2465
2456
|
'sections.comparison.backgroundShapes': 'Background shapes'
|
|
2466
2457
|
};
|
|
2467
2458
|
|
|
2468
|
-
var messagesEn$
|
|
2459
|
+
var messagesEn$b = {
|
|
2469
2460
|
'components.creditsAvailableBadge.text.yes': 'Credits available',
|
|
2470
2461
|
'components.creditsAvailableBadge.text.some': 'Some remaining credits',
|
|
2471
2462
|
'components.creditsAvailableBadge.text.no': 'No remaining credits',
|
|
2472
2463
|
'components.creditsAvailableBadge.text.notYet': 'Credits available soon'
|
|
2473
2464
|
};
|
|
2474
2465
|
|
|
2475
|
-
var messagesEn$
|
|
2466
|
+
var messagesEn$a = {
|
|
2476
2467
|
'sections.cta.backgroundShapesDark': 'Dark background shapes',
|
|
2477
2468
|
'sections.cta.backgroundShapesLight': 'Light background shapes'
|
|
2478
2469
|
};
|
|
2479
2470
|
|
|
2480
|
-
var messagesEn$
|
|
2471
|
+
var messagesEn$9 = {
|
|
2481
2472
|
'sections.customerCard.more': 'Read more'
|
|
2482
2473
|
};
|
|
2483
2474
|
|
|
2484
|
-
var messagesEn$
|
|
2475
|
+
var messagesEn$8 = {
|
|
2485
2476
|
'sections.customerQuoteCard.more': 'Read more'
|
|
2486
2477
|
};
|
|
2487
2478
|
|
|
2488
|
-
var messagesEn$
|
|
2479
|
+
var messagesEn$7 = {
|
|
2489
2480
|
'sections.glossary.copyButtonLabel': 'Copy a link to this section to your clipboard',
|
|
2490
2481
|
'sections.glossary.copySuccessMessage': 'Copied the link to your clipboard',
|
|
2491
2482
|
'sections.glossary.copyFailureMessage': 'Could not copy link to clipboard'
|
|
2492
2483
|
};
|
|
2493
2484
|
|
|
2494
|
-
var messagesEn$
|
|
2485
|
+
var messagesEn$6 = {
|
|
2495
2486
|
'features.portfolio.documentsDownloadList.projectDocuments': 'Project documents',
|
|
2496
2487
|
'features.portfolio.documentsDownloadList.downloadDocument': 'Download document'
|
|
2497
2488
|
};
|
|
2498
2489
|
|
|
2499
|
-
var messagesEn$
|
|
2500
|
-
'sections.projectFacts.projectInfo.value': 'Project Infos'
|
|
2501
|
-
'projects.projectFacts.properties.area': 'Area'
|
|
2490
|
+
var messagesEn$5 = {
|
|
2491
|
+
'sections.projectFacts.projectInfo.value': 'Project Infos'
|
|
2502
2492
|
};
|
|
2503
2493
|
|
|
2504
|
-
var
|
|
2505
|
-
'sections.
|
|
2494
|
+
var messagesDe$1 = {
|
|
2495
|
+
'sections.projectCardGrid.certified': 'Certified, {year}',
|
|
2496
|
+
'sections.projectCardGrid.certificationInProgres': 'Certification in progress'
|
|
2506
2497
|
};
|
|
2507
2498
|
|
|
2508
2499
|
var messagesEn$4 = {
|
|
2500
|
+
'sections.projectsMap.link.text': 'Show more info'
|
|
2501
|
+
};
|
|
2502
|
+
|
|
2503
|
+
var messagesEn$3 = {
|
|
2509
2504
|
'features.projectInfo.projectInfo.value': 'Project Infos',
|
|
2510
2505
|
'features.projectInfo.properties.area': 'Project Area',
|
|
2511
2506
|
'features.projectInfo.properties.location': 'Location',
|
|
@@ -2522,13 +2517,6 @@ var messagesEn$4 = {
|
|
|
2522
2517
|
'features.projectInfo.properties.year': '{years} {years, plural, one {year} other {years} }'
|
|
2523
2518
|
};
|
|
2524
2519
|
|
|
2525
|
-
var messagesEn$3 = {
|
|
2526
|
-
'components.portfolioProjectCard.text.yes': 'Credits available',
|
|
2527
|
-
'components.portfolioProjectCard.text.some': 'Some remaining credits',
|
|
2528
|
-
'components.portfolioProjectCard.text.no': 'No remaining credits',
|
|
2529
|
-
'components.portfolioProjectCard.text.notYet': 'Credits available soon'
|
|
2530
|
-
};
|
|
2531
|
-
|
|
2532
2520
|
var messagesEn$2 = {
|
|
2533
2521
|
'portfolio.smallCheckout.price.taxNotIncluded': 'not including tax',
|
|
2534
2522
|
'portfolio.smallCheckout.price.taxIncluded': 'Price including tax: {number}',
|
|
@@ -2579,7 +2567,7 @@ var unitMessagesEn = {
|
|
|
2579
2567
|
'unit.formatter.tonsCo2PerYear': '{number} tCO₂/year'
|
|
2580
2568
|
};
|
|
2581
2569
|
|
|
2582
|
-
var rootMessagesEn = /*#__PURE__*/_extends({}, messagesEn$
|
|
2570
|
+
var rootMessagesEn = /*#__PURE__*/_extends({}, messagesEn$b, messagesEn$6, messagesEn$3, messagesEn$2, messagesEn$c, messagesEn$a, messagesEn$9, messagesEn$8, messagesEn$7, messagesEn$5, messagesDe$1, messagesEn$4, messagesEn$1, messagesDe, messagesEn, unitMessagesEn);
|
|
2583
2571
|
|
|
2584
2572
|
var messages = {
|
|
2585
2573
|
en: rootMessagesEn,
|
|
@@ -2875,15 +2863,6 @@ var TextWithTextCards = function TextWithTextCards(_ref) {
|
|
|
2875
2863
|
}))));
|
|
2876
2864
|
};
|
|
2877
2865
|
|
|
2878
|
-
var CreditsAvailableState;
|
|
2879
|
-
(function (CreditsAvailableState) {
|
|
2880
|
-
CreditsAvailableState["YES"] = "yes";
|
|
2881
|
-
CreditsAvailableState["SOME"] = "some";
|
|
2882
|
-
CreditsAvailableState["NO"] = "no";
|
|
2883
|
-
CreditsAvailableState["NOT_YET"] = "notYet";
|
|
2884
|
-
})(CreditsAvailableState || (CreditsAvailableState = {}));
|
|
2885
|
-
var CreditsAvailableState$1 = CreditsAvailableState;
|
|
2886
|
-
|
|
2887
2866
|
var FORMAT_AS_HECTARE_CONFIG = {
|
|
2888
2867
|
unit: 'hectare',
|
|
2889
2868
|
unitDisplay: 'short',
|
|
@@ -2895,41 +2874,105 @@ var FORMAT_AS_PERCENT_CONFIG = {
|
|
|
2895
2874
|
maximumFractionDigits: 2
|
|
2896
2875
|
};
|
|
2897
2876
|
|
|
2898
|
-
var
|
|
2899
|
-
|
|
2900
|
-
|
|
2877
|
+
var CreditAvailability;
|
|
2878
|
+
(function (CreditAvailability) {
|
|
2879
|
+
CreditAvailability["CREDITS_AVAILABLE"] = "credits_available";
|
|
2880
|
+
CreditAvailability["NO_CREDITS_AVAILABLE"] = "no_credits_available";
|
|
2881
|
+
CreditAvailability["SOME_CREDITS_AVAILABLE"] = "some_credits_available";
|
|
2882
|
+
CreditAvailability["SOON_CREDITS_AVAILABLE"] = "soon_credits_available";
|
|
2883
|
+
})(CreditAvailability || (CreditAvailability = {}));
|
|
2884
|
+
|
|
2885
|
+
var CreditsAvailableBadge = function CreditsAvailableBadge(_ref) {
|
|
2886
|
+
var _variants;
|
|
2887
|
+
var status = _ref.status,
|
|
2888
|
+
href = _ref.href;
|
|
2901
2889
|
var _useContext = useContext(IntlContext),
|
|
2902
|
-
formatMessage = _useContext.formatMessage
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
}
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
}
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2890
|
+
formatMessage = _useContext.formatMessage;
|
|
2891
|
+
var variants = (_variants = {}, _variants[CreditAvailability.CREDITS_AVAILABLE] = {
|
|
2892
|
+
message: formatMessage({
|
|
2893
|
+
id: 'components.creditsAvailableBadge.text.yes'
|
|
2894
|
+
}),
|
|
2895
|
+
color: 'var(--boemly-colors-primary-800)'
|
|
2896
|
+
}, _variants[CreditAvailability.NO_CREDITS_AVAILABLE] = {
|
|
2897
|
+
message: formatMessage({
|
|
2898
|
+
id: 'components.creditsAvailableBadge.text.no'
|
|
2899
|
+
}),
|
|
2900
|
+
color: 'var(--boemly-colors-red-600)'
|
|
2901
|
+
}, _variants[CreditAvailability.SOME_CREDITS_AVAILABLE] = {
|
|
2902
|
+
message: formatMessage({
|
|
2903
|
+
id: 'components.creditsAvailableBadge.text.some'
|
|
2904
|
+
}),
|
|
2905
|
+
color: 'var(--boemly-colors-orange-500)'
|
|
2906
|
+
}, _variants[CreditAvailability.SOON_CREDITS_AVAILABLE] = {
|
|
2907
|
+
message: formatMessage({
|
|
2908
|
+
id: 'components.creditsAvailableBadge.text.notYet'
|
|
2909
|
+
}),
|
|
2910
|
+
color: 'var(--boemly-colors-blue-500)'
|
|
2911
|
+
}, _variants);
|
|
2912
|
+
var variant = variants[status];
|
|
2913
|
+
return React.createElement(Flex, {
|
|
2914
|
+
justifyContent: "flex-start",
|
|
2915
|
+
as: href ? Link : undefined,
|
|
2916
|
+
href: href
|
|
2917
|
+
}, React.createElement(Tag, {
|
|
2918
|
+
backgroundColor: variant.color,
|
|
2919
|
+
mt: "2",
|
|
2920
|
+
mb: "1"
|
|
2921
|
+
}, React.createElement(Text, {
|
|
2922
|
+
color: "white",
|
|
2923
|
+
size: "xsLowBold"
|
|
2924
|
+
}, variant.message)));
|
|
2925
|
+
};
|
|
2926
|
+
|
|
2927
|
+
var ProjectGridCard = function ProjectGridCard(_ref) {
|
|
2928
|
+
var _project$thumbnail, _project$thumbnail2, _project$thumbnail3;
|
|
2929
|
+
var project = _ref.project;
|
|
2930
|
+
var _useContext = useContext(IntlContext$1),
|
|
2931
|
+
formatNumber = _useContext.formatNumber,
|
|
2932
|
+
formatMessage = _useContext.formatMessage;
|
|
2933
|
+
return React.createElement(Container, null, React.createElement(Flex, {
|
|
2934
|
+
flexDir: "column",
|
|
2935
|
+
height: "full"
|
|
2936
|
+
}, project.thumbnail && React.createElement(Box, {
|
|
2937
|
+
borderRadius: "xl",
|
|
2938
|
+
position: "relative",
|
|
2939
|
+
height: "36",
|
|
2940
|
+
mb: "2"
|
|
2941
|
+
}, React.createElement(Image, {
|
|
2942
|
+
src: strapiMediaUrl((_project$thumbnail = project.thumbnail) == null ? void 0 : _project$thumbnail.img, 'medium'),
|
|
2943
|
+
alt: (_project$thumbnail2 = project.thumbnail) == null ? void 0 : _project$thumbnail2.alt,
|
|
2944
|
+
fill: true,
|
|
2945
|
+
style: {
|
|
2946
|
+
objectFit: ((_project$thumbnail3 = project.thumbnail) == null ? void 0 : _project$thumbnail3.objectFit) || 'cover',
|
|
2947
|
+
borderRadius: 'var(--boemly-radii-xl)'
|
|
2948
|
+
}
|
|
2949
|
+
})), React.createElement(Heading, {
|
|
2950
|
+
my: "4",
|
|
2951
|
+
size: "lg"
|
|
2952
|
+
}, project.title), React.createElement(Flex, {
|
|
2953
|
+
flexDir: "row",
|
|
2954
|
+
gap: "2"
|
|
2955
|
+
}, React.createElement(Tag, null, React.createElement(Text, {
|
|
2956
|
+
size: "xsLowBold",
|
|
2957
|
+
color: "gray.800"
|
|
2958
|
+
}, formatNumber((project.area || 0) / 10000, FORMAT_AS_HECTARE_CONFIG))), React.createElement(Tag, null, React.createElement(Text, {
|
|
2959
|
+
size: "xsLowBold",
|
|
2960
|
+
color: "gray.800"
|
|
2961
|
+
}, project.location)), project.certificationDate ? React.createElement(Tag, null, React.createElement(Text, {
|
|
2962
|
+
size: "xsLowBold",
|
|
2963
|
+
color: "gray.800"
|
|
2964
|
+
}, formatMessage({
|
|
2965
|
+
id: 'sections.projectCardGrid.certified'
|
|
2966
|
+
}, {
|
|
2967
|
+
year: project.certificationDate.getFullYear()
|
|
2968
|
+
}))) : React.createElement(Tag, null, React.createElement(Text, {
|
|
2969
|
+
size: "xsLowBold",
|
|
2970
|
+
color: "gray.800"
|
|
2971
|
+
}, formatMessage({
|
|
2972
|
+
id: 'sections.projectCardGrid.certificationInProgres'
|
|
2973
|
+
})))), React.createElement(CreditsAvailableBadge, {
|
|
2974
|
+
status: project.creditAvailability
|
|
2975
|
+
})));
|
|
2933
2976
|
};
|
|
2934
2977
|
|
|
2935
2978
|
var TextWithCard = function TextWithCard(_ref) {
|
|
@@ -2944,7 +2987,7 @@ var TextWithCard = function TextWithCard(_ref) {
|
|
|
2944
2987
|
rowSpan: 1,
|
|
2945
2988
|
position: "relative",
|
|
2946
2989
|
"data-testid": "card-position-" + slice.cardPosition
|
|
2947
|
-
}, portfolioProject && React.createElement(
|
|
2990
|
+
}, portfolioProject && React.createElement(ProjectGridCard, {
|
|
2948
2991
|
project: portfolioProject
|
|
2949
2992
|
}), !portfolioProject && slice.card && React.createElement(ProjectCard, {
|
|
2950
2993
|
facts: slice.card.facts,
|
|
@@ -3238,7 +3281,7 @@ var ProjectsGrid = function ProjectsGrid(_ref2) {
|
|
|
3238
3281
|
_hover: {
|
|
3239
3282
|
boxShadow: 'lg'
|
|
3240
3283
|
}
|
|
3241
|
-
}, React.createElement(
|
|
3284
|
+
}, React.createElement(ProjectGridCard, {
|
|
3242
3285
|
project: project
|
|
3243
3286
|
})));
|
|
3244
3287
|
}))));
|
|
@@ -3292,47 +3335,11 @@ var MinimalProviders = function MinimalProviders(_ref) {
|
|
|
3292
3335
|
}, children));
|
|
3293
3336
|
};
|
|
3294
3337
|
|
|
3295
|
-
var CreditsAvailableBadge = function CreditsAvailableBadge(_ref) {
|
|
3296
|
-
var _variants;
|
|
3297
|
-
var status = _ref.status,
|
|
3298
|
-
href = _ref.href;
|
|
3299
|
-
var _useContext = useContext(IntlContext),
|
|
3300
|
-
formatMessage = _useContext.formatMessage;
|
|
3301
|
-
var variants = (_variants = {}, _variants[CreditsAvailableState$1.YES] = {
|
|
3302
|
-
color: 'green',
|
|
3303
|
-
text: formatMessage({
|
|
3304
|
-
id: 'components.creditsAvailableBadge.text.yes'
|
|
3305
|
-
})
|
|
3306
|
-
}, _variants[CreditsAvailableState$1.SOME] = {
|
|
3307
|
-
color: 'orange',
|
|
3308
|
-
text: formatMessage({
|
|
3309
|
-
id: 'components.creditsAvailableBadge.text.some'
|
|
3310
|
-
})
|
|
3311
|
-
}, _variants[CreditsAvailableState$1.NO] = {
|
|
3312
|
-
color: 'red',
|
|
3313
|
-
text: formatMessage({
|
|
3314
|
-
id: 'components.creditsAvailableBadge.text.no'
|
|
3315
|
-
})
|
|
3316
|
-
}, _variants[CreditsAvailableState$1.NOT_YET] = {
|
|
3317
|
-
color: 'blue',
|
|
3318
|
-
text: formatMessage({
|
|
3319
|
-
id: 'components.creditsAvailableBadge.text.notYet'
|
|
3320
|
-
})
|
|
3321
|
-
}, _variants);
|
|
3322
|
-
var variant = variants[status];
|
|
3323
|
-
return React.createElement(Badge, {
|
|
3324
|
-
as: href ? Link : undefined,
|
|
3325
|
-
href: href,
|
|
3326
|
-
colorScheme: variant.color,
|
|
3327
|
-
width: "fit-content"
|
|
3328
|
-
}, variant.text);
|
|
3329
|
-
};
|
|
3330
|
-
|
|
3331
3338
|
var MapMarker = function MapMarker(_ref) {
|
|
3332
3339
|
var title = _ref.title,
|
|
3333
3340
|
projectDeveloper = _ref.projectDeveloper,
|
|
3334
3341
|
slug = _ref.slug,
|
|
3335
|
-
|
|
3342
|
+
creditAvailability = _ref.creditAvailability,
|
|
3336
3343
|
_ref$portfolioHost = _ref.portfolioHost,
|
|
3337
3344
|
portfolioHost = _ref$portfolioHost === void 0 ? '' : _ref$portfolioHost,
|
|
3338
3345
|
_ref$isPublic = _ref.isPublic,
|
|
@@ -3366,12 +3373,12 @@ var MapMarker = function MapMarker(_ref) {
|
|
|
3366
3373
|
maxWidth: ['3xs', null, null, 'sm']
|
|
3367
3374
|
}, React.createElement(Flex, {
|
|
3368
3375
|
direction: "column"
|
|
3369
|
-
},
|
|
3370
|
-
status:
|
|
3376
|
+
}, React.createElement(CreditsAvailableBadge, {
|
|
3377
|
+
status: creditAvailability,
|
|
3371
3378
|
href: slug && portfolioHost + "/portfolio/" + slug
|
|
3372
|
-
}), React.createElement(
|
|
3379
|
+
}), React.createElement(Spacer, {
|
|
3373
3380
|
height: "3"
|
|
3374
|
-
})
|
|
3381
|
+
}), React.createElement(Heading, {
|
|
3375
3382
|
size: "md"
|
|
3376
3383
|
}, title), projectDeveloper && React.createElement(Text, {
|
|
3377
3384
|
size: "smLowNormal",
|
|
@@ -3435,7 +3442,7 @@ var ProjectsMap = function ProjectsMap(_ref) {
|
|
|
3435
3442
|
isPublic: project.isPublic,
|
|
3436
3443
|
portfolioHost: project.portfolioHost,
|
|
3437
3444
|
slug: project.slug,
|
|
3438
|
-
|
|
3445
|
+
creditAvailability: project.creditAvailability,
|
|
3439
3446
|
projectDeveloper: (_project$projectDevel = project.projectDeveloper) == null ? void 0 : _project$projectDevel.name
|
|
3440
3447
|
})));
|
|
3441
3448
|
// Offset is needed to center the marker on the coordinates
|
|
@@ -4904,11 +4911,11 @@ var ProjectInfo = function ProjectInfo(_ref) {
|
|
|
4904
4911
|
}),
|
|
4905
4912
|
text: formatNumber(project.riskBuffer / 100, FORMAT_AS_PERCENT_CONFIG),
|
|
4906
4913
|
caption: subtitles.riskBufferSubtitle
|
|
4907
|
-
})))) : React.createElement(React.Fragment, null),
|
|
4914
|
+
})))) : React.createElement(React.Fragment, null), React.createElement(Box, {
|
|
4908
4915
|
mt: "2"
|
|
4909
4916
|
}, React.createElement(CreditsAvailableBadge, {
|
|
4910
|
-
status: project.
|
|
4911
|
-
}))
|
|
4917
|
+
status: project.creditAvailability
|
|
4918
|
+
})));
|
|
4912
4919
|
};
|
|
4913
4920
|
|
|
4914
4921
|
var DocumentsDownloadList = function DocumentsDownloadList(_ref) {
|