@finspringinnovations/fdsdk 0.0.1 → 0.0.3
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/components/CompanyHeader.js +40 -36
- package/lib/components/InterestRateCard.js +3 -2
- package/lib/components/PaymentDetailsCard.js +8 -7
- package/lib/components/PendingFDBottomSheet.js +2 -2
- package/lib/components/TextFieldWithLabel.js +1 -1
- package/lib/components/TrustBox.js +2 -2
- package/lib/config/appDataConfig.d.ts +53 -2
- package/lib/config/appDataConfig.js +39 -6
- package/lib/hooks/usePaymentSSE.d.ts +24 -0
- package/lib/hooks/usePaymentSSE.js +135 -0
- package/lib/hooks/usePaymentStatusTimer.d.ts +25 -0
- package/lib/hooks/usePaymentStatusTimer.js +122 -0
- package/lib/index.d.ts +2 -2
- package/lib/index.js +5 -2
- package/lib/navigation/RootNavigator.js +6 -1
- package/lib/navigation/index.d.ts +2 -0
- package/lib/navigation/index.js +13 -11
- package/lib/screens/FDCalculator.d.ts +1 -0
- package/lib/screens/FDCalculator.js +64 -48
- package/lib/screens/FDList.js +10 -12
- package/lib/screens/NomineeDetail.js +21 -15
- package/lib/screens/PayNow.js +6 -6
- package/lib/screens/Payment.d.ts +1 -0
- package/lib/screens/Payment.js +34 -13
- package/lib/screens/PaymentStatus.js +33 -42
- package/lib/theme/ThemeContext.d.ts +2 -0
- package/lib/theme/ThemeContext.js +4 -2
- package/lib/theme/index.d.ts +6 -1
- package/lib/theme/index.js +24 -8
- package/lib/utils/sseParser.d.ts +7 -0
- package/lib/utils/sseParser.js +27 -0
- package/package.json +2 -2
- package/src/components/CompanyHeader.tsx +50 -44
- package/src/components/InterestRateCard.tsx +3 -2
- package/src/components/PaymentDetailsCard.tsx +45 -40
- package/src/components/PendingFDBottomSheet.tsx +2 -2
- package/src/components/TextFieldWithLabel.tsx +1 -1
- package/src/components/TrustBox.tsx +2 -2
- package/src/config/appDataConfig.ts +70 -5
- package/src/hooks/usePaymentSSE.ts +155 -0
- package/src/hooks/usePaymentStatusTimer.ts +169 -0
- package/src/index.tsx +4 -1
- package/src/navigation/RootNavigator.tsx +7 -0
- package/src/navigation/index.tsx +16 -17
- package/src/screens/FDCalculator.tsx +64 -40
- package/src/screens/FDList.tsx +11 -11
- package/src/screens/NomineeDetail.tsx +20 -14
- package/src/screens/PayNow.tsx +7 -7
- package/src/screens/Payment.tsx +45 -14
- package/src/screens/PaymentStatus.tsx +44 -57
- package/src/theme/ThemeContext.tsx +6 -1
- package/src/theme/index.ts +30 -8
- package/src/utils/sseParser.ts +40 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.usePaymentStatusTimer = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const fdApi_1 = require("../api/fdApi");
|
|
6
|
+
const store_1 = require("../store");
|
|
7
|
+
const appDataConfig_1 = require("../config/appDataConfig");
|
|
8
|
+
const paymentSession_1 = require("../state/paymentSession");
|
|
9
|
+
const usePaymentStatusTimer = ({ transactionId, overrides, initialDelayMs = 60000, repeatDelayMs = 15000, maxDurationMs = 15 * 60000, onStatusUpdate, }) => {
|
|
10
|
+
const workflowInstanceId = (0, store_1.useAppSelector)((state) => { var _a; return (_a = state === null || state === void 0 ? void 0 : state.onboarding) === null || _a === void 0 ? void 0 : _a.workflowInstanceId; });
|
|
11
|
+
const applicationId = (0, store_1.useAppSelector)((state) => { var _a; return (_a = state === null || state === void 0 ? void 0 : state.onboarding) === null || _a === void 0 ? void 0 : _a.applicationId; });
|
|
12
|
+
const entityId = (0, store_1.useAppSelector)((state) => { var _a; return (_a = state === null || state === void 0 ? void 0 : state.onboarding) === null || _a === void 0 ? void 0 : _a.entityid; });
|
|
13
|
+
const providerId = (0, store_1.useAppSelector)((state) => { var _a; return (_a = state === null || state === void 0 ? void 0 : state.onboarding) === null || _a === void 0 ? void 0 : _a.providerId; });
|
|
14
|
+
const { transactionId: sessionTransactionId } = (0, paymentSession_1.getPaymentSession)();
|
|
15
|
+
const userInfo = (0, appDataConfig_1.getUserInfoForAPI)();
|
|
16
|
+
const resolvedTransactionId = (overrides === null || overrides === void 0 ? void 0 : overrides.transactionId) || transactionId || sessionTransactionId || '';
|
|
17
|
+
const requestPayload = (0, react_1.useMemo)(() => ({
|
|
18
|
+
providerId: (overrides === null || overrides === void 0 ? void 0 : overrides.providerId) || providerId,
|
|
19
|
+
workflowInstanceId: (overrides === null || overrides === void 0 ? void 0 : overrides.workflowInstanceId) || workflowInstanceId,
|
|
20
|
+
userreferenceid: (overrides === null || overrides === void 0 ? void 0 : overrides.userreferenceid) || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.id),
|
|
21
|
+
applicationid: (overrides === null || overrides === void 0 ? void 0 : overrides.applicationid) || applicationId,
|
|
22
|
+
entityid: (overrides === null || overrides === void 0 ? void 0 : overrides.entityid) || entityId,
|
|
23
|
+
transactionId: resolvedTransactionId,
|
|
24
|
+
}), [
|
|
25
|
+
applicationId,
|
|
26
|
+
entityId,
|
|
27
|
+
overrides === null || overrides === void 0 ? void 0 : overrides.applicationid,
|
|
28
|
+
overrides === null || overrides === void 0 ? void 0 : overrides.entityid,
|
|
29
|
+
overrides === null || overrides === void 0 ? void 0 : overrides.providerId,
|
|
30
|
+
overrides === null || overrides === void 0 ? void 0 : overrides.transactionId,
|
|
31
|
+
overrides === null || overrides === void 0 ? void 0 : overrides.userreferenceid,
|
|
32
|
+
overrides === null || overrides === void 0 ? void 0 : overrides.workflowInstanceId,
|
|
33
|
+
providerId,
|
|
34
|
+
resolvedTransactionId,
|
|
35
|
+
userInfo === null || userInfo === void 0 ? void 0 : userInfo.id,
|
|
36
|
+
workflowInstanceId,
|
|
37
|
+
]);
|
|
38
|
+
const [paymentReverseFeed, { isLoading: isCheckingStatus }] = (0, fdApi_1.usePaymentReverseFeedMutation)();
|
|
39
|
+
const timeoutRef = (0, react_1.useRef)(null);
|
|
40
|
+
const startTimestampRef = (0, react_1.useRef)(0);
|
|
41
|
+
const isRunningRef = (0, react_1.useRef)(false);
|
|
42
|
+
const latestStatusRef = (0, react_1.useRef)('pending');
|
|
43
|
+
const clearTimer = (0, react_1.useCallback)(() => {
|
|
44
|
+
if (timeoutRef.current) {
|
|
45
|
+
clearTimeout(timeoutRef.current);
|
|
46
|
+
timeoutRef.current = null;
|
|
47
|
+
}
|
|
48
|
+
}, []);
|
|
49
|
+
const stopTimer = (0, react_1.useCallback)(() => {
|
|
50
|
+
isRunningRef.current = false;
|
|
51
|
+
clearTimer();
|
|
52
|
+
}, [clearTimer]);
|
|
53
|
+
const triggerStatusCheck = (0, react_1.useCallback)(async () => {
|
|
54
|
+
var _a;
|
|
55
|
+
if (!requestPayload.transactionId) {
|
|
56
|
+
return latestStatusRef.current;
|
|
57
|
+
}
|
|
58
|
+
try {
|
|
59
|
+
const response = await paymentReverseFeed(requestPayload).unwrap();
|
|
60
|
+
const status = (((_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.paymentStatus) || '').toUpperCase();
|
|
61
|
+
if (status === 'SUCCESS') {
|
|
62
|
+
latestStatusRef.current = 'success';
|
|
63
|
+
onStatusUpdate === null || onStatusUpdate === void 0 ? void 0 : onStatusUpdate('success', response);
|
|
64
|
+
return 'success';
|
|
65
|
+
}
|
|
66
|
+
if (status === 'FAILED') {
|
|
67
|
+
latestStatusRef.current = 'failed';
|
|
68
|
+
onStatusUpdate === null || onStatusUpdate === void 0 ? void 0 : onStatusUpdate('failed', response);
|
|
69
|
+
return 'failed';
|
|
70
|
+
}
|
|
71
|
+
// IN_PROGRESS OR ANY OTHER STATUS → do nothing
|
|
72
|
+
latestStatusRef.current = 'pending';
|
|
73
|
+
return 'pending';
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
// // ANY error → Pending
|
|
77
|
+
// latestStatusRef.current = 'pending';
|
|
78
|
+
// onStatusUpdate?.('pending', {
|
|
79
|
+
// status: 'pending',
|
|
80
|
+
// message: 'Reverse feed API failed or backend unreachable',
|
|
81
|
+
// error
|
|
82
|
+
// });
|
|
83
|
+
// return 'pending';
|
|
84
|
+
}
|
|
85
|
+
}, [onStatusUpdate, paymentReverseFeed, requestPayload]);
|
|
86
|
+
const scheduleNext = (0, react_1.useCallback)((delay) => {
|
|
87
|
+
clearTimer();
|
|
88
|
+
timeoutRef.current = setTimeout(async () => {
|
|
89
|
+
if (!isRunningRef.current) {
|
|
90
|
+
clearTimer();
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (Date.now() - startTimestampRef.current >= maxDurationMs) {
|
|
94
|
+
stopTimer();
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
const status = await triggerStatusCheck();
|
|
98
|
+
if (status === 'success' || status === 'failed') {
|
|
99
|
+
stopTimer();
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
scheduleNext(repeatDelayMs);
|
|
103
|
+
}, delay);
|
|
104
|
+
}, [clearTimer, maxDurationMs, repeatDelayMs, stopTimer, triggerStatusCheck]);
|
|
105
|
+
const startTimer = (0, react_1.useCallback)(() => {
|
|
106
|
+
if (isRunningRef.current) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
isRunningRef.current = true;
|
|
110
|
+
startTimestampRef.current = Date.now();
|
|
111
|
+
scheduleNext(initialDelayMs);
|
|
112
|
+
}, [initialDelayMs, scheduleNext]);
|
|
113
|
+
(0, react_1.useEffect)(() => stopTimer, [stopTimer]);
|
|
114
|
+
return {
|
|
115
|
+
startTimer,
|
|
116
|
+
stopTimer,
|
|
117
|
+
triggerStatusCheck,
|
|
118
|
+
isCheckingStatus,
|
|
119
|
+
latestStatusRef,
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
exports.usePaymentStatusTimer = usePaymentStatusTimer;
|
package/lib/index.d.ts
CHANGED
|
@@ -38,8 +38,8 @@ export * from './utils/encryption';
|
|
|
38
38
|
export { getEncryptionConfig, getEncryptionConfigs, getEnvironmentConfig as getEncryptionEnvironmentConfig, validateEncryptionConfig } from './config/encryptionConfig';
|
|
39
39
|
export * from './config/apiConfig';
|
|
40
40
|
export { debugApiConfig, debugApiCall, logEnvironmentInfo } from './config/apiConfig';
|
|
41
|
-
export { initializeSDK, getAppData, isSDKInitialized, getUserInfoForAPI, getUserDemographics, validateAppData, clearAppData, initializeEnvironment, getEnvironmentData, isEnvironmentInitialized, clearEnvironmentData, clearAllData, } from './config/appDataConfig';
|
|
42
|
-
export type { AppData, EnvironmentData } from './config/appDataConfig';
|
|
41
|
+
export { initializeSDK, getAppData, isSDKInitialized, getUserInfoForAPI, getUserDemographics, validateAppData, clearAppData, initializeEnvironment, getEnvironmentData, isEnvironmentInitialized, clearEnvironmentData, clearAllData, setSDKColors, getSDKColors, clearSDKColors, } from './config/appDataConfig';
|
|
42
|
+
export type { AppData, EnvironmentData, CustomColors } from './config/appDataConfig';
|
|
43
43
|
export { showValidationErrorAlert, validateAndProceed } from './components/ValidationErrorAlert';
|
|
44
44
|
export type { ValidationErrorAlertProps } from './components/ValidationErrorAlert';
|
|
45
45
|
export { WORKFLOW_STATES, WORKFLOW_TASKS, WORKFLOW_CONSTANTS, getWorkflowStateName, getWorkflowTaskName, } from './config/workflowConstants';
|
package/lib/index.js
CHANGED
|
@@ -39,8 +39,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
39
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
40
|
};
|
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports.
|
|
43
|
-
exports.ShriramSDK = exports.getFDData = exports.getCurrentApiConfig = exports.isEncryptionEnabled = exports.toggleEncryption = exports.ApiLogger = exports.apiLogger = exports.getWorkflowTaskName = exports.getWorkflowStateName = exports.WORKFLOW_CONSTANTS = exports.WORKFLOW_TASKS = exports.WORKFLOW_STATES = void 0;
|
|
42
|
+
exports.getSDKColors = exports.setSDKColors = exports.clearAllData = exports.clearEnvironmentData = exports.isEnvironmentInitialized = exports.getEnvironmentData = exports.initializeEnvironment = exports.clearAppData = exports.validateAppData = exports.getUserDemographics = exports.getUserInfoForAPI = exports.isSDKInitialized = exports.getAppData = exports.initializeSDK = exports.logEnvironmentInfo = exports.debugApiCall = exports.debugApiConfig = exports.validateEncryptionConfig = exports.getEncryptionEnvironmentConfig = exports.getEncryptionConfigs = exports.getEncryptionConfig = exports.useAppSelector = exports.useAppDispatch = exports.store = exports.useAuth = exports.useFDData = exports.useMasterData = exports.MasterDataProvider = exports.ApiProvider = exports.useSpacing = exports.useShadows = exports.useTypography = exports.useColors = exports.useTheme = exports.ThemeProvider = exports.ShriramSDKNavigator = exports.SimpleNavigator = exports.SDKNavigationContainer = exports.PendingFDBottomSheet = exports.PaymentStatus = exports.Payment = exports.PayNow = exports.FindIFSC = exports.AddBankAccount = exports.BankDetail = exports.NomineeDetail = exports.Employee = exports.ReviewKYC = exports.AadhaarVerification = exports.FDList = void 0;
|
|
43
|
+
exports.ShriramSDK = exports.getFDData = exports.getCurrentApiConfig = exports.isEncryptionEnabled = exports.toggleEncryption = exports.ApiLogger = exports.apiLogger = exports.getWorkflowTaskName = exports.getWorkflowStateName = exports.WORKFLOW_CONSTANTS = exports.WORKFLOW_TASKS = exports.WORKFLOW_STATES = exports.validateAndProceed = exports.showValidationErrorAlert = exports.clearSDKColors = void 0;
|
|
44
44
|
// React Native crypto polyfill - MUST be imported first
|
|
45
45
|
require("react-native-get-random-values");
|
|
46
46
|
// Main SDK exports
|
|
@@ -128,6 +128,9 @@ Object.defineProperty(exports, "getEnvironmentData", { enumerable: true, get: fu
|
|
|
128
128
|
Object.defineProperty(exports, "isEnvironmentInitialized", { enumerable: true, get: function () { return appDataConfig_1.isEnvironmentInitialized; } });
|
|
129
129
|
Object.defineProperty(exports, "clearEnvironmentData", { enumerable: true, get: function () { return appDataConfig_1.clearEnvironmentData; } });
|
|
130
130
|
Object.defineProperty(exports, "clearAllData", { enumerable: true, get: function () { return appDataConfig_1.clearAllData; } });
|
|
131
|
+
Object.defineProperty(exports, "setSDKColors", { enumerable: true, get: function () { return appDataConfig_1.setSDKColors; } });
|
|
132
|
+
Object.defineProperty(exports, "getSDKColors", { enumerable: true, get: function () { return appDataConfig_1.getSDKColors; } });
|
|
133
|
+
Object.defineProperty(exports, "clearSDKColors", { enumerable: true, get: function () { return appDataConfig_1.clearSDKColors; } });
|
|
131
134
|
// Export validation utilities
|
|
132
135
|
var ValidationErrorAlert_1 = require("./components/ValidationErrorAlert");
|
|
133
136
|
Object.defineProperty(exports, "showValidationErrorAlert", { enumerable: true, get: function () { return ValidationErrorAlert_1.showValidationErrorAlert; } });
|
|
@@ -131,7 +131,7 @@ const RootNavigator = ({ config = {}, onExit }) => {
|
|
|
131
131
|
} }, props)))),
|
|
132
132
|
react_1.default.createElement(Stack.Screen, { name: "FDCalculator", options: { title: 'FD Calculator' } }, (props) => {
|
|
133
133
|
var _a;
|
|
134
|
-
return (react_1.default.createElement(FDCalculator_1.default, Object.assign({ onGoBack: () => (0, helpers_2.goBack)(), onNavigateToReviewKYC: () => { var _a; return (0, helpers_2.navigate)('ReviewKYC', { fdData: (_a = props.route.params) === null || _a === void 0 ? void 0 : _a.fdData }); }, fdData: (_a = props.route.params) === null || _a === void 0 ? void 0 : _a.fdData }, props)));
|
|
134
|
+
return (react_1.default.createElement(FDCalculator_1.default, Object.assign({ onGoBack: () => (0, helpers_2.goBack)(), onExitSDK: () => onExit === null || onExit === void 0 ? void 0 : onExit(), onNavigateToReviewKYC: () => { var _a; return (0, helpers_2.navigate)('ReviewKYC', { fdData: (_a = props.route.params) === null || _a === void 0 ? void 0 : _a.fdData }); }, fdData: (_a = props.route.params) === null || _a === void 0 ? void 0 : _a.fdData }, props)));
|
|
135
135
|
}),
|
|
136
136
|
react_1.default.createElement(Stack.Screen, { name: "AadhaarVerification", options: { title: 'Aadhaar Verification' } }, (props) => (react_1.default.createElement(AadhaarVerification_1.default, Object.assign({ onGoBack: () => (0, helpers_2.goBack)(), onVerificationComplete: (aadhaarNumber) => {
|
|
137
137
|
// Navigate to Employee (occupation) screen after verification
|
|
@@ -190,6 +190,11 @@ const RootNavigator = ({ config = {}, onExit }) => {
|
|
|
190
190
|
status: 'failed',
|
|
191
191
|
paymentData: error
|
|
192
192
|
});
|
|
193
|
+
}, onPaymentPending: (info) => {
|
|
194
|
+
(0, helpers_2.navigate)('PaymentStatus', {
|
|
195
|
+
status: 'pending',
|
|
196
|
+
paymentData: info
|
|
197
|
+
});
|
|
193
198
|
} }, props)))),
|
|
194
199
|
react_1.default.createElement(Stack.Screen, { name: "PaymentStatus", options: { title: 'Payment Status' } }, (props) => {
|
|
195
200
|
var _a, _b, _c;
|
|
@@ -2,11 +2,13 @@ import React from 'react';
|
|
|
2
2
|
import SimpleNavigator from './SimpleNavigator';
|
|
3
3
|
import type { SDKNavigationConfig } from './types';
|
|
4
4
|
import type { ThemeName, Theme } from '../theme';
|
|
5
|
+
import { type CustomColors } from '../config/appDataConfig';
|
|
5
6
|
interface SDKNavigationContainerProps {
|
|
6
7
|
config?: SDKNavigationConfig;
|
|
7
8
|
onExit?: (fdDetails?: any) => void;
|
|
8
9
|
children?: React.ReactNode;
|
|
9
10
|
theme?: ThemeName | Theme;
|
|
11
|
+
colors?: CustomColors;
|
|
10
12
|
useReactNavigation?: boolean;
|
|
11
13
|
}
|
|
12
14
|
export declare const SDKNavigationContainer: React.FC<SDKNavigationContainerProps>;
|
package/lib/navigation/index.js
CHANGED
|
@@ -13,26 +13,28 @@ const ThemeContext_1 = require("../theme/ThemeContext");
|
|
|
13
13
|
const ApiProvider_1 = require("../providers/ApiProvider");
|
|
14
14
|
const MasterDataProvider_1 = require("../providers/MasterDataProvider");
|
|
15
15
|
const helpers_1 = require("./helpers");
|
|
16
|
+
const appDataConfig_1 = require("../config/appDataConfig");
|
|
16
17
|
// Main navigation container for the SDK
|
|
17
|
-
const SDKNavigationContainer = ({ config, onExit, children, theme, useReactNavigation = true, // Default to React Navigation
|
|
18
|
+
const SDKNavigationContainer = ({ config, onExit, children, theme, colors: propColors, useReactNavigation = true, // Default to React Navigation
|
|
18
19
|
}) => {
|
|
20
|
+
// Merge color overrides: prop-level colors take priority over global SDK colors
|
|
21
|
+
const globalColors = (0, appDataConfig_1.getSDKColors)();
|
|
22
|
+
const colorOverrides = (propColors || globalColors)
|
|
23
|
+
? Object.assign(Object.assign({}, (globalColors || {})), (propColors || {})) : null;
|
|
19
24
|
// Choose navigator based on flag
|
|
20
25
|
const navigator = useReactNavigation
|
|
21
26
|
? react_1.default.createElement(RootNavigator_1.default, { config: config, onExit: onExit })
|
|
22
27
|
: react_1.default.createElement(SimpleNavigator_1.default, { config: config, onExit: onExit });
|
|
23
28
|
const content = children || (useReactNavigation ? (react_1.default.createElement(native_1.NavigationContainer, { ref: helpers_1.navigationRef }, navigator)) : (navigator));
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
react_1.default.createElement(ThemeContext_1.ThemeProvider, Object.assign({}, themeProps), content))));
|
|
31
|
-
}
|
|
32
|
-
// Default theme provider with API provider
|
|
29
|
+
// Build ThemeProvider props
|
|
30
|
+
const themeProps = typeof theme === 'string'
|
|
31
|
+
? { initialTheme: theme, colorOverrides }
|
|
32
|
+
: theme
|
|
33
|
+
? { theme, colorOverrides }
|
|
34
|
+
: { colorOverrides };
|
|
33
35
|
return (react_1.default.createElement(ApiProvider_1.ApiProvider, null,
|
|
34
36
|
react_1.default.createElement(MasterDataProvider_1.MasterDataProvider, null,
|
|
35
|
-
react_1.default.createElement(ThemeContext_1.ThemeProvider,
|
|
37
|
+
react_1.default.createElement(ThemeContext_1.ThemeProvider, Object.assign({}, themeProps), content))));
|
|
36
38
|
};
|
|
37
39
|
exports.SDKNavigationContainer = SDKNavigationContainer;
|
|
38
40
|
// Default export for easy import
|
|
@@ -55,7 +55,7 @@ const fdListSelectedSlice_1 = require("../store/fdListSelectedSlice");
|
|
|
55
55
|
const helpers_1 = require("../navigation/helpers");
|
|
56
56
|
const strings_1 = require("../constants/strings");
|
|
57
57
|
const base64Images_1 = require("../constants/strings/base64Images");
|
|
58
|
-
const FDCalculator = ({ onGoBack, onNavigateToReviewKYC, fdData }) => {
|
|
58
|
+
const FDCalculator = ({ onGoBack, onExitSDK, onNavigateToReviewKYC, fdData }) => {
|
|
59
59
|
const typography = (0, ThemeContext_1.useTypography)();
|
|
60
60
|
const colors = (0, ThemeContext_1.useColors)();
|
|
61
61
|
const { themeName } = (0, ThemeContext_1.useTheme)();
|
|
@@ -180,15 +180,6 @@ const FDCalculator = ({ onGoBack, onNavigateToReviewKYC, fdData }) => {
|
|
|
180
180
|
setPayoutValue(defaultOption);
|
|
181
181
|
}
|
|
182
182
|
}, [payoutOptions]);
|
|
183
|
-
react_1.default.useEffect(() => {
|
|
184
|
-
if (amount && payoutValue) {
|
|
185
|
-
// Only call if amount is valid
|
|
186
|
-
const numericValue = parseInt(amount.replace(/,/g, ''), 10);
|
|
187
|
-
if (numericValue >= 5000 && numericValue <= 50000000 && numericValue % 1000 === 0) {
|
|
188
|
-
handleCalculateFD(amount, payoutValue);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
}, [payoutValue]);
|
|
192
183
|
// Master data processing complete
|
|
193
184
|
// FD Calculator API
|
|
194
185
|
const [calculateFD, { isLoading: isCalculating }] = (0, fdCalculatorApi_1.useCalculateFDMutation)();
|
|
@@ -210,6 +201,16 @@ const FDCalculator = ({ onGoBack, onNavigateToReviewKYC, fdData }) => {
|
|
|
210
201
|
return unique.map(m => `${m} Months`);
|
|
211
202
|
}, [interestRates]);
|
|
212
203
|
const [tenureValue, setTenureValue] = (0, react_1.useState)('');
|
|
204
|
+
// Effect to recalculate when payout or tenure changes
|
|
205
|
+
react_1.default.useEffect(() => {
|
|
206
|
+
if (amount && payoutValue && tenureValue) {
|
|
207
|
+
// Only call if amount is valid
|
|
208
|
+
const numericValue = parseInt(amount.replace(/,/g, ''), 10);
|
|
209
|
+
if (numericValue >= 5000 && numericValue <= 50000000 && numericValue % 1000 === 0) {
|
|
210
|
+
handleCalculateFD(amount, payoutValue, tenureValue);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}, [payoutValue, tenureValue]);
|
|
213
214
|
react_1.default.useEffect(() => {
|
|
214
215
|
if (tenureOptions.length > 0) {
|
|
215
216
|
// If effectiveFdData has tenure, use it; otherwise use first option
|
|
@@ -230,15 +231,16 @@ const FDCalculator = ({ onGoBack, onNavigateToReviewKYC, fdData }) => {
|
|
|
230
231
|
setShowPayoutModal(false);
|
|
231
232
|
};
|
|
232
233
|
// Function to call FD calculator API
|
|
233
|
-
const handleCalculateFD = react_1.default.useCallback(async (currentAmount, selectedPayout) => {
|
|
234
|
+
const handleCalculateFD = react_1.default.useCallback(async (currentAmount, selectedPayout, selectedTenure) => {
|
|
234
235
|
var _a, _b;
|
|
235
236
|
const payoutToUse = selectedPayout || payoutValue;
|
|
236
237
|
const amountToUse = currentAmount || amount; // ✅ use latest if provided
|
|
237
|
-
|
|
238
|
+
const tenureToUse = selectedTenure || tenureValue; // ✅ use latest if provided
|
|
239
|
+
if (!amountToUse || !payoutToUse || !tenureToUse)
|
|
238
240
|
return;
|
|
239
241
|
try {
|
|
240
242
|
const amountValue = parseFloat(amountToUse.replace(/,/g, ''));
|
|
241
|
-
const tenureMonths = parseInt(
|
|
243
|
+
const tenureMonths = parseInt(tenureToUse.replace(' Months', ''));
|
|
242
244
|
if (isNaN(amountValue) || isNaN(tenureMonths) || amountValue <= 0 || tenureMonths <= 0)
|
|
243
245
|
return;
|
|
244
246
|
const sdr = ((_a = interestRates === null || interestRates === void 0 ? void 0 : interestRates.data) === null || _a === void 0 ? void 0 : _a.sdrScheme) || [];
|
|
@@ -247,7 +249,7 @@ const FDCalculator = ({ onGoBack, onNavigateToReviewKYC, fdData }) => {
|
|
|
247
249
|
const providerId = firstRate === null || firstRate === void 0 ? void 0 : firstRate.providerId;
|
|
248
250
|
const appData = (0, appDataConfig_1.getAppData)();
|
|
249
251
|
const userDob = (appData === null || appData === void 0 ? void 0 : appData.dob) || '1990-01-01';
|
|
250
|
-
const isWomenDepositor = (appData === null || appData === void 0 ? void 0 : appData.gender) === '
|
|
252
|
+
const isWomenDepositor = (appData === null || appData === void 0 ? void 0 : appData.gender) === 'Female';
|
|
251
253
|
const requestData = {
|
|
252
254
|
principalAmount: amountValue,
|
|
253
255
|
tenureInMonths: tenureMonths,
|
|
@@ -259,6 +261,7 @@ const FDCalculator = ({ onGoBack, onNavigateToReviewKYC, fdData }) => {
|
|
|
259
261
|
};
|
|
260
262
|
const result = await calculateFD(requestData).unwrap();
|
|
261
263
|
setCalculationResult(result);
|
|
264
|
+
console.log(';following is the calculation result', result, 'requestData', requestData, 'appData', appData);
|
|
262
265
|
}
|
|
263
266
|
catch (error) {
|
|
264
267
|
// FD calculation failed
|
|
@@ -299,17 +302,17 @@ const FDCalculator = ({ onGoBack, onNavigateToReviewKYC, fdData }) => {
|
|
|
299
302
|
clearTimeout(debounceTimer);
|
|
300
303
|
// Step 7: Debounced API call
|
|
301
304
|
const isValidLocal = numericValue >= 5000 && numericValue <= 50000000 && numericValue % 1000 === 0;
|
|
302
|
-
if (cleanedText && isValidLocal && payoutValue) {
|
|
305
|
+
if (cleanedText && isValidLocal && payoutValue && tenureValue) {
|
|
303
306
|
const newTimer = setTimeout(() => {
|
|
304
|
-
// Pass latest
|
|
305
|
-
handleCalculateFD(cleanedText);
|
|
307
|
+
// Pass latest values directly to avoid stale state
|
|
308
|
+
handleCalculateFD(cleanedText, payoutValue, tenureValue);
|
|
306
309
|
}, 1000);
|
|
307
310
|
setDebounceTimer(newTimer);
|
|
308
311
|
}
|
|
309
312
|
}, [debounceTimer, handleCalculateFD, payoutValue]);
|
|
310
313
|
// Function to call onboarding API
|
|
311
314
|
const handleStartOnboarding = react_1.default.useCallback(async (selectedPayout) => {
|
|
312
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
315
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
313
316
|
if (isBooking)
|
|
314
317
|
return;
|
|
315
318
|
setIsBooking(true);
|
|
@@ -328,20 +331,35 @@ const FDCalculator = ({ onGoBack, onNavigateToReviewKYC, fdData }) => {
|
|
|
328
331
|
if (amountValue < 5000) {
|
|
329
332
|
return;
|
|
330
333
|
}
|
|
334
|
+
const appData = (0, appDataConfig_1.getAppData)();
|
|
335
|
+
const hasEssentialData = (_a = appData === null || appData === void 0 ? void 0 : appData.panNumber) === null || _a === void 0 ? void 0 : _a.trim();
|
|
336
|
+
if (!hasEssentialData) {
|
|
337
|
+
const alertMessage = (appData === null || appData === void 0 ? void 0 : appData.startFDAlertMessage) || 'Please complete your KYC details to start an FD, Update your profile in the app and try again.';
|
|
338
|
+
react_native_1.Alert.alert('Action Required', alertMessage, [
|
|
339
|
+
{
|
|
340
|
+
text: 'OK',
|
|
341
|
+
onPress: () => {
|
|
342
|
+
if (onExitSDK) {
|
|
343
|
+
onExitSDK();
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
},
|
|
347
|
+
], { cancelable: false });
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
331
350
|
// Get providerId from interest rates data
|
|
332
|
-
const sdr = ((
|
|
333
|
-
const fdr = ((
|
|
351
|
+
const sdr = ((_b = interestRates === null || interestRates === void 0 ? void 0 : interestRates.data) === null || _b === void 0 ? void 0 : _b.sdrScheme) || [];
|
|
352
|
+
const fdr = ((_c = interestRates === null || interestRates === void 0 ? void 0 : interestRates.data) === null || _c === void 0 ? void 0 : _c.fdrScheme) || [];
|
|
334
353
|
const firstRate = sdr[0] || fdr[0];
|
|
335
354
|
const providerId = firstRate === null || firstRate === void 0 ? void 0 : firstRate.providerId;
|
|
336
355
|
// Get user data for all required fields
|
|
337
|
-
const appData = (0, appDataConfig_1.getAppData)();
|
|
338
356
|
const userDob = (appData === null || appData === void 0 ? void 0 : appData.dob) || '1990-01-01';
|
|
339
357
|
const isWomenDepositor = (appData === null || appData === void 0 ? void 0 : appData.gender) === 'F';
|
|
340
358
|
// Get calculated values from API response based on investment type
|
|
341
359
|
const investmentType = payoutValue === 'On Maturity' ? 'SDR' : 'FDR';
|
|
342
360
|
const calcData = investmentType === 'SDR'
|
|
343
|
-
? (
|
|
344
|
-
: (
|
|
361
|
+
? (_e = (_d = calculationResult === null || calculationResult === void 0 ? void 0 : calculationResult.data) === null || _d === void 0 ? void 0 : _d.sdrCalc) === null || _e === void 0 ? void 0 : _e[0]
|
|
362
|
+
: (_g = (_f = calculationResult === null || calculationResult === void 0 ? void 0 : calculationResult.data) === null || _f === void 0 ? void 0 : _f.fdrCalc) === null || _g === void 0 ? void 0 : _g[0];
|
|
345
363
|
const interestRate = calcData === null || calcData === void 0 ? void 0 : calcData.wRoi;
|
|
346
364
|
const maturityAmount = calcData === null || calcData === void 0 ? void 0 : calcData.maturityAmount;
|
|
347
365
|
// Calculate maturity date
|
|
@@ -353,8 +371,8 @@ const FDCalculator = ({ onGoBack, onNavigateToReviewKYC, fdData }) => {
|
|
|
353
371
|
mobile: (appData === null || appData === void 0 ? void 0 : appData.mobNo) || '',
|
|
354
372
|
prefix: (appData === null || appData === void 0 ? void 0 : appData.gender) === 'M' ? 'Mr.' : ((appData === null || appData === void 0 ? void 0 : appData.gender) === 'F' ? 'Ms.' : 'Mr.'),
|
|
355
373
|
fullName: (appData === null || appData === void 0 ? void 0 : appData.name) || '',
|
|
356
|
-
firstName: ((
|
|
357
|
-
lastName: ((
|
|
374
|
+
firstName: ((_h = appData === null || appData === void 0 ? void 0 : appData.name) === null || _h === void 0 ? void 0 : _h.split(' ')[0]) || '',
|
|
375
|
+
lastName: ((_j = appData === null || appData === void 0 ? void 0 : appData.name) === null || _j === void 0 ? void 0 : _j.split(' ').slice(1).join(' ')) || '',
|
|
358
376
|
userReferenceId: (appData === null || appData === void 0 ? void 0 : appData.id) || '',
|
|
359
377
|
dob: userDob,
|
|
360
378
|
email: (appData === null || appData === void 0 ? void 0 : appData.email) || '',
|
|
@@ -400,11 +418,11 @@ const FDCalculator = ({ onGoBack, onNavigateToReviewKYC, fdData }) => {
|
|
|
400
418
|
// Persist onboarding identifiers globally for subsequent API calls
|
|
401
419
|
try {
|
|
402
420
|
const ids = {
|
|
403
|
-
workflowInstanceId: (
|
|
404
|
-
applicationId: (
|
|
405
|
-
entityid: (
|
|
406
|
-
customerId: (
|
|
407
|
-
fdId: (
|
|
421
|
+
workflowInstanceId: (_k = result === null || result === void 0 ? void 0 : result.data) === null || _k === void 0 ? void 0 : _k.workflowInstanceId,
|
|
422
|
+
applicationId: (_l = result === null || result === void 0 ? void 0 : result.data) === null || _l === void 0 ? void 0 : _l.applicationId,
|
|
423
|
+
entityid: (_m = result === null || result === void 0 ? void 0 : result.data) === null || _m === void 0 ? void 0 : _m.entityid,
|
|
424
|
+
customerId: (_o = result === null || result === void 0 ? void 0 : result.data) === null || _o === void 0 ? void 0 : _o.customerId,
|
|
425
|
+
fdId: (_p = result === null || result === void 0 ? void 0 : result.data) === null || _p === void 0 ? void 0 : _p.fdId,
|
|
408
426
|
};
|
|
409
427
|
if (dispatch && setOnboardingIds) {
|
|
410
428
|
dispatch(setOnboardingIds(ids));
|
|
@@ -538,10 +556,10 @@ const FDCalculator = ({ onGoBack, onNavigateToReviewKYC, fdData }) => {
|
|
|
538
556
|
const backHandler = react_native_1.BackHandler.addEventListener('hardwareBackPress', onHardwareBackPress);
|
|
539
557
|
return () => backHandler.remove();
|
|
540
558
|
}, []);
|
|
541
|
-
return (react_1.default.createElement(SafeAreaWrapper_1.default, { includeTop: false, bottomPadding: 25, statusBarColor:
|
|
559
|
+
return (react_1.default.createElement(SafeAreaWrapper_1.default, { includeTop: false, bottomPadding: 25, statusBarColor: colors.background, statusBarStyle: themeName === 'dark' ? 'light-content' : 'dark-content' },
|
|
542
560
|
react_1.default.createElement(react_native_1.View, { style: styles.header },
|
|
543
561
|
react_1.default.createElement(react_native_1.TouchableOpacity, { onPress: () => (0, helpers_1.navigate)('FDList'), style: styles.backButton },
|
|
544
|
-
react_1.default.createElement(react_native_1.Image, { source: { uri: base64Images_1.base64Images.backArrow }, style: [styles.backIcon, { tintColor:
|
|
562
|
+
react_1.default.createElement(react_native_1.Image, { source: { uri: base64Images_1.base64Images.backArrow }, style: [styles.backIcon, { tintColor: colors.text }], resizeMode: "contain", width: 24, height: 24 }))),
|
|
545
563
|
react_1.default.createElement(react_native_1.View, { style: { flex: 1, justifyContent: 'space-between' } },
|
|
546
564
|
react_1.default.createElement(react_native_1.ScrollView, { style: styles.scrollContainer, contentContainerStyle: styles.scrollContent, showsVerticalScrollIndicator: false, onScrollBeginDrag: closeAllMenus, scrollEnabled: !(isOnboarding || isBooking), keyboardShouldPersistTaps: "handled", bounces: true, alwaysBounceVertical: true },
|
|
547
565
|
react_1.default.createElement(components_1.CompanyHeader, { companyName: (effectiveFdData === null || effectiveFdData === void 0 ? void 0 : effectiveFdData.name) || '', rating: (effectiveFdData === null || effectiveFdData === void 0 ? void 0 : effectiveFdData.creditRating) || 'AA+' }),
|
|
@@ -554,8 +572,8 @@ const FDCalculator = ({ onGoBack, onNavigateToReviewKYC, fdData }) => {
|
|
|
554
572
|
showTenureMenu && (react_1.default.createElement(react_native_1.View, { style: styles.inlineMenu }, (tenureOptions.length > 0 ? tenureOptions : [strings_1.FD_STRINGS.TENURE_12_MONTHS, strings_1.FD_STRINGS.TENURE_24_MONTHS, strings_1.FD_STRINGS.TENURE_36_MONTHS]).map((option) => (react_1.default.createElement(react_native_1.TouchableOpacity, { key: option, style: styles.modalOption, onPress: () => {
|
|
555
573
|
setTenureValue(option);
|
|
556
574
|
setShowTenureMenu(false);
|
|
557
|
-
// Call API
|
|
558
|
-
setTimeout(() => handleCalculateFD(), 100);
|
|
575
|
+
// Call API with the new tenure value directly to avoid closure issues
|
|
576
|
+
setTimeout(() => handleCalculateFD(amount, payoutValue, option), 100);
|
|
559
577
|
} },
|
|
560
578
|
react_1.default.createElement(react_native_1.Text, { style: styles.modalOptionText }, option)))))),
|
|
561
579
|
react_1.default.createElement(components_1.DropdownSelector, { label: strings_1.FD_STRINGS.INTEREST_PAYOUT_TERM_LABEL, value: payoutValue, onPress: () => {
|
|
@@ -568,9 +586,8 @@ const FDCalculator = ({ onGoBack, onNavigateToReviewKYC, fdData }) => {
|
|
|
568
586
|
.map((option) => (react_1.default.createElement(react_native_1.TouchableOpacity, { key: option, style: styles.modalOption, onPress: () => {
|
|
569
587
|
setPayoutValue(option);
|
|
570
588
|
setShowPayoutModal(false);
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
// setTimeout(() => handleCalculateFD(option), 100);
|
|
589
|
+
// Pass all values directly to avoid stale state
|
|
590
|
+
handleCalculateFD(amount, option, tenureValue);
|
|
574
591
|
} },
|
|
575
592
|
react_1.default.createElement(react_native_1.Text, { style: styles.modalOptionText }, option)))))),
|
|
576
593
|
isCalculating && (react_1.default.createElement(react_native_1.View, { style: styles.loadingContainer },
|
|
@@ -680,29 +697,28 @@ const createStyles = (typography, colors, themeName) => react_native_1.StyleShee
|
|
|
680
697
|
position: 'relative',
|
|
681
698
|
},
|
|
682
699
|
startButton: {
|
|
683
|
-
backgroundColor:
|
|
684
|
-
paddingVertical:
|
|
700
|
+
backgroundColor: colors.buttonBackground || colors.headerBg,
|
|
701
|
+
paddingVertical: 20,
|
|
685
702
|
paddingHorizontal: 20,
|
|
686
|
-
borderRadius:
|
|
703
|
+
borderRadius: 30,
|
|
687
704
|
marginTop: 30,
|
|
688
705
|
alignItems: 'center',
|
|
689
706
|
justifyContent: 'center',
|
|
690
|
-
height:
|
|
707
|
+
height: 56,
|
|
691
708
|
width: '90%',
|
|
692
709
|
alignSelf: 'center',
|
|
693
710
|
},
|
|
694
711
|
startButtonDisabled: {
|
|
695
|
-
backgroundColor: '#909090',
|
|
696
|
-
color: '#ffffff',
|
|
712
|
+
backgroundColor: colors.muted || '#909090',
|
|
697
713
|
},
|
|
698
|
-
startButtonText: Object.assign(Object.assign({}, typography.styles.button), { color:
|
|
714
|
+
startButtonText: Object.assign(Object.assign({}, typography.styles.button), { color: colors.buttonTextColor || colors.background, fontSize: 16 }),
|
|
699
715
|
startButtonTextDisabled: {
|
|
700
|
-
color:
|
|
716
|
+
color: colors.textSecondary,
|
|
701
717
|
},
|
|
702
718
|
inlineMenu: {
|
|
703
|
-
backgroundColor:
|
|
704
|
-
borderWidth:
|
|
705
|
-
borderColor:
|
|
719
|
+
backgroundColor: colors.inputBackground || colors.background,
|
|
720
|
+
borderWidth: 0.5,
|
|
721
|
+
borderColor: colors.inputBorder || colors.border,
|
|
706
722
|
borderRadius: 8,
|
|
707
723
|
marginTop: 6,
|
|
708
724
|
paddingHorizontal: 12,
|
package/lib/screens/FDList.js
CHANGED
|
@@ -774,20 +774,18 @@ const FDList = ({ onGoBack, onSelectFD, onNavigateToFDCalculator, customStyles =
|
|
|
774
774
|
}, [fdList, activeTab]);
|
|
775
775
|
const tabs = [strings_1.FD_STRINGS.ALL_FDS_TAB, strings_1.FD_STRINGS.LESS_THAN_1Y_TAB, strings_1.FD_STRINGS.LESS_THAN_1_3Y_TAB, strings_1.FD_STRINGS.LESS_THAN_3_5Y_TAB, strings_1.FD_STRINGS.GREATER_THAN_5Y_TAB];
|
|
776
776
|
if (!isAllDataReady) {
|
|
777
|
-
return (react_1.default.createElement(SafeAreaWrapper_1.default, { style: customStyles.container, includeTop: false, statusBarColor:
|
|
777
|
+
return (react_1.default.createElement(SafeAreaWrapper_1.default, { style: customStyles.container, includeTop: false, statusBarColor: colors.headerBg, statusBarStyle: "light-content" },
|
|
778
778
|
react_1.default.createElement(react_native_1.View, { style: { flex: 1, alignItems: 'center', justifyContent: 'center' } },
|
|
779
779
|
react_1.default.createElement(react_native_1.ActivityIndicator, { size: "large", color: colors.primary }),
|
|
780
780
|
react_1.default.createElement(react_native_1.Text, { style: { marginTop: 12, color: colors.textSecondary } }, strings_1.FD_STRINGS.LOADING_FD_DATA))));
|
|
781
781
|
}
|
|
782
|
-
return (react_1.default.createElement(SafeAreaWrapper_1.default, { style: customStyles.container, includeTop: false, statusBarColor:
|
|
782
|
+
return (react_1.default.createElement(SafeAreaWrapper_1.default, { style: customStyles.container, includeTop: false, statusBarColor: colors.headerBg, statusBarStyle: "light-content" },
|
|
783
783
|
react_1.default.createElement(react_native_1.View, { style: styles.customHeader },
|
|
784
784
|
react_1.default.createElement(react_native_1.TouchableOpacity, { style: styles.backButton, onPress: onGoBack, activeOpacity: 0.7 },
|
|
785
785
|
react_1.default.createElement(react_native_1.Image, { source: { uri: base64Images_1.base64Images.backArrow }, style: styles.backIcon, resizeMode: "contain" })),
|
|
786
786
|
react_1.default.createElement(react_native_1.View, { style: styles.headerContent },
|
|
787
787
|
react_1.default.createElement(react_native_1.Text, { style: styles.headerTitle }, strings_1.FD_STRINGS.CORPORATE_FDS_TITLE),
|
|
788
|
-
react_1.default.createElement(react_native_1.View, { style: styles.poweredByContainer },
|
|
789
|
-
react_1.default.createElement(react_native_1.Text, { style: styles.poweredByText }, "Powered by"),
|
|
790
|
-
react_1.default.createElement(react_native_1.Image, { source: { uri: base64Images_1.base64Images.simplfylogo }, style: styles.simplifyLogo, resizeMode: "contain" })))),
|
|
788
|
+
react_1.default.createElement(react_native_1.View, { style: styles.poweredByContainer }))),
|
|
791
789
|
react_1.default.createElement(react_native_1.ScrollView, { style: styles.content },
|
|
792
790
|
hasActiveFD && (react_1.default.createElement(react_native_1.View, { style: styles.section },
|
|
793
791
|
react_1.default.createElement(react_native_1.Text, { style: styles.sectionTitle }, strings_1.FD_STRINGS.ACTIVE_FDS_SECTION),
|
|
@@ -877,7 +875,7 @@ const createStyles = (colors, typography, spacing, themeName) => react_native_1.
|
|
|
877
875
|
backgroundColor: colors.surface,
|
|
878
876
|
},
|
|
879
877
|
customHeader: {
|
|
880
|
-
backgroundColor:
|
|
878
|
+
backgroundColor: colors.headerBg,
|
|
881
879
|
paddingTop: react_native_1.Platform.OS === 'ios' ? 50 : 20,
|
|
882
880
|
paddingBottom: spacing.md,
|
|
883
881
|
paddingHorizontal: spacing.lg,
|
|
@@ -893,19 +891,19 @@ const createStyles = (colors, typography, spacing, themeName) => react_native_1.
|
|
|
893
891
|
backIcon: {
|
|
894
892
|
width: 24,
|
|
895
893
|
height: 24,
|
|
896
|
-
tintColor:
|
|
894
|
+
tintColor: colors.headerText,
|
|
897
895
|
},
|
|
898
896
|
headerContent: {
|
|
899
897
|
flex: 1,
|
|
900
898
|
alignItems: 'flex-start',
|
|
901
899
|
marginRight: 40, // Balance the back button width
|
|
902
900
|
},
|
|
903
|
-
headerTitle: Object.assign(Object.assign({}, typography.styles.h3), { color:
|
|
901
|
+
headerTitle: Object.assign(Object.assign({}, typography.styles.h3), { color: colors.headerText, marginBottom: spacing.xs }),
|
|
904
902
|
poweredByContainer: {
|
|
905
903
|
flexDirection: 'row',
|
|
906
904
|
alignItems: 'center',
|
|
907
905
|
},
|
|
908
|
-
poweredByText: Object.assign(Object.assign({}, typography.styles.text10Regular), { color:
|
|
906
|
+
poweredByText: Object.assign(Object.assign({}, typography.styles.text10Regular), { color: colors.headerText, opacity: 0.7, marginRight: 0 }),
|
|
909
907
|
simplifyLogo: {
|
|
910
908
|
width: 70,
|
|
911
909
|
height: 20,
|
|
@@ -934,14 +932,14 @@ const createStyles = (colors, typography, spacing, themeName) => react_native_1.
|
|
|
934
932
|
paddingVertical: spacing.md,
|
|
935
933
|
marginHorizontal: 2,
|
|
936
934
|
borderBottomWidth: 3,
|
|
937
|
-
borderBottomColor:
|
|
935
|
+
borderBottomColor: colors.surface,
|
|
938
936
|
borderBottomLeftRadius: 8,
|
|
939
937
|
borderBottomRightRadius: 8,
|
|
940
938
|
backgroundColor: 'transparent',
|
|
941
939
|
},
|
|
942
940
|
activeTab: {
|
|
943
941
|
borderBottomColor: colors.tabSelected,
|
|
944
|
-
backgroundColor:
|
|
942
|
+
backgroundColor: colors.background,
|
|
945
943
|
borderBottomLeftRadius: 12,
|
|
946
944
|
borderBottomRightRadius: 12,
|
|
947
945
|
},
|
|
@@ -1003,6 +1001,6 @@ const createStyles = (colors, typography, spacing, themeName) => react_native_1.
|
|
|
1003
1001
|
borderRadius: spacing.sm,
|
|
1004
1002
|
marginTop: spacing.md,
|
|
1005
1003
|
},
|
|
1006
|
-
showAllButtonText: Object.assign(Object.assign({}, typography.styles.text14Medium), { color:
|
|
1004
|
+
showAllButtonText: Object.assign(Object.assign({}, typography.styles.text14Medium), { color: colors.headerText, textAlign: 'center' }),
|
|
1007
1005
|
});
|
|
1008
1006
|
exports.default = FDList;
|