@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
|
@@ -1,37 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { View as RNView, type ViewStyle
|
|
2
|
+
import { View as RNView, type ViewStyle } from "react-native";
|
|
3
|
+
import { useTheme, type ThemeColors } from "../../context/ThemeProvider";
|
|
4
|
+
|
|
5
|
+
type Colors = keyof ThemeColors;
|
|
3
6
|
|
|
4
7
|
export interface ViewProps {
|
|
5
8
|
children?: React.ReactNode;
|
|
6
9
|
style?: ViewStyle;
|
|
7
|
-
backgroundColor?:
|
|
8
|
-
|
|
9
|
-
| "neutral-faded"
|
|
10
|
-
| "critical"
|
|
11
|
-
| "critical-faded"
|
|
12
|
-
| "positive"
|
|
13
|
-
| "positive-faded"
|
|
14
|
-
| "warning"
|
|
15
|
-
| "warning-faded"
|
|
16
|
-
| "primary"
|
|
17
|
-
| "primary-faded"
|
|
18
|
-
| "elevation-base"
|
|
19
|
-
| "elevation-raised"
|
|
20
|
-
| "elevation-overlay"
|
|
21
|
-
| "page"
|
|
22
|
-
| "page-faded"
|
|
23
|
-
| "disabled"
|
|
24
|
-
| "disabled-faded"
|
|
25
|
-
| "brand"
|
|
26
|
-
| "white"
|
|
27
|
-
| "black";
|
|
28
|
-
borderColor?:
|
|
29
|
-
| "neutral"
|
|
30
|
-
| "positive"
|
|
31
|
-
| "warning"
|
|
32
|
-
| "critical"
|
|
33
|
-
| "primary"
|
|
34
|
-
| string;
|
|
10
|
+
backgroundColor?: Colors;
|
|
11
|
+
borderColor?: Colors;
|
|
35
12
|
direction?: "row" | "row-reverse" | "column" | "column-reverse";
|
|
36
13
|
height?: number | string;
|
|
37
14
|
maxHeight?: number | string;
|
|
@@ -61,27 +38,24 @@ const View: React.FC<ViewProps> = ({
|
|
|
61
38
|
testID,
|
|
62
39
|
...rest
|
|
63
40
|
}) => {
|
|
64
|
-
|
|
41
|
+
const themeContext = useTheme();
|
|
42
|
+
const theme = themeContext?.theme || {};
|
|
43
|
+
|
|
44
|
+
// Create a single style object directly
|
|
65
45
|
const containerStyles: Record<string, any> = {
|
|
66
46
|
// Background color handling
|
|
67
47
|
...(backgroundColor && {
|
|
68
|
-
backgroundColor:
|
|
69
|
-
styles[`bg${backgroundColor}`]?.backgroundColor || backgroundColor,
|
|
48
|
+
backgroundColor: theme[backgroundColor] || backgroundColor,
|
|
70
49
|
}),
|
|
71
50
|
|
|
72
51
|
// Border color handling
|
|
73
52
|
...(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,
|
|
53
|
+
borderWidth: 1,
|
|
54
|
+
borderColor: theme[borderColor],
|
|
81
55
|
}),
|
|
82
56
|
|
|
83
57
|
// Direction handling
|
|
84
|
-
...(direction &&
|
|
58
|
+
...(direction && { flexDirection: direction }),
|
|
85
59
|
|
|
86
60
|
// Dimension styles - applied only when provided
|
|
87
61
|
...(height !== undefined && { height }),
|
|
@@ -109,36 +83,4 @@ const View: React.FC<ViewProps> = ({
|
|
|
109
83
|
);
|
|
110
84
|
};
|
|
111
85
|
|
|
112
|
-
const styles = StyleSheet.create({
|
|
113
|
-
"bgneutral": { backgroundColor: "#e0e0e0" },
|
|
114
|
-
"bgneutral-faded": { backgroundColor: "#f5f5f5" },
|
|
115
|
-
"bgcritical": { backgroundColor: "#f44336" },
|
|
116
|
-
"bgcritical-faded": { backgroundColor: "#ffebee" },
|
|
117
|
-
"bgpositive": { backgroundColor: "#4caf50" },
|
|
118
|
-
"bgpositive-faded": { backgroundColor: "#e8f5e9" },
|
|
119
|
-
"bgwarning": { backgroundColor: "#ff9800" },
|
|
120
|
-
"bgwarning-faded": { backgroundColor: "#fff3e0" },
|
|
121
|
-
"bgprimary": { backgroundColor: "#2196f3" },
|
|
122
|
-
"bgprimary-faded": { backgroundColor: "#ebfff9" },
|
|
123
|
-
"bgelevation-base": { backgroundColor: "#fafafa" },
|
|
124
|
-
"bgelevation-raised": { backgroundColor: "#eeeeee" },
|
|
125
|
-
"bgelevation-overlay": { backgroundColor: "#bdbdbd" },
|
|
126
|
-
"bgpage": { backgroundColor: "#ffffff" },
|
|
127
|
-
"bgpage-faded": { backgroundColor: "#f5f5f5" },
|
|
128
|
-
"bgdisabled": { backgroundColor: "#bdbdbd" },
|
|
129
|
-
"bgdisabled-faded": { backgroundColor: "#e0e0e0" },
|
|
130
|
-
"bgbrand": { backgroundColor: "#6200ea" },
|
|
131
|
-
"bgwhite": { backgroundColor: "#ffffff" },
|
|
132
|
-
"bgblack": { backgroundColor: "#000000" },
|
|
133
|
-
"borderneutral": { borderColor: "#bdbdbd" },
|
|
134
|
-
"borderpositive": { borderColor: "#388e3c" },
|
|
135
|
-
"borderwarning": { borderColor: "#f57c00" },
|
|
136
|
-
"bordercritical": { borderColor: "#d32f2f" },
|
|
137
|
-
"borderprimary": { borderColor: "#1976d2" },
|
|
138
|
-
"directionrow": { flexDirection: "row" },
|
|
139
|
-
"directionrow-reverse": { flexDirection: "row-reverse" },
|
|
140
|
-
"directioncolumn": { flexDirection: "column" },
|
|
141
|
-
"directioncolumn-reverse": { flexDirection: "column-reverse" },
|
|
142
|
-
});
|
|
143
|
-
|
|
144
86
|
export default View;
|
|
@@ -36,14 +36,50 @@ export const localCnfContext: CnfContext = {
|
|
|
36
36
|
icon: null,
|
|
37
37
|
},
|
|
38
38
|
type: "business",
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
themeColors: {
|
|
40
|
+
backgroundCritical: "#ff7200",
|
|
41
|
+
backgroundCriticalFaded: "#fff2e8",
|
|
42
|
+
backgroundCriticalHighlighted: "#ee6a00",
|
|
43
|
+
backgroundDisabled: "#eeeeee",
|
|
44
|
+
backgroundDisabledFaded: "#f6f6f6",
|
|
45
|
+
backgroundElevationBase: "#ffffff",
|
|
46
|
+
backgroundElevationOverlay: "#ffffff",
|
|
47
|
+
backgroundElevationRaised: "#ffffff",
|
|
48
|
+
backgroundNeutral: "#e2e2e2",
|
|
49
|
+
backgroundNeutralFaded: "#f5f5f5",
|
|
50
|
+
backgroundNeutralHighlighted: "#d7d7d7",
|
|
51
|
+
backgroundPage: "#ffffff",
|
|
52
|
+
backgroundPageFaded: "#f9f9f9",
|
|
53
|
+
backgroundPositive: "#00e5c4",
|
|
54
|
+
backgroundPositiveFaded: "#e8fffc",
|
|
55
|
+
backgroundPositiveHighlighted: "#00d9b9",
|
|
56
|
+
backgroundPrimary: "#00e5c4",
|
|
57
|
+
backgroundPrimaryFaded: "#e8fffc",
|
|
58
|
+
backgroundPrimaryHighlighted: "#00d9b9",
|
|
59
|
+
backgroundWarning: "#facc15",
|
|
60
|
+
backgroundWarningFaded: "#fffae9",
|
|
61
|
+
backgroundWarningHighlighted: "#edc113",
|
|
62
|
+
black: "#000000",
|
|
63
|
+
borderCritical: "#d35d00",
|
|
64
|
+
borderCriticalFaded: "#fce3ce",
|
|
65
|
+
borderDisabled: "#e2e2e2",
|
|
66
|
+
borderNeutral: "#bbbbbb",
|
|
67
|
+
borderNeutralFaded: "#e1e1e1",
|
|
68
|
+
borderPositive: "#00bfa3",
|
|
69
|
+
borderPositiveFaded: "#b8faf2",
|
|
70
|
+
borderPrimary: "#00bfa3",
|
|
71
|
+
borderPrimaryFaded: "#b8faf2",
|
|
72
|
+
borderWarning: "#cfa90f",
|
|
73
|
+
borderWarningFaded: "#faedbb",
|
|
74
|
+
brand: "#00e5c4",
|
|
75
|
+
foregroundCritical: "#a94900",
|
|
76
|
+
foregroundDisabled: "#cccccc",
|
|
77
|
+
foregroundNeutral: "#181818",
|
|
78
|
+
foregroundNeutralFaded: "#666666",
|
|
79
|
+
foregroundPositive: "#007362",
|
|
80
|
+
foregroundPrimary: "#007362",
|
|
81
|
+
foregroundWarning: "#7b6305",
|
|
82
|
+
white: "#ffffff",
|
|
47
83
|
},
|
|
48
84
|
isLicensed: true,
|
|
49
85
|
allowedMarks: { logo: true, name: true },
|
|
@@ -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;
|
|
@@ -7,15 +7,52 @@ import React, {
|
|
|
7
7
|
} from "react";
|
|
8
8
|
import { Platform } from "react-native";
|
|
9
9
|
|
|
10
|
-
export interface
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
export interface ThemeColors {
|
|
11
|
+
backgroundPrimary: string;
|
|
12
|
+
backgroundPrimaryFaded: string;
|
|
13
|
+
backgroundPrimaryHighlighted: string;
|
|
14
|
+
backgroundCritical: string;
|
|
15
|
+
backgroundCriticalFaded: string;
|
|
16
|
+
backgroundCriticalHighlighted: string;
|
|
17
|
+
backgroundWarning: string;
|
|
18
|
+
backgroundWarningFaded: string;
|
|
19
|
+
backgroundWarningHighlighted: string;
|
|
20
|
+
backgroundPositive: string;
|
|
21
|
+
backgroundPositiveFaded: string;
|
|
22
|
+
backgroundPositiveHighlighted: string;
|
|
23
|
+
backgroundNeutral: string;
|
|
24
|
+
backgroundNeutralFaded: string;
|
|
25
|
+
backgroundNeutralHighlighted: string;
|
|
26
|
+
backgroundDisabled: string;
|
|
27
|
+
backgroundDisabledFaded: string;
|
|
28
|
+
backgroundElevationBase: string;
|
|
29
|
+
backgroundElevationRaised: string;
|
|
30
|
+
backgroundElevationOverlay: string;
|
|
31
|
+
backgroundPage: string;
|
|
32
|
+
backgroundPageFaded: string;
|
|
33
|
+
borderPrimary: string;
|
|
34
|
+
borderPrimaryFaded: string;
|
|
35
|
+
borderCritical: string;
|
|
36
|
+
borderCriticalFaded: string;
|
|
37
|
+
borderWarning: string;
|
|
38
|
+
borderWarningFaded: string;
|
|
39
|
+
borderPositive: string;
|
|
40
|
+
borderPositiveFaded: string;
|
|
41
|
+
borderNeutral: string;
|
|
42
|
+
borderNeutralFaded: string;
|
|
43
|
+
borderDisabled: string;
|
|
44
|
+
foregroundPrimary: string;
|
|
45
|
+
foregroundCritical: string;
|
|
46
|
+
foregroundWarning: string;
|
|
47
|
+
foregroundPositive: string;
|
|
48
|
+
foregroundNeutral: string;
|
|
49
|
+
foregroundNeutralFaded: string;
|
|
50
|
+
foregroundDisabled: string;
|
|
51
|
+
brand: string;
|
|
52
|
+
white: string;
|
|
53
|
+
black: string;
|
|
18
54
|
}
|
|
55
|
+
|
|
19
56
|
export interface FontFamily {
|
|
20
57
|
normal?: string;
|
|
21
58
|
medium?: string;
|
|
@@ -29,9 +66,9 @@ const defaultFontFamily: FontFamily = {
|
|
|
29
66
|
};
|
|
30
67
|
|
|
31
68
|
interface ThemeContextType {
|
|
32
|
-
theme:
|
|
69
|
+
theme: ThemeColors;
|
|
33
70
|
fontFamily: FontFamily;
|
|
34
|
-
updateTheme: (newTheme: Partial<
|
|
71
|
+
updateTheme: (newTheme: Partial<ThemeColors>) => void;
|
|
35
72
|
updateFontFamily: (newFontFamily: Partial<FontFamily>) => void;
|
|
36
73
|
}
|
|
37
74
|
|
|
@@ -46,23 +83,23 @@ export const useTheme = () => {
|
|
|
46
83
|
};
|
|
47
84
|
|
|
48
85
|
interface ThemeProviderProps {
|
|
49
|
-
|
|
86
|
+
themeColors?: ThemeColors;
|
|
50
87
|
fontFamily?: Partial<FontFamily>;
|
|
51
88
|
children: ReactNode;
|
|
52
89
|
}
|
|
53
90
|
|
|
54
91
|
export const ThemeProvider: FC<ThemeProviderProps> = ({
|
|
55
|
-
|
|
92
|
+
themeColors = {} as ThemeColors, // should be safe to assert as ThemePalette since the fallback colors are already handled by the consumers of ThemeProvider
|
|
56
93
|
fontFamily = {},
|
|
57
94
|
children,
|
|
58
95
|
}) => {
|
|
59
|
-
const [theme, setTheme] = useState<
|
|
96
|
+
const [theme, setTheme] = useState<ThemeColors>(themeColors);
|
|
60
97
|
const [fonts, setFonts] = useState<FontFamily>({
|
|
61
98
|
...defaultFontFamily,
|
|
62
99
|
...fontFamily,
|
|
63
100
|
});
|
|
64
101
|
|
|
65
|
-
const updateTheme = (newTheme: Partial<
|
|
102
|
+
const updateTheme = (newTheme: Partial<ThemeColors>) => {
|
|
66
103
|
setTheme((prevTheme) => ({
|
|
67
104
|
...prevTheme,
|
|
68
105
|
...newTheme,
|
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);
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getDefaultPaletteColor = void 0;
|
|
7
|
-
const getDefaultPaletteColor = colorKey => {
|
|
8
|
-
const defaultColors = {
|
|
9
|
-
positive: "#00E5C4"
|
|
10
|
-
// promotional: "#FFD700",
|
|
11
|
-
// generation: "#4CAF50",
|
|
12
|
-
// colorScheme: "#9E9E9E",
|
|
13
|
-
// critical: "#FF0000",
|
|
14
|
-
// highlight: "#FFA500",
|
|
15
|
-
// neutral: "#808080",
|
|
16
|
-
};
|
|
17
|
-
return defaultColors[colorKey] ?? "#000000"; // subject to change
|
|
18
|
-
};
|
|
19
|
-
exports.getDefaultPaletteColor = getDefaultPaletteColor;
|
|
20
|
-
//# sourceMappingURL=getDefaultPaletteColor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["getDefaultPaletteColor","colorKey","defaultColors","positive","exports"],"sourceRoot":"../../../src","sources":["utils/getDefaultPaletteColor.ts"],"mappings":";;;;;;AAEO,MAAMA,sBAAsB,GAAIC,QAAgB,IAAa;EACnE,MAAMC,aAA8C,GAAG;IACtDC,QAAQ,EAAE;IACV;IACA;IACA;IACA;IACA;IACA;EACD,CAAC;EAED,OAAOD,aAAa,CAACD,QAAQ,CAAC,IAAI,SAAS,CAAC,CAAC;AAC9C,CAAC;AAACG,OAAA,CAAAJ,sBAAA,GAAAA,sBAAA","ignoreList":[]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export const getDefaultPaletteColor = colorKey => {
|
|
2
|
-
const defaultColors = {
|
|
3
|
-
positive: "#00E5C4"
|
|
4
|
-
// promotional: "#FFD700",
|
|
5
|
-
// generation: "#4CAF50",
|
|
6
|
-
// colorScheme: "#9E9E9E",
|
|
7
|
-
// critical: "#FF0000",
|
|
8
|
-
// highlight: "#FFA500",
|
|
9
|
-
// neutral: "#808080",
|
|
10
|
-
};
|
|
11
|
-
return defaultColors[colorKey] ?? "#000000"; // subject to change
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=getDefaultPaletteColor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["getDefaultPaletteColor","colorKey","defaultColors","positive"],"sourceRoot":"../../../src","sources":["utils/getDefaultPaletteColor.ts"],"mappings":"AAEA,OAAO,MAAMA,sBAAsB,GAAIC,QAAgB,IAAa;EACnE,MAAMC,aAA8C,GAAG;IACtDC,QAAQ,EAAE;IACV;IACA;IACA;IACA;IACA;IACA;EACD,CAAC;EAED,OAAOD,aAAa,CAACD,QAAQ,CAAC,IAAI,SAAS,CAAC,CAAC;AAC9C,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getDefaultPaletteColor.d.ts","sourceRoot":"","sources":["../../../../src/utils/getDefaultPaletteColor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD,eAAO,MAAM,sBAAsB,aAAc,MAAM,KAAG,MAYzD,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Colors } from "../components/Button";
|
|
2
|
-
|
|
3
|
-
export const getDefaultPaletteColor = (colorKey: Colors): string => {
|
|
4
|
-
const defaultColors: Partial<Record<Colors, string>> = {
|
|
5
|
-
positive: "#00E5C4",
|
|
6
|
-
// promotional: "#FFD700",
|
|
7
|
-
// generation: "#4CAF50",
|
|
8
|
-
// colorScheme: "#9E9E9E",
|
|
9
|
-
// critical: "#FF0000",
|
|
10
|
-
// highlight: "#FFA500",
|
|
11
|
-
// neutral: "#808080",
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
return defaultColors[colorKey] ?? "#000000"; // subject to change
|
|
15
|
-
};
|