@moneylion/react-native-offer-carousel 1.0.5 → 1.0.7
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/core/src/system/cnfContext/schemas/Brand.js +45 -9
- package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Brand.js.map +1 -1
- package/lib/commonjs/capabilities/offer-catalog/src/api/offerCatalogApi.js.map +1 -1
- package/lib/commonjs/capabilities/ui/elements/src/components/MarkdownText/components.js +2 -2
- package/lib/commonjs/capabilities/ui/elements/src/components/MarkdownText/components.js.map +1 -1
- package/lib/commonjs/components/Button/index.js +4 -21
- package/lib/commonjs/components/Button/index.js.map +1 -1
- package/lib/commonjs/components/Cards/VideosCard/VideosCard.js +3 -3
- package/lib/commonjs/components/Common/BaseOfferCard/Stat/Stat.js +4 -4
- package/lib/commonjs/components/Common/BaseOfferCard/Stat/Stat.js.map +1 -1
- package/lib/commonjs/components/Common/BaseOfferCard/index.js +16 -15
- package/lib/commonjs/components/Common/BaseOfferCard/index.js.map +1 -1
- package/lib/commonjs/components/Common/DynamicOfferCard/CallToAction.js +2 -0
- package/lib/commonjs/components/Common/DynamicOfferCard/CallToAction.js.map +1 -1
- package/lib/commonjs/components/Common/DynamicOfferCard/SeeMore.js +1 -1
- package/lib/commonjs/components/Common/DynamicOfferCard/SeeMore.js.map +1 -1
- package/lib/commonjs/components/Common/DynamicOfferCard/index.js +3 -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 +4 -3
- 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/DescriptionPoints.js +2 -2
- package/lib/commonjs/components/Modal/DescriptionPoints.js.map +1 -1
- package/lib/commonjs/components/Modal/Disclaimer.js +2 -2
- package/lib/commonjs/components/Modal/Disclaimer.js.map +1 -1
- package/lib/commonjs/components/Modal/OfferDetailsModal.js +6 -2
- package/lib/commonjs/components/Modal/OfferDetailsModal.js.map +1 -1
- package/lib/commonjs/components/MoneyLionOfferCarousel.js +14 -16
- package/lib/commonjs/components/MoneyLionOfferCarousel.js.map +1 -1
- package/lib/commonjs/components/Text/index.js +18 -38
- package/lib/commonjs/components/Text/index.js.map +1 -1
- package/lib/commonjs/components/View/index.js +11 -94
- package/lib/commonjs/components/View/index.js.map +1 -1
- package/lib/commonjs/config/mocks/cnfContext.js +44 -8
- package/lib/commonjs/config/mocks/cnfContext.js.map +1 -1
- package/lib/commonjs/context/ThemeProvider.js +2 -2
- package/lib/commonjs/context/ThemeProvider.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/core/src/system/cnfContext/schemas/Brand.js +45 -9
- package/lib/module/capabilities/core/src/system/cnfContext/schemas/Brand.js.map +1 -1
- package/lib/module/capabilities/offer-catalog/src/api/offerCatalogApi.js.map +1 -1
- package/lib/module/capabilities/ui/elements/src/components/MarkdownText/components.js +2 -3
- package/lib/module/capabilities/ui/elements/src/components/MarkdownText/components.js.map +1 -1
- package/lib/module/components/Button/index.js +4 -21
- package/lib/module/components/Button/index.js.map +1 -1
- package/lib/module/components/Cards/VideosCard/VideosCard.js +3 -3
- package/lib/module/components/Common/BaseOfferCard/Stat/Stat.js +4 -4
- package/lib/module/components/Common/BaseOfferCard/Stat/Stat.js.map +1 -1
- package/lib/module/components/Common/BaseOfferCard/index.js +16 -15
- package/lib/module/components/Common/BaseOfferCard/index.js.map +1 -1
- package/lib/module/components/Common/DynamicOfferCard/CallToAction.js +2 -0
- package/lib/module/components/Common/DynamicOfferCard/CallToAction.js.map +1 -1
- package/lib/module/components/Common/DynamicOfferCard/SeeMore.js +1 -1
- package/lib/module/components/Common/DynamicOfferCard/SeeMore.js.map +1 -1
- package/lib/module/components/Common/DynamicOfferCard/index.js +3 -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 +4 -3
- 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/DescriptionPoints.js +2 -2
- package/lib/module/components/Modal/DescriptionPoints.js.map +1 -1
- package/lib/module/components/Modal/Disclaimer.js +2 -2
- package/lib/module/components/Modal/Disclaimer.js.map +1 -1
- package/lib/module/components/Modal/OfferDetailsModal.js +6 -2
- package/lib/module/components/Modal/OfferDetailsModal.js.map +1 -1
- package/lib/module/components/MoneyLionOfferCarousel.js +14 -16
- package/lib/module/components/MoneyLionOfferCarousel.js.map +1 -1
- package/lib/module/components/Text/index.js +17 -38
- package/lib/module/components/Text/index.js.map +1 -1
- package/lib/module/components/View/index.js +12 -95
- package/lib/module/components/View/index.js.map +1 -1
- package/lib/module/config/mocks/cnfContext.js +44 -8
- package/lib/module/config/mocks/cnfContext.js.map +1 -1
- package/lib/module/context/ThemeProvider.js +2 -2
- package/lib/module/context/ThemeProvider.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/core/src/system/cnfContext/schemas/Brand.d.ts +90 -18
- package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Brand.d.ts.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/capabilities/ui/elements/src/components/MarkdownText/components.d.ts +3 -2
- package/lib/typescript/src/capabilities/ui/elements/src/components/MarkdownText/components.d.ts.map +1 -1
- package/lib/typescript/src/components/Button/index.d.ts +3 -3
- package/lib/typescript/src/components/Button/index.d.ts.map +1 -1
- package/lib/typescript/src/components/Common/BaseOfferCard/index.d.ts +4 -4
- package/lib/typescript/src/components/Common/BaseOfferCard/index.d.ts.map +1 -1
- package/lib/typescript/src/components/Common/DynamicOfferCard/CallToAction.d.ts +2 -2
- 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/Disclaimer.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 +2 -0
- package/lib/typescript/src/components/MoneyLionOfferCarousel.d.ts.map +1 -1
- package/lib/typescript/src/components/Text/index.d.ts +2 -2
- package/lib/typescript/src/components/Text/index.d.ts.map +1 -1
- package/lib/typescript/src/components/View/index.d.ts +4 -2
- package/lib/typescript/src/components/View/index.d.ts.map +1 -1
- package/lib/typescript/src/config/mocks/cnfContext.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/context/ThemeProvider.d.ts +47 -11
- package/lib/typescript/src/context/ThemeProvider.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/core/src/system/cnfContext/schemas/Brand.ts +46 -10
- package/src/capabilities/offer-catalog/src/api/offerCatalogApi.ts +1 -1
- package/src/capabilities/ui/elements/src/components/MarkdownText/components.tsx +4 -4
- package/src/components/Button/index.tsx +7 -20
- package/src/components/Cards/VideosCard/VideosCard.tsx +3 -3
- package/src/components/Common/BaseOfferCard/Stat/Stat.tsx +4 -4
- package/src/components/Common/BaseOfferCard/index.tsx +36 -17
- package/src/components/Common/DynamicOfferCard/CallToAction.tsx +3 -1
- package/src/components/Common/DynamicOfferCard/SeeMore.tsx +2 -2
- package/src/components/Common/DynamicOfferCard/index.tsx +5 -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 +6 -6
- 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/DescriptionPoints.tsx +2 -2
- package/src/components/Modal/Disclaimer.tsx +6 -2
- package/src/components/Modal/OfferDetailsModal.tsx +12 -7
- package/src/components/MoneyLionOfferCarousel.tsx +20 -14
- package/src/components/Text/index.tsx +10 -45
- package/src/components/View/index.tsx +14 -72
- package/src/config/mocks/cnfContext.ts +44 -8
- package/src/context/EventHandlerProvider.tsx +1 -1
- package/src/context/ThemeProvider.tsx +51 -14
- 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/utils/getDefaultPaletteColor.js +0 -20
- package/lib/commonjs/utils/getDefaultPaletteColor.js.map +0 -1
- package/lib/module/utils/getDefaultPaletteColor.js +0 -13
- package/lib/module/utils/getDefaultPaletteColor.js.map +0 -1
- package/lib/typescript/src/utils/getDefaultPaletteColor.d.ts +0 -3
- package/lib/typescript/src/utils/getDefaultPaletteColor.d.ts.map +0 -1
- package/src/utils/getDefaultPaletteColor.ts +0 -15
|
@@ -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>
|
|
@@ -50,7 +49,7 @@ export const CreditCardOfferCard = ({
|
|
|
50
49
|
// imageAttributes={{ title: offer.financialInstitutionDisplayName }}
|
|
51
50
|
alt={offer.financialInstitutionDisplayName}
|
|
52
51
|
/>
|
|
53
|
-
<Text variant="body-2" color="
|
|
52
|
+
<Text variant="body-2" color="backgroundNeutral" weight="bold">
|
|
54
53
|
{offer.financialInstitutionDisplayName}
|
|
55
54
|
</Text>
|
|
56
55
|
|
|
@@ -75,6 +74,7 @@ export const CreditCardOfferCard = ({
|
|
|
75
74
|
|
|
76
75
|
<BaseOfferCard.BottomBar>
|
|
77
76
|
<CallToAction
|
|
77
|
+
color={"backgroundPositive"}
|
|
78
78
|
offer={offer}
|
|
79
79
|
overrideUrl={offer.overrideUrl}
|
|
80
80
|
style={styles.cta}
|
|
@@ -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>
|
|
@@ -11,12 +11,12 @@ export function DescriptionPoints({
|
|
|
11
11
|
}) {
|
|
12
12
|
return (
|
|
13
13
|
<View gap={8}>
|
|
14
|
-
<Text variant={"body-3"} weight={"bold"} color={"
|
|
14
|
+
<Text variant={"body-3"} weight={"bold"} color={"foregroundNeutral"}>
|
|
15
15
|
Offer Details
|
|
16
16
|
</Text>
|
|
17
17
|
<MarkdownText
|
|
18
18
|
variant={"body-3"}
|
|
19
|
-
color={"
|
|
19
|
+
color={"foregroundNeutral"}
|
|
20
20
|
content={arrayToMarkdownList(descriptionPoints)}
|
|
21
21
|
/>
|
|
22
22
|
</View>
|
|
@@ -6,10 +6,14 @@ import { MarkdownText } from "../../capabilities/ui/elements/src/components/Mark
|
|
|
6
6
|
export function Disclaimer({ disclaimer }: { disclaimer: string }) {
|
|
7
7
|
return (
|
|
8
8
|
<View gap={16}>
|
|
9
|
-
<Text variant={"body-3"} weight={"bold"} color={"
|
|
9
|
+
<Text variant={"body-3"} weight={"bold"} color={"foregroundNeutral"}>
|
|
10
10
|
Provider Disclaimer
|
|
11
11
|
</Text>
|
|
12
|
-
<MarkdownText
|
|
12
|
+
<MarkdownText
|
|
13
|
+
variant={"body-3"}
|
|
14
|
+
color={"foregroundNeutral"}
|
|
15
|
+
content={disclaimer}
|
|
16
|
+
/>
|
|
13
17
|
</View>
|
|
14
18
|
);
|
|
15
19
|
}
|
|
@@ -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;
|
|
@@ -31,6 +31,12 @@ export const OfferDetailsModal = ({
|
|
|
31
31
|
onClose,
|
|
32
32
|
offerIndex,
|
|
33
33
|
}: OfferDetailsModalProps) => {
|
|
34
|
+
const showDescriptionPoints = Boolean(offer?.descriptionPoints?.length);
|
|
35
|
+
|
|
36
|
+
const showDisclaimer = Boolean(offer?.legalLanguage);
|
|
37
|
+
|
|
38
|
+
const showDivider = showDescriptionPoints && showDisclaimer;
|
|
39
|
+
|
|
34
40
|
return (
|
|
35
41
|
<Modal
|
|
36
42
|
animationType="slide"
|
|
@@ -61,15 +67,14 @@ export const OfferDetailsModal = ({
|
|
|
61
67
|
style={styles.modalContent}
|
|
62
68
|
contentContainerStyle={styles.scrollContent}
|
|
63
69
|
>
|
|
64
|
-
{
|
|
65
|
-
<DescriptionPoints descriptionPoints={offer?.descriptionPoints} />
|
|
66
|
-
)}
|
|
67
|
-
{offer?.descriptionPoints && offer?.legalLanguage && <Divider />}
|
|
68
|
-
{offer?.legalLanguage && (
|
|
69
|
-
<Disclaimer disclaimer={offer.legalLanguage} />
|
|
70
|
+
{showDescriptionPoints && (
|
|
71
|
+
<DescriptionPoints descriptionPoints={offer?.descriptionPoints!} />
|
|
70
72
|
)}
|
|
73
|
+
{showDivider && <Divider />}
|
|
74
|
+
{showDisclaimer && <Disclaimer disclaimer={offer.legalLanguage!} />}
|
|
71
75
|
</ScrollView>
|
|
72
76
|
<CallToAction
|
|
77
|
+
color={"backgroundPositive"}
|
|
73
78
|
offerIndex={offerIndex}
|
|
74
79
|
offer={offer}
|
|
75
80
|
overrideUrl={offer.overrideUrl}
|
|
@@ -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,8 @@ 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";
|
|
20
19
|
|
|
21
20
|
export type MoneyLionOfferCarouselProps = {
|
|
22
21
|
channel: string;
|
|
@@ -31,6 +30,8 @@ export type MoneyLionOfferCarouselProps = {
|
|
|
31
30
|
fontFamily?: Partial<FontFamily>;
|
|
32
31
|
showProductTypeLabel?: boolean;
|
|
33
32
|
isDev: boolean;
|
|
33
|
+
showCardBorder?: boolean;
|
|
34
|
+
showDescriptionPoints?: boolean;
|
|
34
35
|
};
|
|
35
36
|
|
|
36
37
|
const getConfiguration = async ({
|
|
@@ -65,7 +66,14 @@ export const MoneyLionOfferCarousel = (
|
|
|
65
66
|
props: MoneyLionOfferCarouselProps &
|
|
66
67
|
Omit<EventHandlerContextType, "rateTableUuid" | "leadUuid">
|
|
67
68
|
) => {
|
|
68
|
-
const {
|
|
69
|
+
const {
|
|
70
|
+
channel,
|
|
71
|
+
zone,
|
|
72
|
+
subAccountToken,
|
|
73
|
+
fontFamily,
|
|
74
|
+
isDev,
|
|
75
|
+
showDescriptionPoints = true,
|
|
76
|
+
} = props;
|
|
69
77
|
|
|
70
78
|
const {
|
|
71
79
|
onInitialize,
|
|
@@ -102,7 +110,7 @@ export const MoneyLionOfferCarousel = (
|
|
|
102
110
|
subAccountToken,
|
|
103
111
|
isDev,
|
|
104
112
|
});
|
|
105
|
-
setContext(
|
|
113
|
+
setContext(data.serializableContext as CnfContext);
|
|
106
114
|
} catch (err) {
|
|
107
115
|
setError(
|
|
108
116
|
err instanceof Error
|
|
@@ -127,7 +135,7 @@ export const MoneyLionOfferCarousel = (
|
|
|
127
135
|
const fetchPageData = async () => {
|
|
128
136
|
if (context) {
|
|
129
137
|
const data = await getPageData({
|
|
130
|
-
context,
|
|
138
|
+
context: { ...context, isDev },
|
|
131
139
|
params: props,
|
|
132
140
|
onRateTableSubmit,
|
|
133
141
|
});
|
|
@@ -143,7 +151,7 @@ export const MoneyLionOfferCarousel = (
|
|
|
143
151
|
};
|
|
144
152
|
|
|
145
153
|
fetchPageData();
|
|
146
|
-
}, [context, onRateTableResponse, onRateTableSubmit, props]);
|
|
154
|
+
}, [context, isDev, onRateTableResponse, onRateTableSubmit, props]);
|
|
147
155
|
|
|
148
156
|
if (isLoading) {
|
|
149
157
|
return <DynamicOfferSkeleton displayLayout={"fixed"} />;
|
|
@@ -165,7 +173,7 @@ export const MoneyLionOfferCarousel = (
|
|
|
165
173
|
shouldHideFooter,
|
|
166
174
|
displayLayout,
|
|
167
175
|
showProductTypeLabel,
|
|
168
|
-
|
|
176
|
+
showCardBorder,
|
|
169
177
|
title,
|
|
170
178
|
offers,
|
|
171
179
|
rateTableUuid,
|
|
@@ -177,18 +185,16 @@ export const MoneyLionOfferCarousel = (
|
|
|
177
185
|
shouldHideFooter,
|
|
178
186
|
displayLayout,
|
|
179
187
|
showProductTypeLabel,
|
|
180
|
-
|
|
188
|
+
showCardBorder,
|
|
181
189
|
title,
|
|
182
190
|
};
|
|
183
191
|
|
|
184
|
-
const
|
|
185
|
-
...context.brand.
|
|
186
|
-
positive:
|
|
187
|
-
context.brand.palette?.positive ?? getDefaultPaletteColor("positive"),
|
|
192
|
+
const themeColor = {
|
|
193
|
+
...context.brand.themeColors,
|
|
188
194
|
};
|
|
189
195
|
|
|
190
196
|
return (
|
|
191
|
-
<ThemeProvider
|
|
197
|
+
<ThemeProvider themeColors={themeColor} fontFamily={fontFamily}>
|
|
192
198
|
<EventHandlerProvider
|
|
193
199
|
eventHandlers={{
|
|
194
200
|
...eventHandlers,
|
|
@@ -196,7 +202,7 @@ export const MoneyLionOfferCarousel = (
|
|
|
196
202
|
leadUuid,
|
|
197
203
|
}}
|
|
198
204
|
>
|
|
199
|
-
<ConfigurationProvider showDescriptionPoints={
|
|
205
|
+
<ConfigurationProvider showDescriptionPoints={showDescriptionPoints}>
|
|
200
206
|
<DynamicOffersContainer config={config} />
|
|
201
207
|
</ConfigurationProvider>
|
|
202
208
|
</EventHandlerProvider>
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// Text.tsx
|
|
2
1
|
import React from "react";
|
|
3
2
|
import {
|
|
4
3
|
Text as RNText,
|
|
@@ -7,7 +6,7 @@ import {
|
|
|
7
6
|
type StyleProp,
|
|
8
7
|
type TextProps as RNTextProps,
|
|
9
8
|
} from "react-native";
|
|
10
|
-
import { useTheme } from "../../context/ThemeProvider";
|
|
9
|
+
import { useTheme, type ThemeColors } from "../../context/ThemeProvider";
|
|
11
10
|
|
|
12
11
|
// Define the variant types
|
|
13
12
|
export type Variant =
|
|
@@ -29,27 +28,14 @@ export type Variant =
|
|
|
29
28
|
// Define text decoration
|
|
30
29
|
export type TextDecoration = "line-through";
|
|
31
30
|
|
|
32
|
-
// Define text color
|
|
33
|
-
export type TextColor =
|
|
34
|
-
| "neutral"
|
|
35
|
-
| "neutral-faded"
|
|
36
|
-
| "critical"
|
|
37
|
-
| "warning"
|
|
38
|
-
| "positive"
|
|
39
|
-
| "primary"
|
|
40
|
-
| "disabled";
|
|
41
|
-
|
|
42
31
|
// Define text weight
|
|
43
32
|
export type TextWeight = "normal" | "medium" | "bold";
|
|
44
33
|
|
|
45
|
-
// // Define wrap options
|
|
46
|
-
// export type TextWrap = "balance";
|
|
47
|
-
|
|
48
34
|
// Define props
|
|
49
35
|
export interface TextProps extends Omit<RNTextProps, "style"> {
|
|
50
36
|
variant?: Variant;
|
|
51
37
|
weight?: TextWeight;
|
|
52
|
-
color?:
|
|
38
|
+
color?: keyof ThemeColors;
|
|
53
39
|
decoration?: TextDecoration;
|
|
54
40
|
children?: React.ReactNode;
|
|
55
41
|
style?: StyleProp<TextStyle>;
|
|
@@ -64,26 +50,28 @@ const Text: React.FC<TextProps> = ({
|
|
|
64
50
|
style,
|
|
65
51
|
...restProps
|
|
66
52
|
}) => {
|
|
67
|
-
const
|
|
53
|
+
const themeContext = useTheme();
|
|
54
|
+
const { fontFamily, theme } = themeContext || { fontFamily: {}, theme: {} };
|
|
68
55
|
|
|
69
56
|
// Create style array
|
|
70
57
|
const styleArray: StyleProp<TextStyle>[] = [styles.base];
|
|
71
58
|
|
|
72
59
|
// Add variant styles
|
|
73
|
-
|
|
74
60
|
if (variant) {
|
|
75
61
|
styleArray.push(styles[variant]);
|
|
76
62
|
}
|
|
77
63
|
|
|
78
64
|
// Add font family styles
|
|
79
|
-
|
|
65
|
+
if (fontFamily && fontFamily[weight || "normal"]) {
|
|
66
|
+
styleArray.push({ fontFamily: fontFamily[weight || "normal"] });
|
|
67
|
+
}
|
|
80
68
|
|
|
81
69
|
// Add weight styles
|
|
82
70
|
styleArray.push({ fontWeight: weight === "medium" ? "500" : weight });
|
|
83
71
|
|
|
84
|
-
// Add color styles
|
|
85
|
-
if (color) {
|
|
86
|
-
styleArray.push(
|
|
72
|
+
// Add color styles from theme
|
|
73
|
+
if (color && theme[color]) {
|
|
74
|
+
styleArray.push({ color: theme[color] });
|
|
87
75
|
}
|
|
88
76
|
|
|
89
77
|
// Add decoration styles
|
|
@@ -104,7 +92,6 @@ const Text: React.FC<TextProps> = ({
|
|
|
104
92
|
};
|
|
105
93
|
|
|
106
94
|
// Define styles
|
|
107
|
-
// Note: In a real implementation, these would be derived from a theme or design system
|
|
108
95
|
const styles = StyleSheet.create({
|
|
109
96
|
"base": {
|
|
110
97
|
fontFamily: "System",
|
|
@@ -172,28 +159,6 @@ const styles = StyleSheet.create({
|
|
|
172
159
|
fontSize: 12,
|
|
173
160
|
lineHeight: 16,
|
|
174
161
|
},
|
|
175
|
-
// Colors
|
|
176
|
-
"color-neutral": {
|
|
177
|
-
color: "#2E2E2E",
|
|
178
|
-
},
|
|
179
|
-
"color-neutral-faded": {
|
|
180
|
-
color: "#6A6A6A",
|
|
181
|
-
},
|
|
182
|
-
"color-critical": {
|
|
183
|
-
color: "#D32F2F",
|
|
184
|
-
},
|
|
185
|
-
"color-warning": {
|
|
186
|
-
color: "#F57C00",
|
|
187
|
-
},
|
|
188
|
-
"color-positive": {
|
|
189
|
-
color: "#388E3C",
|
|
190
|
-
},
|
|
191
|
-
"color-primary": {
|
|
192
|
-
color: "#007c6a",
|
|
193
|
-
},
|
|
194
|
-
"color-disabled": {
|
|
195
|
-
color: "#AAAAAA",
|
|
196
|
-
},
|
|
197
162
|
});
|
|
198
163
|
|
|
199
164
|
export default Text;
|