@moneylion/react-native-offer-carousel 1.0.5 → 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 +2 -2
- 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 +2 -2
- 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 +3 -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/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 +2 -2
- 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 +2 -2
- 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 +3 -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/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/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 +4 -5
- package/src/components/Layouts/DefaultOfferCard/statsBuilder.tsx +2 -2
- package/src/components/Layouts/HeadlineWithDescriptionCard/index.tsx +4 -4
- package/src/components/Modal/OfferDetailsModal.tsx +1 -1
- package/src/components/MoneyLionOfferCarousel.tsx +5 -4
- package/src/components/View/index.tsx +2 -7
- 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
|
@@ -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,18 +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";
|
|
9
7
|
import { useConfiguration } from "../../../context/ConfigurationProvider";
|
|
8
|
+
import type { BaseOffer } from "../../../capabilities/offer-catalog/src";
|
|
10
9
|
|
|
11
10
|
type DefaultOfferCardProps = {
|
|
12
11
|
productTypeBuilder: DefaultOfferCardBuilderProps;
|
|
13
12
|
offer: BaseOffer;
|
|
14
13
|
offerIndex: number;
|
|
15
|
-
|
|
14
|
+
showCardBorder: boolean;
|
|
16
15
|
showProductTypeLabel?: boolean;
|
|
17
16
|
};
|
|
18
17
|
|
|
@@ -20,7 +19,7 @@ export const DefaultOfferCard = ({
|
|
|
20
19
|
offer,
|
|
21
20
|
productTypeBuilder,
|
|
22
21
|
offerIndex,
|
|
23
|
-
|
|
22
|
+
showCardBorder,
|
|
24
23
|
showProductTypeLabel,
|
|
25
24
|
}: DefaultOfferCardProps) => {
|
|
26
25
|
const { stats, topStats } =
|
|
@@ -40,7 +39,7 @@ export const DefaultOfferCard = ({
|
|
|
40
39
|
key={`${offerIndex}-${offer.uuid}`}
|
|
41
40
|
offer={offer}
|
|
42
41
|
offerIndex={offerIndex}
|
|
43
|
-
|
|
42
|
+
showCardBorder={showCardBorder}
|
|
44
43
|
showProductTypeLabel={showProductTypeLabel}
|
|
45
44
|
>
|
|
46
45
|
<BaseOfferCard.TopContainer>
|
|
@@ -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,23 +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";
|
|
8
7
|
import { useConfiguration } from "../../../context/ConfigurationProvider";
|
|
8
|
+
import type { BaseOffer } from "../../../capabilities/offer-catalog/src";
|
|
9
9
|
|
|
10
10
|
type HeadlineWithDescriptionCardProps = {
|
|
11
11
|
productTypeBuilder: HeadlineWithDescriptionCardBuilderProps;
|
|
12
12
|
offer: BaseOffer;
|
|
13
13
|
offerIndex: number;
|
|
14
|
-
|
|
14
|
+
showCardBorder: boolean;
|
|
15
15
|
showProductTypeLabel?: boolean;
|
|
16
16
|
};
|
|
17
17
|
export const HeadlineWithDescriptionCard = ({
|
|
18
18
|
offer,
|
|
19
19
|
productTypeBuilder,
|
|
20
20
|
offerIndex,
|
|
21
|
-
|
|
21
|
+
showCardBorder,
|
|
22
22
|
showProductTypeLabel,
|
|
23
23
|
}: HeadlineWithDescriptionCardProps) => {
|
|
24
24
|
const {
|
|
@@ -43,7 +43,7 @@ export const HeadlineWithDescriptionCard = ({
|
|
|
43
43
|
key={`${offerIndex}-${offer.uuid}`}
|
|
44
44
|
offer={offer}
|
|
45
45
|
offerIndex={offerIndex}
|
|
46
|
-
|
|
46
|
+
showCardBorder={showCardBorder}
|
|
47
47
|
showProductTypeLabel={showProductTypeLabel}
|
|
48
48
|
>
|
|
49
49
|
<BaseOfferCard.TopContainer>
|
|
@@ -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,8 +14,9 @@ import {
|
|
|
15
14
|
type EventHandlerContextType,
|
|
16
15
|
} from "../context/EventHandlerProvider";
|
|
17
16
|
import { getConfigApiBaseUrl } from "../apiEnvironment";
|
|
18
|
-
import { getDefaultPaletteColor } from "../utils/getDefaultPaletteColor";
|
|
19
17
|
import { ConfigurationProvider } from "../context/ConfigurationProvider";
|
|
18
|
+
import type { CnfContext } from "../capabilities/core/src/system/cnfContext/CnfContext";
|
|
19
|
+
import { getDefaultPaletteColor } from "../utils/getDefaultPaletteColor";
|
|
20
20
|
|
|
21
21
|
export type MoneyLionOfferCarouselProps = {
|
|
22
22
|
channel: string;
|
|
@@ -31,6 +31,7 @@ export type MoneyLionOfferCarouselProps = {
|
|
|
31
31
|
fontFamily?: Partial<FontFamily>;
|
|
32
32
|
showProductTypeLabel?: boolean;
|
|
33
33
|
isDev: boolean;
|
|
34
|
+
showCardBorder?: boolean;
|
|
34
35
|
};
|
|
35
36
|
|
|
36
37
|
const getConfiguration = async ({
|
|
@@ -165,7 +166,7 @@ export const MoneyLionOfferCarousel = (
|
|
|
165
166
|
shouldHideFooter,
|
|
166
167
|
displayLayout,
|
|
167
168
|
showProductTypeLabel,
|
|
168
|
-
|
|
169
|
+
showCardBorder,
|
|
169
170
|
title,
|
|
170
171
|
offers,
|
|
171
172
|
rateTableUuid,
|
|
@@ -177,7 +178,7 @@ export const MoneyLionOfferCarousel = (
|
|
|
177
178
|
shouldHideFooter,
|
|
178
179
|
displayLayout,
|
|
179
180
|
showProductTypeLabel,
|
|
180
|
-
|
|
181
|
+
showCardBorder,
|
|
181
182
|
title,
|
|
182
183
|
};
|
|
183
184
|
|
|
@@ -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
|
|
@@ -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;
|
package/src/pageData.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { CnfContext } from "
|
|
2
|
-
import { getIsDevEnvironment } from "
|
|
1
|
+
import type { CnfContext } from "./capabilities/core/src/system/cnfContext/CnfContext";
|
|
2
|
+
import { getIsDevEnvironment } from "./capabilities/offer-catalog/src/utils/contextUtil";
|
|
3
|
+
|
|
3
4
|
import type { MoneyLionOfferCarouselProps } from "./components/MoneyLionOfferCarousel";
|
|
4
5
|
import type { onRateTableSubmitProps } from "./context/EventHandlerProvider";
|
|
5
6
|
import { getDynamicOffers } from "./services/getDynamicOffers";
|
|
@@ -30,6 +31,7 @@ export async function getPageData({
|
|
|
30
31
|
displayLayout,
|
|
31
32
|
searchAPIToken,
|
|
32
33
|
showProductTypeLabel,
|
|
34
|
+
showCardBorder,
|
|
33
35
|
} = params;
|
|
34
36
|
|
|
35
37
|
// Resolve Tags
|
|
@@ -90,7 +92,7 @@ export async function getPageData({
|
|
|
90
92
|
offers,
|
|
91
93
|
currentCountry,
|
|
92
94
|
// videosContent,
|
|
93
|
-
|
|
95
|
+
showCardBorder,
|
|
94
96
|
// shouldHideFooter,
|
|
95
97
|
showProductTypeLabel,
|
|
96
98
|
displayLayout: safeDisplayLayout,
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import { isEmpty } from "radash";
|
|
2
|
-
import type { CnfContext } from "../../src/capabilities/core/src/system/cnfContext/CnfContext";
|
|
3
|
-
import type {
|
|
4
|
-
PartnerOverride,
|
|
5
|
-
ProductTypeDefinition,
|
|
6
|
-
} from "../../src/capabilities/offer-catalog/src";
|
|
7
2
|
import {
|
|
8
3
|
addClientTagsToOfferLinks,
|
|
9
4
|
getOffersByProductTypes,
|
|
@@ -18,6 +13,11 @@ import { sortOffersByRecommendationScore } from "../utils/sortOffersByRecommenda
|
|
|
18
13
|
import { pipe } from "effect";
|
|
19
14
|
import { formatOfferUrl } from "../utils/formatOfferUrl";
|
|
20
15
|
import { getOffersBasedOnLayout } from "../utils/getOffersBasedOnLayout";
|
|
16
|
+
import type {
|
|
17
|
+
PartnerOverride,
|
|
18
|
+
ProductTypeDefinition,
|
|
19
|
+
} from "../capabilities/offer-catalog/src";
|
|
20
|
+
import type { CnfContext } from "../capabilities/core/src/system/cnfContext/CnfContext";
|
|
21
21
|
|
|
22
22
|
export type GetDynamicOffersProps = {
|
|
23
23
|
tags: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { pipe } from "effect";
|
|
2
|
-
import { orderProductTypesByRank } from "../../src/capabilities/core/src/domain/third-party-search";
|
|
3
2
|
import { getEwsSearchApiBaseUrl } from "../apiEnvironment";
|
|
3
|
+
import { orderProductTypesByRank } from "../capabilities/core/src/domain/third-party-search";
|
|
4
4
|
|
|
5
5
|
type GetProductTypesByQueryProps = {
|
|
6
6
|
query: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CnfContext } from "
|
|
1
|
+
import type { CnfContext } from "../capabilities/core/src/system/cnfContext/CnfContext";
|
|
2
2
|
|
|
3
3
|
export const getDefaultProductType = (context: CnfContext) =>
|
|
4
4
|
context.configuration.configuration.defaultProductTypeSlug;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { pipe } from "effect";
|
|
2
2
|
import type { Layout } from "./layouts";
|
|
3
3
|
import { sortOffersByRecommendationScore } from "./sortOffersByRecommendationScore";
|
|
4
|
-
import type { BaseOffer } from "
|
|
4
|
+
import type { BaseOffer } from "../capabilities/offer-catalog/src";
|
|
5
5
|
|
|
6
6
|
const MAX_OFFERS_TO_DISPLAY = 3;
|
|
7
7
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type { CnfContext } from "
|
|
1
|
+
import type { CnfContext } from "../capabilities/core/src/system/cnfContext/CnfContext";
|
|
2
2
|
import {
|
|
3
3
|
getCachedOffersByProductTypes,
|
|
4
4
|
getOffersForProductTypes,
|
|
5
|
-
} from "
|
|
6
|
-
import { parseClientTags } from "
|
|
5
|
+
} from "../capabilities/offer-catalog/src/api/offerCatalogApi";
|
|
6
|
+
import { parseClientTags } from "../capabilities/offer-catalog/src/utils/contextUtil";
|
|
7
|
+
|
|
7
8
|
/**
|
|
8
9
|
* Retrieves offers by product types.
|
|
9
10
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CnfContext } from "
|
|
1
|
+
import type { CnfContext } from "../capabilities/core/src/system/cnfContext/CnfContext";
|
|
2
2
|
|
|
3
3
|
export const getProductTypesDefinition = (context: CnfContext) => {
|
|
4
4
|
const offersConfig = context.configuration.configuration;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { BaseOffer } from "
|
|
1
|
+
import type { BaseOffer } from "../capabilities/offer-catalog/src";
|
|
2
2
|
import { sortOffersByRecommendationScore } from "./sortOffersByRecommendationScore";
|
|
3
3
|
|
|
4
|
-
|
|
5
4
|
export const selectDynamicOffers = (
|
|
6
5
|
offers: BaseOffer[],
|
|
7
6
|
productTypes: string[]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { sort } from "radash";
|
|
2
|
-
import type { BaseOffer } from "
|
|
2
|
+
import type { BaseOffer } from "../capabilities/offer-catalog/src";
|
|
3
3
|
|
|
4
4
|
export const sortOffersByRecommendationScore = (offers: BaseOffer[]) => {
|
|
5
5
|
return sort(offers, (offer) => offer.recommendationScore, true);
|