@moneylion/react-native-offer-carousel 1.0.4 → 1.0.6
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/lib/commonjs/capabilities/offer-catalog/src/api/offerCatalogApi.js.map +1 -1
- package/lib/commonjs/components/Cards/VideosCard/VideosCard.js +3 -3
- package/lib/commonjs/components/Common/BaseOfferCard/index.js +5 -5
- package/lib/commonjs/components/Common/BaseOfferCard/index.js.map +1 -1
- package/lib/commonjs/components/Common/DynamicOfferCard/CallToAction.js.map +1 -1
- package/lib/commonjs/components/Common/DynamicOfferCard/SeeMore.js.map +1 -1
- package/lib/commonjs/components/Common/DynamicOfferCard/index.js +2 -2
- package/lib/commonjs/components/Common/DynamicOfferCard/index.js.map +1 -1
- package/lib/commonjs/components/DynamicOffers/DynamicOffers.js +2 -2
- package/lib/commonjs/components/DynamicOffers/DynamicOffers.js.map +1 -1
- package/lib/commonjs/components/DynamicOffers/DynamicOffersContainer.js +1 -1
- package/lib/commonjs/components/DynamicOffers/DynamicOffersContainer.js.map +1 -1
- package/lib/commonjs/components/DynamicOffers/Render/DynamicOffersRender.js +5 -5
- package/lib/commonjs/components/DynamicOffers/Render/DynamicOffersRender.js.map +1 -1
- package/lib/commonjs/components/DynamicOffers/Render/FallbackOfferTemplate.js +2 -2
- package/lib/commonjs/components/DynamicOffers/Render/FallbackOfferTemplate.js.map +1 -1
- package/lib/commonjs/components/DynamicOffers/Render/Offer.js +5 -4
- package/lib/commonjs/components/DynamicOffers/Render/Offer.js.map +1 -1
- package/lib/commonjs/components/Layouts/CreditCardOfferCard/index.js +2 -2
- package/lib/commonjs/components/Layouts/CreditCardOfferCard/index.js.map +1 -1
- package/lib/commonjs/components/Layouts/CreditCardOfferCard/statsBuilder.js +1 -1
- package/lib/commonjs/components/Layouts/DefaultOfferCard/index.js +7 -3
- package/lib/commonjs/components/Layouts/DefaultOfferCard/index.js.map +1 -1
- package/lib/commonjs/components/Layouts/DefaultOfferCard/statsBuilder.js +1 -1
- package/lib/commonjs/components/Layouts/HeadlineWithDescriptionCard/index.js +7 -3
- package/lib/commonjs/components/Layouts/HeadlineWithDescriptionCard/index.js.map +1 -1
- package/lib/commonjs/components/Modal/OfferDetailsModal.js.map +1 -1
- package/lib/commonjs/components/MoneyLionOfferCarousel.js +6 -3
- package/lib/commonjs/components/MoneyLionOfferCarousel.js.map +1 -1
- package/lib/commonjs/components/View/index.js +3 -2
- package/lib/commonjs/components/View/index.js.map +1 -1
- package/lib/commonjs/context/ConfigurationProvider.js +30 -0
- package/lib/commonjs/context/ConfigurationProvider.js.map +1 -0
- package/lib/commonjs/pageData.js +4 -3
- package/lib/commonjs/pageData.js.map +1 -1
- package/lib/commonjs/services/getDynamicOffers.js.map +1 -1
- package/lib/commonjs/services/getProductTypesByQuery.js +1 -1
- package/lib/commonjs/services/getProductTypesByQuery.js.map +1 -1
- package/lib/commonjs/utils/formatOfferUrl.js +1 -1
- package/lib/commonjs/utils/getOffersByProductTypes.js +2 -2
- package/lib/commonjs/utils/getOffersByProductTypes.js.map +1 -1
- package/lib/commonjs/utils/selectDynamicOffers.js.map +1 -1
- package/lib/module/capabilities/offer-catalog/src/api/offerCatalogApi.js.map +1 -1
- package/lib/module/components/Cards/VideosCard/VideosCard.js +3 -3
- package/lib/module/components/Common/BaseOfferCard/index.js +5 -5
- package/lib/module/components/Common/BaseOfferCard/index.js.map +1 -1
- package/lib/module/components/Common/DynamicOfferCard/CallToAction.js.map +1 -1
- package/lib/module/components/Common/DynamicOfferCard/SeeMore.js.map +1 -1
- package/lib/module/components/Common/DynamicOfferCard/index.js +2 -2
- package/lib/module/components/Common/DynamicOfferCard/index.js.map +1 -1
- package/lib/module/components/DynamicOffers/DynamicOffers.js +2 -2
- package/lib/module/components/DynamicOffers/DynamicOffers.js.map +1 -1
- package/lib/module/components/DynamicOffers/DynamicOffersContainer.js +1 -1
- package/lib/module/components/DynamicOffers/DynamicOffersContainer.js.map +1 -1
- package/lib/module/components/DynamicOffers/Render/DynamicOffersRender.js +5 -5
- package/lib/module/components/DynamicOffers/Render/DynamicOffersRender.js.map +1 -1
- package/lib/module/components/DynamicOffers/Render/FallbackOfferTemplate.js +2 -2
- package/lib/module/components/DynamicOffers/Render/FallbackOfferTemplate.js.map +1 -1
- package/lib/module/components/DynamicOffers/Render/Offer.js +5 -4
- package/lib/module/components/DynamicOffers/Render/Offer.js.map +1 -1
- package/lib/module/components/Layouts/CreditCardOfferCard/index.js +2 -2
- package/lib/module/components/Layouts/CreditCardOfferCard/index.js.map +1 -1
- package/lib/module/components/Layouts/CreditCardOfferCard/statsBuilder.js +1 -1
- package/lib/module/components/Layouts/CreditCardOfferCard/statsBuilder.js.map +1 -1
- package/lib/module/components/Layouts/DefaultOfferCard/index.js +7 -3
- package/lib/module/components/Layouts/DefaultOfferCard/index.js.map +1 -1
- package/lib/module/components/Layouts/DefaultOfferCard/statsBuilder.js +1 -1
- package/lib/module/components/Layouts/DefaultOfferCard/statsBuilder.js.map +1 -1
- package/lib/module/components/Layouts/HeadlineWithDescriptionCard/index.js +7 -3
- package/lib/module/components/Layouts/HeadlineWithDescriptionCard/index.js.map +1 -1
- package/lib/module/components/Modal/OfferDetailsModal.js.map +1 -1
- package/lib/module/components/MoneyLionOfferCarousel.js +6 -3
- package/lib/module/components/MoneyLionOfferCarousel.js.map +1 -1
- package/lib/module/components/View/index.js +3 -2
- package/lib/module/components/View/index.js.map +1 -1
- package/lib/module/context/ConfigurationProvider.js +20 -0
- package/lib/module/context/ConfigurationProvider.js.map +1 -0
- package/lib/module/pageData.js +4 -3
- package/lib/module/pageData.js.map +1 -1
- package/lib/module/services/getDynamicOffers.js.map +1 -1
- package/lib/module/services/getProductTypesByQuery.js +1 -1
- package/lib/module/services/getProductTypesByQuery.js.map +1 -1
- package/lib/module/utils/formatOfferUrl.js +1 -1
- package/lib/module/utils/formatOfferUrl.js.map +1 -1
- package/lib/module/utils/getOffersByProductTypes.js +3 -2
- package/lib/module/utils/getOffersByProductTypes.js.map +1 -1
- package/lib/module/utils/selectDynamicOffers.js.map +1 -1
- package/lib/typescript/src/capabilities/offer-catalog/src/api/offerCatalogApi.d.ts +1 -1
- package/lib/typescript/src/capabilities/offer-catalog/src/api/offerCatalogApi.d.ts.map +1 -1
- package/lib/typescript/src/components/Common/BaseOfferCard/index.d.ts +3 -3
- package/lib/typescript/src/components/Common/BaseOfferCard/index.d.ts.map +1 -1
- package/lib/typescript/src/components/Common/DynamicOfferCard/CallToAction.d.ts +1 -1
- package/lib/typescript/src/components/Common/DynamicOfferCard/CallToAction.d.ts.map +1 -1
- package/lib/typescript/src/components/Common/DynamicOfferCard/SeeMore.d.ts +1 -1
- package/lib/typescript/src/components/Common/DynamicOfferCard/SeeMore.d.ts.map +1 -1
- package/lib/typescript/src/components/Common/DynamicOfferCard/index.d.ts +3 -3
- package/lib/typescript/src/components/Common/DynamicOfferCard/index.d.ts.map +1 -1
- package/lib/typescript/src/components/DynamicOffers/DynamicOffers.d.ts +2 -2
- package/lib/typescript/src/components/DynamicOffers/DynamicOffers.d.ts.map +1 -1
- package/lib/typescript/src/components/DynamicOffers/Render/DynamicOffersRender.d.ts +3 -3
- package/lib/typescript/src/components/DynamicOffers/Render/DynamicOffersRender.d.ts.map +1 -1
- package/lib/typescript/src/components/DynamicOffers/Render/FallbackOfferTemplate.d.ts +3 -3
- package/lib/typescript/src/components/DynamicOffers/Render/FallbackOfferTemplate.d.ts.map +1 -1
- package/lib/typescript/src/components/DynamicOffers/Render/Offer.d.ts +5 -4
- package/lib/typescript/src/components/DynamicOffers/Render/Offer.d.ts.map +1 -1
- package/lib/typescript/src/components/Layouts/CreditCardOfferCard/index.d.ts +3 -3
- package/lib/typescript/src/components/Layouts/CreditCardOfferCard/index.d.ts.map +1 -1
- package/lib/typescript/src/components/Layouts/CreditCardOfferCard/statsBuilder.d.ts +2 -2
- package/lib/typescript/src/components/Layouts/CreditCardOfferCard/statsBuilder.d.ts.map +1 -1
- package/lib/typescript/src/components/Layouts/DefaultOfferCard/index.d.ts +3 -3
- package/lib/typescript/src/components/Layouts/DefaultOfferCard/index.d.ts.map +1 -1
- package/lib/typescript/src/components/Layouts/DefaultOfferCard/statsBuilder.d.ts +3 -3
- package/lib/typescript/src/components/Layouts/DefaultOfferCard/statsBuilder.d.ts.map +1 -1
- package/lib/typescript/src/components/Layouts/HeadlineWithDescriptionCard/index.d.ts +3 -3
- package/lib/typescript/src/components/Layouts/HeadlineWithDescriptionCard/index.d.ts.map +1 -1
- package/lib/typescript/src/components/Modal/OfferDetailsModal.d.ts +1 -1
- package/lib/typescript/src/components/Modal/OfferDetailsModal.d.ts.map +1 -1
- package/lib/typescript/src/components/MoneyLionOfferCarousel.d.ts +1 -0
- package/lib/typescript/src/components/MoneyLionOfferCarousel.d.ts.map +1 -1
- package/lib/typescript/src/components/View/index.d.ts.map +1 -1
- package/lib/typescript/src/context/ConfigurationProvider.d.ts +12 -0
- package/lib/typescript/src/context/ConfigurationProvider.d.ts.map +1 -0
- package/lib/typescript/src/context/EventHandlerProvider.d.ts +1 -1
- package/lib/typescript/src/context/EventHandlerProvider.d.ts.map +1 -1
- package/lib/typescript/src/pageData.d.ts +2 -1
- package/lib/typescript/src/pageData.d.ts.map +1 -1
- package/lib/typescript/src/services/getDynamicOffers.d.ts +3 -3
- package/lib/typescript/src/services/getDynamicOffers.d.ts.map +1 -1
- package/lib/typescript/src/utils/addClientTagsToOfferLinks.d.ts +1 -1
- package/lib/typescript/src/utils/addClientTagsToOfferLinks.d.ts.map +1 -1
- package/lib/typescript/src/utils/formatOfferUrl.d.ts +6 -1
- package/lib/typescript/src/utils/formatOfferUrl.d.ts.map +1 -1
- package/lib/typescript/src/utils/getDefaultProductType.d.ts +1 -1
- package/lib/typescript/src/utils/getDefaultProductType.d.ts.map +1 -1
- package/lib/typescript/src/utils/getEnableUseCachedOffers.d.ts +1 -1
- package/lib/typescript/src/utils/getEnableUseCachedOffers.d.ts.map +1 -1
- package/lib/typescript/src/utils/getOffersBasedOnLayout.d.ts +1 -1
- package/lib/typescript/src/utils/getOffersBasedOnLayout.d.ts.map +1 -1
- package/lib/typescript/src/utils/getOffersByProductTypes.d.ts +1 -1
- package/lib/typescript/src/utils/getOffersByProductTypes.d.ts.map +1 -1
- package/lib/typescript/src/utils/getProductTypesDefinition.d.ts +1 -1
- package/lib/typescript/src/utils/getProductTypesDefinition.d.ts.map +1 -1
- package/lib/typescript/src/utils/selectDynamicOffers.d.ts +1 -1
- package/lib/typescript/src/utils/selectDynamicOffers.d.ts.map +1 -1
- package/lib/typescript/src/utils/sortOffersByRecommendationScore.d.ts +1 -1
- package/lib/typescript/src/utils/sortOffersByRecommendationScore.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/capabilities/offer-catalog/src/api/offerCatalogApi.ts +1 -1
- package/src/components/Cards/VideosCard/VideosCard.tsx +3 -3
- package/src/components/Common/BaseOfferCard/index.tsx +6 -6
- package/src/components/Common/DynamicOfferCard/CallToAction.tsx +1 -1
- package/src/components/Common/DynamicOfferCard/SeeMore.tsx +1 -1
- package/src/components/Common/DynamicOfferCard/index.tsx +4 -4
- package/src/components/DynamicOffers/DynamicOffers.tsx +3 -3
- package/src/components/DynamicOffers/DynamicOffersContainer.tsx +1 -1
- package/src/components/DynamicOffers/Render/DynamicOffersRender.tsx +7 -7
- package/src/components/DynamicOffers/Render/FallbackOfferTemplate.tsx +4 -4
- package/src/components/DynamicOffers/Render/Offer.tsx +9 -6
- package/src/components/Layouts/CreditCardOfferCard/index.tsx +4 -5
- package/src/components/Layouts/CreditCardOfferCard/statsBuilder.tsx +2 -2
- package/src/components/Layouts/DefaultOfferCard/index.tsx +13 -11
- package/src/components/Layouts/DefaultOfferCard/statsBuilder.tsx +2 -2
- package/src/components/Layouts/HeadlineWithDescriptionCard/index.tsx +14 -11
- package/src/components/Modal/OfferDetailsModal.tsx +1 -1
- package/src/components/MoneyLionOfferCarousel.tsx +8 -4
- package/src/components/View/index.tsx +2 -7
- package/src/context/ConfigurationProvider.tsx +35 -0
- package/src/context/EventHandlerProvider.tsx +1 -1
- package/src/pageData.ts +5 -3
- package/src/services/getDynamicOffers.ts +5 -5
- package/src/services/getProductTypesByQuery.ts +1 -1
- package/src/utils/addClientTagsToOfferLinks.ts +1 -1
- package/src/utils/formatOfferUrl.ts +1 -1
- package/src/utils/getDefaultProductType.ts +1 -1
- package/src/utils/getEnableUseCachedOffers.ts +1 -1
- package/src/utils/getOffersBasedOnLayout.ts +1 -1
- package/src/utils/getOffersByProductTypes.ts +4 -3
- package/src/utils/getProductTypesDefinition.ts +1 -1
- package/src/utils/selectDynamicOffers.ts +1 -2
- package/src/utils/sortOffersByRecommendationScore.ts +1 -1
- package/lib/commonjs/context/CNFProvider.js +0 -2
- package/lib/commonjs/context/CNFProvider.js.map +0 -1
- package/lib/module/context/CNFProvider.js +0 -2
- package/lib/module/context/CNFProvider.js.map +0 -1
- package/lib/typescript/src/context/CNFProvider.d.ts +0 -1
- package/lib/typescript/src/context/CNFProvider.d.ts.map +0 -1
- package/src/context/CNFProvider.tsx +0 -0
package/package.json
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { isEmpty } from "radash";
|
|
2
|
-
import type { CnfContext } from "../../../core/src/system/cnfContext/CnfContext";
|
|
3
2
|
import type { OffersData } from "../types/offerCatalogSchema";
|
|
4
3
|
import {
|
|
5
4
|
getIsDevEnvironment,
|
|
@@ -12,6 +11,7 @@ import errorUtil from "../utils/errorUtil";
|
|
|
12
11
|
import type { State } from "../../../offers/pipeline/src/sources/ratetables/types";
|
|
13
12
|
import { withDeviceSignals } from "../../../offers/pipeline/src/sources/ratetables/withDeviceSignals";
|
|
14
13
|
import { getOfferCatalogApiBaseUrl } from "../../../../apiEnvironment";
|
|
14
|
+
import type { CnfContext } from "../../../core/src/system/cnfContext/CnfContext";
|
|
15
15
|
|
|
16
16
|
export const getCachedOffersByProductTypes =
|
|
17
17
|
(context: CnfContext) => async (productTypes: string[]) => {
|
|
@@ -13,19 +13,19 @@
|
|
|
13
13
|
|
|
14
14
|
// export type VideosCardProps = {
|
|
15
15
|
// videosContent: VideosContent;
|
|
16
|
-
//
|
|
16
|
+
// showCardBorder: boolean;
|
|
17
17
|
// };
|
|
18
18
|
|
|
19
19
|
// export const VideosCard = memo(
|
|
20
20
|
// ({
|
|
21
21
|
// videosContent: { title, subtitle, videos },
|
|
22
|
-
//
|
|
22
|
+
// showCardBorder,
|
|
23
23
|
// }: VideosCardProps) => {
|
|
24
24
|
// const renderVideos = () =>
|
|
25
25
|
// videos.map((video) => <VideoContent key={video.muxId} {...video} />);
|
|
26
26
|
|
|
27
27
|
// return (
|
|
28
|
-
// <GenericOfferVertical
|
|
28
|
+
// <GenericOfferVertical showCardBorder={showCardBorder}>
|
|
29
29
|
// <GenericOfferVertical.Container>
|
|
30
30
|
// <View style={styles.textContainer}>
|
|
31
31
|
// <Text variant="featured-2" weight="bold">
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import React, { type ComponentProps } from "react";
|
|
2
2
|
|
|
3
|
-
import { ThumborImage } from "../../../../src/capabilities/ui/elements/src";
|
|
4
|
-
import { MarkdownText } from "../../../../src/capabilities/ui/elements/src/components/MarkdownText";
|
|
5
|
-
import { arrayToMarkdownList } from "../../../../src/capabilities/offer-catalog/src";
|
|
6
3
|
import { StatsContainer } from "./StatsContainer";
|
|
7
4
|
import { Content } from "./Content";
|
|
8
5
|
import { Stat } from "./Stat";
|
|
@@ -11,16 +8,19 @@ import Divider from "../../Divider";
|
|
|
11
8
|
import Text, { type TextProps } from "../../Text";
|
|
12
9
|
import View, { type ViewProps } from "../../View";
|
|
13
10
|
import { StyleSheet } from "react-native";
|
|
11
|
+
import { ThumborImage } from "../../../capabilities/ui/elements/src";
|
|
12
|
+
import { arrayToMarkdownList } from "../../../capabilities/offer-catalog/src";
|
|
13
|
+
import { MarkdownText } from "../../../capabilities/ui/elements/src/components/MarkdownText";
|
|
14
14
|
|
|
15
15
|
const CardWidth = 282;
|
|
16
16
|
|
|
17
17
|
const BaseOfferCard = ({
|
|
18
18
|
children,
|
|
19
|
-
|
|
19
|
+
showCardBorder = true,
|
|
20
20
|
...rest
|
|
21
|
-
}: ViewProps & {
|
|
21
|
+
}: ViewProps & { showCardBorder: boolean }) => (
|
|
22
22
|
<View
|
|
23
|
-
borderColor={
|
|
23
|
+
borderColor={showCardBorder ? "neutral" : undefined}
|
|
24
24
|
direction={"column"}
|
|
25
25
|
backgroundColor={"white"}
|
|
26
26
|
width={CardWidth}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { type ComponentProps } from "react";
|
|
2
2
|
import { BaseOfferCard } from "../BaseOfferCard";
|
|
3
|
-
import type { BaseOffer } from "../../../../src/capabilities/offer-catalog/src";
|
|
4
3
|
import type Button from "../../Button";
|
|
5
4
|
import { Linking } from "react-native";
|
|
6
5
|
import { useEventHandler } from "../../../context/EventHandlerProvider";
|
|
6
|
+
import type { BaseOffer } from "../../../capabilities/offer-catalog/src";
|
|
7
7
|
|
|
8
8
|
export type CTAProps = ComponentProps<typeof Button & { href: string }> & {
|
|
9
9
|
overrideUrl?: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useCallback, useState } from "react";
|
|
2
|
-
import type { BaseOffer } from "../../../../src/capabilities/offer-catalog/src";
|
|
3
2
|
import Text from "../../Text";
|
|
4
3
|
import { TouchableOpacity, StyleSheet } from "react-native";
|
|
5
4
|
import { OfferDetailsModal } from "../../Modal/OfferDetailsModal";
|
|
6
5
|
import { useEventHandler } from "../../../context/EventHandlerProvider";
|
|
6
|
+
import type { BaseOffer } from "../../../capabilities/offer-catalog/src";
|
|
7
7
|
|
|
8
8
|
export type SeeMoreProps = {
|
|
9
9
|
offer: BaseOffer;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type { BaseOffer } from "../../../../src/capabilities/offer-catalog/src";
|
|
2
1
|
import React from "react";
|
|
3
2
|
import { BaseOfferCard } from "../BaseOfferCard";
|
|
4
3
|
import { CallToAction } from "./CallToAction";
|
|
5
4
|
import { StyleSheet } from "react-native";
|
|
5
|
+
import type { BaseOffer } from "../../../capabilities/offer-catalog/src";
|
|
6
6
|
|
|
7
7
|
type DefaultOfferCatalogOfferType = {
|
|
8
8
|
children: React.ReactNode;
|
|
9
9
|
offer: BaseOffer;
|
|
10
10
|
offerIndex: number;
|
|
11
|
-
|
|
11
|
+
showCardBorder: boolean;
|
|
12
12
|
showProductTypeLabel?: boolean;
|
|
13
13
|
};
|
|
14
14
|
|
|
@@ -16,11 +16,11 @@ function DynamicOfferCard({
|
|
|
16
16
|
children,
|
|
17
17
|
offer,
|
|
18
18
|
offerIndex,
|
|
19
|
-
|
|
19
|
+
showCardBorder,
|
|
20
20
|
showProductTypeLabel,
|
|
21
21
|
}: DefaultOfferCatalogOfferType) {
|
|
22
22
|
return (
|
|
23
|
-
<BaseOfferCard
|
|
23
|
+
<BaseOfferCard showCardBorder={showCardBorder}>
|
|
24
24
|
{showProductTypeLabel && (
|
|
25
25
|
<BaseOfferCard.TopBar>
|
|
26
26
|
<BaseOfferCard.ProductType>
|
|
@@ -8,7 +8,7 @@ import { View } from "react-native";
|
|
|
8
8
|
export type DynamicOfferProps = {
|
|
9
9
|
title: string;
|
|
10
10
|
displayLayout: Layout;
|
|
11
|
-
|
|
11
|
+
showCardBorder: boolean;
|
|
12
12
|
showProductTypeLabel?: boolean;
|
|
13
13
|
shouldHideFooter: boolean;
|
|
14
14
|
} & Pick<DynamicOffersRenderProps, "offers">;
|
|
@@ -16,7 +16,7 @@ export type DynamicOfferProps = {
|
|
|
16
16
|
export const DynamicOffers = ({
|
|
17
17
|
title,
|
|
18
18
|
displayLayout,
|
|
19
|
-
|
|
19
|
+
showCardBorder,
|
|
20
20
|
showProductTypeLabel,
|
|
21
21
|
// shouldHideFooter,
|
|
22
22
|
offers,
|
|
@@ -37,7 +37,7 @@ export const DynamicOffers = ({
|
|
|
37
37
|
displayLayout={displayLayout}
|
|
38
38
|
fallbackTemplate={FallbackOfferTemplate}
|
|
39
39
|
productTypeBuilder={productTypeBuilder}
|
|
40
|
-
|
|
40
|
+
showCardBorder={showCardBorder}
|
|
41
41
|
showProductTypeLabel={showProductTypeLabel}
|
|
42
42
|
/>
|
|
43
43
|
{/* {!shouldHideFooter && <Footer offers={offers} />} */}
|
|
@@ -28,7 +28,7 @@ export const DynamicOffersContainer = React.memo(
|
|
|
28
28
|
title={config.title}
|
|
29
29
|
showProductTypeLabel={config.showProductTypeLabel}
|
|
30
30
|
displayLayout={config.displayLayout}
|
|
31
|
-
|
|
31
|
+
showCardBorder={config.showCardBorder}
|
|
32
32
|
shouldHideFooter={config.shouldHideFooter}
|
|
33
33
|
/>
|
|
34
34
|
</Suspense>
|
|
@@ -5,7 +5,6 @@ import React, {
|
|
|
5
5
|
useRef,
|
|
6
6
|
useState,
|
|
7
7
|
} from "react";
|
|
8
|
-
import type { BaseOffer } from "../../../../src/capabilities/offer-catalog/src/types/offerCatalogSchema";
|
|
9
8
|
import type { Layout } from "../../../utils";
|
|
10
9
|
import { productTypeBuilder as builder } from "../../../builder/builder";
|
|
11
10
|
import { Offer } from "./Offer";
|
|
@@ -19,6 +18,7 @@ import {
|
|
|
19
18
|
type NativeSyntheticEvent,
|
|
20
19
|
} from "react-native";
|
|
21
20
|
import { useEventHandler } from "../../../context/EventHandlerProvider";
|
|
21
|
+
import type { BaseOffer } from "../../../capabilities/offer-catalog/src";
|
|
22
22
|
|
|
23
23
|
export type DynamicOffersRenderProps = {
|
|
24
24
|
title: string;
|
|
@@ -30,7 +30,7 @@ export type DynamicOffersRenderProps = {
|
|
|
30
30
|
offerIndex: number;
|
|
31
31
|
}>;
|
|
32
32
|
productTypeBuilder: typeof builder;
|
|
33
|
-
|
|
33
|
+
showCardBorder: boolean;
|
|
34
34
|
showProductTypeLabel?: boolean;
|
|
35
35
|
};
|
|
36
36
|
|
|
@@ -40,7 +40,7 @@ export const DynamicOffersRender = ({
|
|
|
40
40
|
displayLayout,
|
|
41
41
|
productTypeBuilder = builder,
|
|
42
42
|
fallbackTemplate,
|
|
43
|
-
|
|
43
|
+
showCardBorder,
|
|
44
44
|
showProductTypeLabel,
|
|
45
45
|
}: DynamicOffersRenderProps) => {
|
|
46
46
|
// Performance optimization: store card measurements
|
|
@@ -178,13 +178,13 @@ export const DynamicOffersRender = ({
|
|
|
178
178
|
// Create offer components
|
|
179
179
|
return displayLayout === "fixed"
|
|
180
180
|
? [
|
|
181
|
-
// <VideosCard key="videos-card" videosContent={videosContent}
|
|
181
|
+
// <VideosCard key="videos-card" videosContent={videosContent} showCardBorder={showCardBorder} />,
|
|
182
182
|
...Offer({
|
|
183
183
|
productTypeBuilder,
|
|
184
184
|
offers,
|
|
185
185
|
showProductTypeLabel,
|
|
186
186
|
fallbackTemplate,
|
|
187
|
-
|
|
187
|
+
showCardBorder,
|
|
188
188
|
}),
|
|
189
189
|
]
|
|
190
190
|
: Offer({
|
|
@@ -192,7 +192,7 @@ export const DynamicOffersRender = ({
|
|
|
192
192
|
offers,
|
|
193
193
|
showProductTypeLabel,
|
|
194
194
|
fallbackTemplate,
|
|
195
|
-
|
|
195
|
+
showCardBorder,
|
|
196
196
|
});
|
|
197
197
|
}, [
|
|
198
198
|
displayLayout,
|
|
@@ -200,7 +200,7 @@ export const DynamicOffersRender = ({
|
|
|
200
200
|
offers,
|
|
201
201
|
showProductTypeLabel,
|
|
202
202
|
fallbackTemplate,
|
|
203
|
-
|
|
203
|
+
showCardBorder,
|
|
204
204
|
]);
|
|
205
205
|
|
|
206
206
|
// Wrapped offer components with layout measurement
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { HeadlineWithDescriptionCard } from "../../Layouts/HeadlineWithDescriptionCard";
|
|
3
|
-
import type { BaseOffer } from "
|
|
3
|
+
import type { BaseOffer } from "../../../capabilities/offer-catalog/src";
|
|
4
4
|
|
|
5
5
|
export function FallbackOfferTemplate({
|
|
6
6
|
offer,
|
|
7
7
|
offerIndex,
|
|
8
|
-
|
|
8
|
+
showCardBorder = true,
|
|
9
9
|
showProductTypeLabel = true,
|
|
10
10
|
}: {
|
|
11
11
|
offer: BaseOffer;
|
|
12
12
|
offerIndex: number;
|
|
13
|
-
|
|
13
|
+
showCardBorder?: boolean;
|
|
14
14
|
showProductTypeLabel?: boolean;
|
|
15
15
|
}) {
|
|
16
16
|
return (
|
|
@@ -22,7 +22,7 @@ export function FallbackOfferTemplate({
|
|
|
22
22
|
productTypes: [],
|
|
23
23
|
layout: "headlineWithDescriptionCard",
|
|
24
24
|
}}
|
|
25
|
-
|
|
25
|
+
showCardBorder={showCardBorder}
|
|
26
26
|
showProductTypeLabel={showProductTypeLabel}
|
|
27
27
|
/>
|
|
28
28
|
);
|
|
@@ -3,12 +3,12 @@ import React, { Fragment } from "react";
|
|
|
3
3
|
import { match } from "ts-pattern";
|
|
4
4
|
|
|
5
5
|
import type { ProductTypeBuilder } from "../../../builder";
|
|
6
|
-
import type { BaseOffer } from "../../../../src/capabilities/offer-catalog/src";
|
|
7
6
|
import {
|
|
8
7
|
DefaultOfferCard,
|
|
9
8
|
CreditCardOfferCard,
|
|
10
9
|
HeadlineWithDescriptionCard,
|
|
11
10
|
} from "../../Layouts";
|
|
11
|
+
import type { BaseOffer } from "../../../capabilities/offer-catalog/src";
|
|
12
12
|
|
|
13
13
|
type RenderOfferListProps = {
|
|
14
14
|
productTypeBuilder: ProductTypeBuilder;
|
|
@@ -17,12 +17,14 @@ type RenderOfferListProps = {
|
|
|
17
17
|
offer,
|
|
18
18
|
offerIndex,
|
|
19
19
|
showProductTypeLabel,
|
|
20
|
+
showCardBorder,
|
|
20
21
|
}: {
|
|
21
22
|
offer: BaseOffer;
|
|
22
23
|
offerIndex: number;
|
|
23
24
|
showProductTypeLabel?: boolean;
|
|
25
|
+
showCardBorder?: boolean;
|
|
24
26
|
}) => React.ReactNode;
|
|
25
|
-
|
|
27
|
+
showCardBorder?: boolean;
|
|
26
28
|
showProductTypeLabel?: boolean;
|
|
27
29
|
// featureClient?: CnfFeatureClient; TODO: this is the like split on cnf side it uses growthbook
|
|
28
30
|
};
|
|
@@ -32,7 +34,7 @@ export const Offer = ({
|
|
|
32
34
|
offers,
|
|
33
35
|
showProductTypeLabel = true,
|
|
34
36
|
fallbackTemplate,
|
|
35
|
-
|
|
37
|
+
showCardBorder = true,
|
|
36
38
|
}: RenderOfferListProps) =>
|
|
37
39
|
offers.map((offer: BaseOffer, offerIndex: number) => {
|
|
38
40
|
const builder = productTypeBuilder.find(({ productTypes }) =>
|
|
@@ -56,7 +58,7 @@ export const Offer = ({
|
|
|
56
58
|
key={`${offerIndex}-${offer.uuid}`}
|
|
57
59
|
offer={offer}
|
|
58
60
|
productTypeBuilder={layout}
|
|
59
|
-
|
|
61
|
+
showCardBorder={showCardBorder}
|
|
60
62
|
showProductTypeLabel={showProductTypeLabel}
|
|
61
63
|
/>
|
|
62
64
|
))
|
|
@@ -66,7 +68,7 @@ export const Offer = ({
|
|
|
66
68
|
key={`${offerIndex}-${offer.uuid}`}
|
|
67
69
|
offer={offer}
|
|
68
70
|
productTypeBuilder={layout}
|
|
69
|
-
|
|
71
|
+
showCardBorder={showCardBorder}
|
|
70
72
|
showProductTypeLabel={showProductTypeLabel}
|
|
71
73
|
/>
|
|
72
74
|
))
|
|
@@ -76,7 +78,7 @@ export const Offer = ({
|
|
|
76
78
|
key={`${offerIndex}-${offer.uuid}`}
|
|
77
79
|
offer={offer}
|
|
78
80
|
productTypeBuilder={layout}
|
|
79
|
-
|
|
81
|
+
showCardBorder={showCardBorder}
|
|
80
82
|
showProductTypeLabel={showProductTypeLabel}
|
|
81
83
|
/>
|
|
82
84
|
))
|
|
@@ -87,6 +89,7 @@ export const Offer = ({
|
|
|
87
89
|
const FallbackTemplate = fallbackTemplate;
|
|
88
90
|
return (
|
|
89
91
|
<FallbackTemplate
|
|
92
|
+
showCardBorder={showCardBorder}
|
|
90
93
|
offerIndex={offerIndex}
|
|
91
94
|
key={`${offerIndex}-${offer.uuid}`}
|
|
92
95
|
offer={offer}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { get } from "radash";
|
|
2
|
-
import type { BaseOffer } from "../../../../src/capabilities/offer-catalog/src";
|
|
3
|
-
|
|
4
2
|
import React from "react";
|
|
5
3
|
|
|
6
4
|
import type { CreditCardOfferCard as CreditCardOfferCardBuilderProps } from "../../../builder";
|
|
@@ -10,11 +8,12 @@ import Divider from "../../Divider";
|
|
|
10
8
|
import Text from "../../Text";
|
|
11
9
|
import { CallToAction } from "../../Common/DynamicOfferCard/CallToAction";
|
|
12
10
|
import { StyleSheet } from "react-native";
|
|
11
|
+
import type { BaseOffer } from "../../../capabilities/offer-catalog/src";
|
|
13
12
|
|
|
14
13
|
type CreditCardOfferCardProps = {
|
|
15
14
|
productTypeBuilder: CreditCardOfferCardBuilderProps;
|
|
16
15
|
offer: BaseOffer;
|
|
17
|
-
|
|
16
|
+
showCardBorder: boolean;
|
|
18
17
|
showProductTypeLabel?: boolean;
|
|
19
18
|
offerIndex: number;
|
|
20
19
|
};
|
|
@@ -22,7 +21,7 @@ type CreditCardOfferCardProps = {
|
|
|
22
21
|
export const CreditCardOfferCard = ({
|
|
23
22
|
offer,
|
|
24
23
|
productTypeBuilder,
|
|
25
|
-
|
|
24
|
+
showCardBorder,
|
|
26
25
|
showProductTypeLabel,
|
|
27
26
|
offerIndex,
|
|
28
27
|
}: CreditCardOfferCardProps) => {
|
|
@@ -34,7 +33,7 @@ export const CreditCardOfferCard = ({
|
|
|
34
33
|
const showBadge = badges.length > 0;
|
|
35
34
|
|
|
36
35
|
return (
|
|
37
|
-
<BaseOfferCard
|
|
36
|
+
<BaseOfferCard showCardBorder={showCardBorder}>
|
|
38
37
|
{showProductTypeLabel && (
|
|
39
38
|
<BaseOfferCard.TopBar>
|
|
40
39
|
<BaseOfferCard.ProductType>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { BaseOffer } from "../../../../src/capabilities/offer-catalog/src";
|
|
2
1
|
import type { CreditCardOfferCard } from "../../../builder";
|
|
3
|
-
import {
|
|
2
|
+
import type { BaseOffer } from "../../../capabilities/offer-catalog/src";
|
|
3
|
+
import { statsToElementPropsBuilder } from "../../../capabilities/offer-catalog/src/utils/stats";
|
|
4
4
|
|
|
5
5
|
export const makeCreditCardOfferStats =
|
|
6
6
|
(productTypeBuilder: CreditCardOfferCard) => (offer: BaseOffer) => {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { get } from "radash";
|
|
2
|
-
|
|
3
|
-
import type { BaseOffer } from "../../../../src/capabilities/offer-catalog/src";
|
|
4
2
|
import React from "react";
|
|
5
3
|
|
|
6
4
|
import { makeDefaultOfferCardStats } from "./statsBuilder";
|
|
7
5
|
import type { DefaultOfferCard as DefaultOfferCardBuilderProps } from "../../../builder";
|
|
8
6
|
import { BaseOfferCard, DynamicOfferCard, SeeMore } from "../../Common";
|
|
7
|
+
import { useConfiguration } from "../../../context/ConfigurationProvider";
|
|
8
|
+
import type { BaseOffer } from "../../../capabilities/offer-catalog/src";
|
|
9
9
|
|
|
10
10
|
type DefaultOfferCardProps = {
|
|
11
11
|
productTypeBuilder: DefaultOfferCardBuilderProps;
|
|
12
12
|
offer: BaseOffer;
|
|
13
13
|
offerIndex: number;
|
|
14
|
-
|
|
14
|
+
showCardBorder: boolean;
|
|
15
15
|
showProductTypeLabel?: boolean;
|
|
16
16
|
};
|
|
17
17
|
|
|
@@ -19,7 +19,7 @@ export const DefaultOfferCard = ({
|
|
|
19
19
|
offer,
|
|
20
20
|
productTypeBuilder,
|
|
21
21
|
offerIndex,
|
|
22
|
-
|
|
22
|
+
showCardBorder,
|
|
23
23
|
showProductTypeLabel,
|
|
24
24
|
}: DefaultOfferCardProps) => {
|
|
25
25
|
const { stats, topStats } =
|
|
@@ -32,12 +32,14 @@ export const DefaultOfferCard = ({
|
|
|
32
32
|
|
|
33
33
|
const contentDescription = description || legalInformation;
|
|
34
34
|
|
|
35
|
+
const { showDescriptionPoints } = useConfiguration();
|
|
36
|
+
|
|
35
37
|
return (
|
|
36
38
|
<DynamicOfferCard
|
|
37
39
|
key={`${offerIndex}-${offer.uuid}`}
|
|
38
40
|
offer={offer}
|
|
39
41
|
offerIndex={offerIndex}
|
|
40
|
-
|
|
42
|
+
showCardBorder={showCardBorder}
|
|
41
43
|
showProductTypeLabel={showProductTypeLabel}
|
|
42
44
|
>
|
|
43
45
|
<BaseOfferCard.TopContainer>
|
|
@@ -59,12 +61,12 @@ export const DefaultOfferCard = ({
|
|
|
59
61
|
content={stat.content}
|
|
60
62
|
/>
|
|
61
63
|
))}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
{showDescriptionPoints && (
|
|
65
|
+
<BaseOfferCard.DescriptionHandler
|
|
66
|
+
descriptionPoints={descriptionPoints}
|
|
67
|
+
contentDescription={contentDescription}
|
|
68
|
+
/>
|
|
69
|
+
)}
|
|
68
70
|
{showMoreInfo && <SeeMore offer={offer} offerIndex={offerIndex} />}
|
|
69
71
|
</BaseOfferCard.Stats>
|
|
70
72
|
</DynamicOfferCard>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { BaseOffer } from "../../../../src/capabilities/offer-catalog/src";
|
|
2
1
|
import type { DefaultOfferCard } from "../../../builder";
|
|
3
|
-
import {
|
|
2
|
+
import type { BaseOffer } from "../../../capabilities/offer-catalog/src";
|
|
3
|
+
import { statsToElementPropsBuilder } from "../../../capabilities/offer-catalog/src/utils/stats";
|
|
4
4
|
|
|
5
5
|
export const makeDefaultOfferCardStats =
|
|
6
6
|
(productTypeBuilder: DefaultOfferCard) => (offer: BaseOffer) => {
|
|
@@ -2,22 +2,23 @@ import { get } from "radash";
|
|
|
2
2
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { SeeMore } from "../../Common/DynamicOfferCard/SeeMore";
|
|
5
|
-
import type { BaseOffer } from "../../../../src/capabilities/offer-catalog/src";
|
|
6
5
|
import type { HeadlineWithDescriptionCard as HeadlineWithDescriptionCardBuilderProps } from "../../../builder";
|
|
7
6
|
import { BaseOfferCard, DynamicOfferCard } from "../../Common";
|
|
7
|
+
import { useConfiguration } from "../../../context/ConfigurationProvider";
|
|
8
|
+
import type { BaseOffer } from "../../../capabilities/offer-catalog/src";
|
|
8
9
|
|
|
9
10
|
type HeadlineWithDescriptionCardProps = {
|
|
10
11
|
productTypeBuilder: HeadlineWithDescriptionCardBuilderProps;
|
|
11
12
|
offer: BaseOffer;
|
|
12
13
|
offerIndex: number;
|
|
13
|
-
|
|
14
|
+
showCardBorder: boolean;
|
|
14
15
|
showProductTypeLabel?: boolean;
|
|
15
16
|
};
|
|
16
17
|
export const HeadlineWithDescriptionCard = ({
|
|
17
18
|
offer,
|
|
18
19
|
productTypeBuilder,
|
|
19
20
|
offerIndex,
|
|
20
|
-
|
|
21
|
+
showCardBorder,
|
|
21
22
|
showProductTypeLabel,
|
|
22
23
|
}: HeadlineWithDescriptionCardProps) => {
|
|
23
24
|
const {
|
|
@@ -35,24 +36,26 @@ export const HeadlineWithDescriptionCard = ({
|
|
|
35
36
|
|
|
36
37
|
const contentDescription = description || legalInformation;
|
|
37
38
|
|
|
39
|
+
const { showDescriptionPoints } = useConfiguration();
|
|
40
|
+
|
|
38
41
|
return (
|
|
39
42
|
<DynamicOfferCard
|
|
40
43
|
key={`${offerIndex}-${offer.uuid}`}
|
|
41
44
|
offer={offer}
|
|
42
45
|
offerIndex={offerIndex}
|
|
43
|
-
|
|
46
|
+
showCardBorder={showCardBorder}
|
|
44
47
|
showProductTypeLabel={showProductTypeLabel}
|
|
45
48
|
>
|
|
46
49
|
<BaseOfferCard.TopContainer>
|
|
47
50
|
<BaseOfferCard.Headline>{headline}</BaseOfferCard.Headline>
|
|
48
51
|
</BaseOfferCard.TopContainer>
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
{showDescriptionPoints && (
|
|
53
|
+
<BaseOfferCard.DescriptionHandler
|
|
54
|
+
descriptionPoints={descriptionPoints}
|
|
55
|
+
contentDescription={contentDescription}
|
|
56
|
+
hasDivider={false}
|
|
57
|
+
/>
|
|
58
|
+
)}
|
|
56
59
|
{showMoreInfo && <SeeMore offer={offer} offerIndex={offerIndex} />}
|
|
57
60
|
</DynamicOfferCard>
|
|
58
61
|
);
|
|
@@ -10,11 +10,11 @@ import {
|
|
|
10
10
|
Platform,
|
|
11
11
|
} from "react-native";
|
|
12
12
|
import Text from "../Text";
|
|
13
|
-
import type { BaseOffer } from "../../../src/capabilities/offer-catalog/src";
|
|
14
13
|
import { DescriptionPoints } from "./DescriptionPoints";
|
|
15
14
|
import { Disclaimer } from "./Disclaimer";
|
|
16
15
|
import { CallToAction } from "../Common/DynamicOfferCard/CallToAction";
|
|
17
16
|
import Divider from "../Divider";
|
|
17
|
+
import type { BaseOffer } from "../../capabilities/offer-catalog/src";
|
|
18
18
|
|
|
19
19
|
type OfferDetailsModalProps = {
|
|
20
20
|
visible: boolean;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState } from "react";
|
|
2
2
|
import { localCnfContext } from "../config/mocks/cnfContext";
|
|
3
3
|
import { Text } from "react-native";
|
|
4
|
-
import type { CnfContext } from "../../src/capabilities/core/src/system/cnfContext/CnfContext";
|
|
5
4
|
import { getPageData } from "../pageData";
|
|
6
5
|
import type { Layout } from "../utils";
|
|
7
6
|
import {
|
|
@@ -15,6 +14,8 @@ import {
|
|
|
15
14
|
type EventHandlerContextType,
|
|
16
15
|
} from "../context/EventHandlerProvider";
|
|
17
16
|
import { getConfigApiBaseUrl } from "../apiEnvironment";
|
|
17
|
+
import { ConfigurationProvider } from "../context/ConfigurationProvider";
|
|
18
|
+
import type { CnfContext } from "../capabilities/core/src/system/cnfContext/CnfContext";
|
|
18
19
|
import { getDefaultPaletteColor } from "../utils/getDefaultPaletteColor";
|
|
19
20
|
|
|
20
21
|
export type MoneyLionOfferCarouselProps = {
|
|
@@ -30,6 +31,7 @@ export type MoneyLionOfferCarouselProps = {
|
|
|
30
31
|
fontFamily?: Partial<FontFamily>;
|
|
31
32
|
showProductTypeLabel?: boolean;
|
|
32
33
|
isDev: boolean;
|
|
34
|
+
showCardBorder?: boolean;
|
|
33
35
|
};
|
|
34
36
|
|
|
35
37
|
const getConfiguration = async ({
|
|
@@ -164,7 +166,7 @@ export const MoneyLionOfferCarousel = (
|
|
|
164
166
|
shouldHideFooter,
|
|
165
167
|
displayLayout,
|
|
166
168
|
showProductTypeLabel,
|
|
167
|
-
|
|
169
|
+
showCardBorder,
|
|
168
170
|
title,
|
|
169
171
|
offers,
|
|
170
172
|
rateTableUuid,
|
|
@@ -176,7 +178,7 @@ export const MoneyLionOfferCarousel = (
|
|
|
176
178
|
shouldHideFooter,
|
|
177
179
|
displayLayout,
|
|
178
180
|
showProductTypeLabel,
|
|
179
|
-
|
|
181
|
+
showCardBorder,
|
|
180
182
|
title,
|
|
181
183
|
};
|
|
182
184
|
|
|
@@ -195,7 +197,9 @@ export const MoneyLionOfferCarousel = (
|
|
|
195
197
|
leadUuid,
|
|
196
198
|
}}
|
|
197
199
|
>
|
|
198
|
-
<
|
|
200
|
+
<ConfigurationProvider showDescriptionPoints={false}>
|
|
201
|
+
<DynamicOffersContainer config={config} />
|
|
202
|
+
</ConfigurationProvider>
|
|
199
203
|
</EventHandlerProvider>
|
|
200
204
|
</ThemeProvider>
|
|
201
205
|
);
|
|
@@ -71,13 +71,8 @@ const View: React.FC<ViewProps> = ({
|
|
|
71
71
|
|
|
72
72
|
// Border color handling
|
|
73
73
|
...(borderColor && {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
["neutral", "positive", "warning", "critical", "primary"]
|
|
77
|
-
? styles[
|
|
78
|
-
`border${borderColor as "neutral" | "positive" | "warning" | "critical" | "primary"}`
|
|
79
|
-
]?.borderColor
|
|
80
|
-
: undefined) || borderColor,
|
|
74
|
+
borderWidth: 1,
|
|
75
|
+
borderColor: "#bbbbbb", // This will get update in follow up one using themeColors
|
|
81
76
|
}),
|
|
82
77
|
|
|
83
78
|
// Direction handling
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React, { createContext, useContext, type ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
interface ConfigurationContextProps {
|
|
4
|
+
showDescriptionPoints: boolean;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const ConfigurationContext = createContext<
|
|
8
|
+
ConfigurationContextProps | undefined
|
|
9
|
+
>(undefined);
|
|
10
|
+
|
|
11
|
+
interface ConfigurationProviderProps {
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
showDescriptionPoints: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const ConfigurationProvider = ({
|
|
17
|
+
children,
|
|
18
|
+
showDescriptionPoints,
|
|
19
|
+
}: ConfigurationProviderProps) => {
|
|
20
|
+
return (
|
|
21
|
+
<ConfigurationContext.Provider value={{ showDescriptionPoints }}>
|
|
22
|
+
{children}
|
|
23
|
+
</ConfigurationContext.Provider>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const useConfiguration = () => {
|
|
28
|
+
const context = useContext(ConfigurationContext);
|
|
29
|
+
if (!context) {
|
|
30
|
+
throw new Error(
|
|
31
|
+
"useConfiguration must be used within a ConfigurationProvider"
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
return context;
|
|
35
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { createContext, useContext } from "react";
|
|
2
2
|
import type { ResultType } from "../services/getProductTypes";
|
|
3
|
-
import type { BaseOffer } from "
|
|
3
|
+
import type { BaseOffer } from "../capabilities/offer-catalog/src";
|
|
4
4
|
|
|
5
5
|
interface onInitializeProps {
|
|
6
6
|
timestamp: string;
|