@moneylion/react-native-offer-carousel 1.0.6 → 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/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/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 +12 -11
- 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 +1 -0
- package/lib/commonjs/components/Common/DynamicOfferCard/index.js.map +1 -1
- package/lib/commonjs/components/Layouts/CreditCardOfferCard/index.js +2 -1
- package/lib/commonjs/components/Layouts/CreditCardOfferCard/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 +12 -14
- 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 +10 -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/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/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/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 +12 -11
- 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 +1 -0
- package/lib/module/components/Common/DynamicOfferCard/index.js.map +1 -1
- package/lib/module/components/Layouts/CreditCardOfferCard/index.js +2 -1
- package/lib/module/components/Layouts/CreditCardOfferCard/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 +12 -14
- 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 +11 -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/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/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 +2 -2
- 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/index.d.ts.map +1 -1
- package/lib/typescript/src/components/Layouts/CreditCardOfferCard/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.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/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/ThemeProvider.d.ts +47 -11
- package/lib/typescript/src/context/ThemeProvider.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/ui/elements/src/components/MarkdownText/components.tsx +4 -4
- package/src/components/Button/index.tsx +7 -20
- package/src/components/Common/BaseOfferCard/Stat/Stat.tsx +4 -4
- package/src/components/Common/BaseOfferCard/index.tsx +32 -13
- package/src/components/Common/DynamicOfferCard/CallToAction.tsx +2 -0
- package/src/components/Common/DynamicOfferCard/SeeMore.tsx +1 -1
- package/src/components/Common/DynamicOfferCard/index.tsx +1 -0
- package/src/components/Layouts/CreditCardOfferCard/index.tsx +2 -1
- package/src/components/Modal/DescriptionPoints.tsx +2 -2
- package/src/components/Modal/Disclaimer.tsx +6 -2
- package/src/components/Modal/OfferDetailsModal.tsx +11 -6
- package/src/components/MoneyLionOfferCarousel.tsx +16 -11
- package/src/components/Text/index.tsx +10 -45
- package/src/components/View/index.tsx +13 -66
- package/src/config/mocks/cnfContext.ts +44 -8
- package/src/context/ThemeProvider.tsx +51 -14
- 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
|
@@ -18,11 +18,11 @@ const BaseOfferCard = ({
|
|
|
18
18
|
children,
|
|
19
19
|
showCardBorder = true,
|
|
20
20
|
...rest
|
|
21
|
-
}: ViewProps & { showCardBorder
|
|
21
|
+
}: ViewProps & { showCardBorder?: boolean }) => (
|
|
22
22
|
<View
|
|
23
|
-
borderColor={showCardBorder ? "
|
|
23
|
+
borderColor={showCardBorder ? "borderNeutral" : undefined}
|
|
24
24
|
direction={"column"}
|
|
25
|
-
backgroundColor={"
|
|
25
|
+
backgroundColor={"backgroundElevationBase"}
|
|
26
26
|
width={CardWidth}
|
|
27
27
|
gap={1}
|
|
28
28
|
style={styles.baseOfferCard}
|
|
@@ -45,7 +45,12 @@ const Container = ({ children, ...rest }: ViewProps) => (
|
|
|
45
45
|
);
|
|
46
46
|
|
|
47
47
|
const Tip = ({ children }: ViewProps) => (
|
|
48
|
-
<Text
|
|
48
|
+
<Text
|
|
49
|
+
variant="caption-2"
|
|
50
|
+
color="foregroundPositive"
|
|
51
|
+
weight="bold"
|
|
52
|
+
style={styles.tip}
|
|
53
|
+
>
|
|
49
54
|
{children}
|
|
50
55
|
</Text>
|
|
51
56
|
);
|
|
@@ -118,7 +123,7 @@ const TopContainer = ({ children, ...viewProps }: ViewProps) => (
|
|
|
118
123
|
const TopBar = ({ children, ...viewProps }: ViewProps) => (
|
|
119
124
|
<View
|
|
120
125
|
direction={"row"}
|
|
121
|
-
backgroundColor="
|
|
126
|
+
backgroundColor="backgroundPrimaryFaded"
|
|
122
127
|
{...viewProps}
|
|
123
128
|
style={styles.topBar}
|
|
124
129
|
>
|
|
@@ -127,7 +132,12 @@ const TopBar = ({ children, ...viewProps }: ViewProps) => (
|
|
|
127
132
|
);
|
|
128
133
|
|
|
129
134
|
const ProductType = ({ children, ...rest }: TextProps) => (
|
|
130
|
-
<Text
|
|
135
|
+
<Text
|
|
136
|
+
weight={"bold"}
|
|
137
|
+
variant={"caption-1"}
|
|
138
|
+
color="foregroundPrimary"
|
|
139
|
+
{...rest}
|
|
140
|
+
>
|
|
131
141
|
{children}
|
|
132
142
|
</Text>
|
|
133
143
|
);
|
|
@@ -153,7 +163,7 @@ const BottomBar = ({ children, ...viewProps }: ViewProps) => (
|
|
|
153
163
|
const Headline = ({ children, ...rest }: TextProps) => (
|
|
154
164
|
<Text
|
|
155
165
|
variant="body-2"
|
|
156
|
-
color="
|
|
166
|
+
color="foregroundNeutral"
|
|
157
167
|
weight="bold"
|
|
158
168
|
numberOfLines={2}
|
|
159
169
|
{...rest}
|
|
@@ -163,7 +173,12 @@ const Headline = ({ children, ...rest }: TextProps) => (
|
|
|
163
173
|
);
|
|
164
174
|
|
|
165
175
|
const Description = ({ children, ...rest }: TextProps) => (
|
|
166
|
-
<Text
|
|
176
|
+
<Text
|
|
177
|
+
variant="body-3"
|
|
178
|
+
color="foregroundNeutralFaded"
|
|
179
|
+
numberOfLines={4}
|
|
180
|
+
{...rest}
|
|
181
|
+
>
|
|
167
182
|
{children}
|
|
168
183
|
</Text>
|
|
169
184
|
);
|
|
@@ -175,7 +190,7 @@ const DescriptionPoints = ({
|
|
|
175
190
|
descriptionPoints.length > 0 && (
|
|
176
191
|
<MarkdownText
|
|
177
192
|
content={arrayToMarkdownList(descriptionPoints)}
|
|
178
|
-
color="
|
|
193
|
+
color="foregroundNeutralFaded"
|
|
179
194
|
variant="body-3"
|
|
180
195
|
{...rest}
|
|
181
196
|
/>
|
|
@@ -195,7 +210,7 @@ const DescriptionHandler = ({
|
|
|
195
210
|
return (
|
|
196
211
|
<DescriptionPoints
|
|
197
212
|
numberOfLines={4}
|
|
198
|
-
color=
|
|
213
|
+
color="foregroundNeutralFaded"
|
|
199
214
|
variant={"body-3"}
|
|
200
215
|
descriptionPoints={descriptionPoints}
|
|
201
216
|
/>
|
|
@@ -204,7 +219,7 @@ const DescriptionHandler = ({
|
|
|
204
219
|
|
|
205
220
|
if (contentDescription) {
|
|
206
221
|
return (
|
|
207
|
-
<Description variant={"body-3"} color=
|
|
222
|
+
<Description variant={"body-3"} color="foregroundNeutralFaded">
|
|
208
223
|
{contentDescription}
|
|
209
224
|
</Description>
|
|
210
225
|
);
|
|
@@ -221,8 +236,12 @@ const DescriptionHandler = ({
|
|
|
221
236
|
);
|
|
222
237
|
};
|
|
223
238
|
|
|
224
|
-
const CallToAction = ({
|
|
225
|
-
|
|
239
|
+
const CallToAction = ({
|
|
240
|
+
color,
|
|
241
|
+
children,
|
|
242
|
+
...rest
|
|
243
|
+
}: ComponentProps<typeof Button>) => (
|
|
244
|
+
<Button color={color} {...rest}>
|
|
226
245
|
{children}
|
|
227
246
|
</Button>
|
|
228
247
|
);
|
|
@@ -14,6 +14,7 @@ export type CTAProps = ComponentProps<typeof Button & { href: string }> & {
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
export const CallToAction = ({
|
|
17
|
+
color,
|
|
17
18
|
children,
|
|
18
19
|
offer,
|
|
19
20
|
context,
|
|
@@ -23,6 +24,7 @@ export const CallToAction = ({
|
|
|
23
24
|
const { onOfferClick, rateTableUuid, leadUuid } = useEventHandler();
|
|
24
25
|
return (
|
|
25
26
|
<BaseOfferCard.CallToAction
|
|
27
|
+
color={color}
|
|
26
28
|
onPress={() => {
|
|
27
29
|
onOfferClick?.({
|
|
28
30
|
timestamp: new Date().toISOString(),
|
|
@@ -48,7 +48,7 @@ export const SeeMore = ({ offer, offerIndex }: SeeMoreProps) => {
|
|
|
48
48
|
<TouchableOpacity onPress={handleMoreInfoClick} style={styles.container}>
|
|
49
49
|
<Text
|
|
50
50
|
variant={"body-3"}
|
|
51
|
-
color={"
|
|
51
|
+
color={"foregroundNeutral"}
|
|
52
52
|
weight={"medium"}
|
|
53
53
|
style={styles.text}
|
|
54
54
|
>
|
|
@@ -49,7 +49,7 @@ export const CreditCardOfferCard = ({
|
|
|
49
49
|
// imageAttributes={{ title: offer.financialInstitutionDisplayName }}
|
|
50
50
|
alt={offer.financialInstitutionDisplayName}
|
|
51
51
|
/>
|
|
52
|
-
<Text variant="body-2" color="
|
|
52
|
+
<Text variant="body-2" color="backgroundNeutral" weight="bold">
|
|
53
53
|
{offer.financialInstitutionDisplayName}
|
|
54
54
|
</Text>
|
|
55
55
|
|
|
@@ -74,6 +74,7 @@ export const CreditCardOfferCard = ({
|
|
|
74
74
|
|
|
75
75
|
<BaseOfferCard.BottomBar>
|
|
76
76
|
<CallToAction
|
|
77
|
+
color={"backgroundPositive"}
|
|
77
78
|
offer={offer}
|
|
78
79
|
overrideUrl={offer.overrideUrl}
|
|
79
80
|
style={styles.cta}
|
|
@@ -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
|
}
|
|
@@ -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}
|
|
@@ -16,7 +16,6 @@ import {
|
|
|
16
16
|
import { getConfigApiBaseUrl } from "../apiEnvironment";
|
|
17
17
|
import { ConfigurationProvider } from "../context/ConfigurationProvider";
|
|
18
18
|
import type { CnfContext } from "../capabilities/core/src/system/cnfContext/CnfContext";
|
|
19
|
-
import { getDefaultPaletteColor } from "../utils/getDefaultPaletteColor";
|
|
20
19
|
|
|
21
20
|
export type MoneyLionOfferCarouselProps = {
|
|
22
21
|
channel: string;
|
|
@@ -32,6 +31,7 @@ export type MoneyLionOfferCarouselProps = {
|
|
|
32
31
|
showProductTypeLabel?: boolean;
|
|
33
32
|
isDev: boolean;
|
|
34
33
|
showCardBorder?: boolean;
|
|
34
|
+
showDescriptionPoints?: boolean;
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
const getConfiguration = async ({
|
|
@@ -66,7 +66,14 @@ export const MoneyLionOfferCarousel = (
|
|
|
66
66
|
props: MoneyLionOfferCarouselProps &
|
|
67
67
|
Omit<EventHandlerContextType, "rateTableUuid" | "leadUuid">
|
|
68
68
|
) => {
|
|
69
|
-
const {
|
|
69
|
+
const {
|
|
70
|
+
channel,
|
|
71
|
+
zone,
|
|
72
|
+
subAccountToken,
|
|
73
|
+
fontFamily,
|
|
74
|
+
isDev,
|
|
75
|
+
showDescriptionPoints = true,
|
|
76
|
+
} = props;
|
|
70
77
|
|
|
71
78
|
const {
|
|
72
79
|
onInitialize,
|
|
@@ -103,7 +110,7 @@ export const MoneyLionOfferCarousel = (
|
|
|
103
110
|
subAccountToken,
|
|
104
111
|
isDev,
|
|
105
112
|
});
|
|
106
|
-
setContext(
|
|
113
|
+
setContext(data.serializableContext as CnfContext);
|
|
107
114
|
} catch (err) {
|
|
108
115
|
setError(
|
|
109
116
|
err instanceof Error
|
|
@@ -128,7 +135,7 @@ export const MoneyLionOfferCarousel = (
|
|
|
128
135
|
const fetchPageData = async () => {
|
|
129
136
|
if (context) {
|
|
130
137
|
const data = await getPageData({
|
|
131
|
-
context,
|
|
138
|
+
context: { ...context, isDev },
|
|
132
139
|
params: props,
|
|
133
140
|
onRateTableSubmit,
|
|
134
141
|
});
|
|
@@ -144,7 +151,7 @@ export const MoneyLionOfferCarousel = (
|
|
|
144
151
|
};
|
|
145
152
|
|
|
146
153
|
fetchPageData();
|
|
147
|
-
}, [context, onRateTableResponse, onRateTableSubmit, props]);
|
|
154
|
+
}, [context, isDev, onRateTableResponse, onRateTableSubmit, props]);
|
|
148
155
|
|
|
149
156
|
if (isLoading) {
|
|
150
157
|
return <DynamicOfferSkeleton displayLayout={"fixed"} />;
|
|
@@ -182,14 +189,12 @@ export const MoneyLionOfferCarousel = (
|
|
|
182
189
|
title,
|
|
183
190
|
};
|
|
184
191
|
|
|
185
|
-
const
|
|
186
|
-
...context.brand.
|
|
187
|
-
positive:
|
|
188
|
-
context.brand.palette?.positive ?? getDefaultPaletteColor("positive"),
|
|
192
|
+
const themeColor = {
|
|
193
|
+
...context.brand.themeColors,
|
|
189
194
|
};
|
|
190
195
|
|
|
191
196
|
return (
|
|
192
|
-
<ThemeProvider
|
|
197
|
+
<ThemeProvider themeColors={themeColor} fontFamily={fontFamily}>
|
|
193
198
|
<EventHandlerProvider
|
|
194
199
|
eventHandlers={{
|
|
195
200
|
...eventHandlers,
|
|
@@ -197,7 +202,7 @@ export const MoneyLionOfferCarousel = (
|
|
|
197
202
|
leadUuid,
|
|
198
203
|
}}
|
|
199
204
|
>
|
|
200
|
-
<ConfigurationProvider showDescriptionPoints={
|
|
205
|
+
<ConfigurationProvider showDescriptionPoints={showDescriptionPoints}>
|
|
201
206
|
<DynamicOffersContainer config={config} />
|
|
202
207
|
</ConfigurationProvider>
|
|
203
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;
|
|
@@ -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,22 +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
53
|
borderWidth: 1,
|
|
75
|
-
borderColor:
|
|
54
|
+
borderColor: theme[borderColor],
|
|
76
55
|
}),
|
|
77
56
|
|
|
78
57
|
// Direction handling
|
|
79
|
-
...(direction &&
|
|
58
|
+
...(direction && { flexDirection: direction }),
|
|
80
59
|
|
|
81
60
|
// Dimension styles - applied only when provided
|
|
82
61
|
...(height !== undefined && { height }),
|
|
@@ -104,36 +83,4 @@ const View: React.FC<ViewProps> = ({
|
|
|
104
83
|
);
|
|
105
84
|
};
|
|
106
85
|
|
|
107
|
-
const styles = StyleSheet.create({
|
|
108
|
-
"bgneutral": { backgroundColor: "#e0e0e0" },
|
|
109
|
-
"bgneutral-faded": { backgroundColor: "#f5f5f5" },
|
|
110
|
-
"bgcritical": { backgroundColor: "#f44336" },
|
|
111
|
-
"bgcritical-faded": { backgroundColor: "#ffebee" },
|
|
112
|
-
"bgpositive": { backgroundColor: "#4caf50" },
|
|
113
|
-
"bgpositive-faded": { backgroundColor: "#e8f5e9" },
|
|
114
|
-
"bgwarning": { backgroundColor: "#ff9800" },
|
|
115
|
-
"bgwarning-faded": { backgroundColor: "#fff3e0" },
|
|
116
|
-
"bgprimary": { backgroundColor: "#2196f3" },
|
|
117
|
-
"bgprimary-faded": { backgroundColor: "#ebfff9" },
|
|
118
|
-
"bgelevation-base": { backgroundColor: "#fafafa" },
|
|
119
|
-
"bgelevation-raised": { backgroundColor: "#eeeeee" },
|
|
120
|
-
"bgelevation-overlay": { backgroundColor: "#bdbdbd" },
|
|
121
|
-
"bgpage": { backgroundColor: "#ffffff" },
|
|
122
|
-
"bgpage-faded": { backgroundColor: "#f5f5f5" },
|
|
123
|
-
"bgdisabled": { backgroundColor: "#bdbdbd" },
|
|
124
|
-
"bgdisabled-faded": { backgroundColor: "#e0e0e0" },
|
|
125
|
-
"bgbrand": { backgroundColor: "#6200ea" },
|
|
126
|
-
"bgwhite": { backgroundColor: "#ffffff" },
|
|
127
|
-
"bgblack": { backgroundColor: "#000000" },
|
|
128
|
-
"borderneutral": { borderColor: "#bdbdbd" },
|
|
129
|
-
"borderpositive": { borderColor: "#388e3c" },
|
|
130
|
-
"borderwarning": { borderColor: "#f57c00" },
|
|
131
|
-
"bordercritical": { borderColor: "#d32f2f" },
|
|
132
|
-
"borderprimary": { borderColor: "#1976d2" },
|
|
133
|
-
"directionrow": { flexDirection: "row" },
|
|
134
|
-
"directionrow-reverse": { flexDirection: "row-reverse" },
|
|
135
|
-
"directioncolumn": { flexDirection: "column" },
|
|
136
|
-
"directioncolumn-reverse": { flexDirection: "column-reverse" },
|
|
137
|
-
});
|
|
138
|
-
|
|
139
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 },
|