@finspringinnovations/fdsdk 0.0.3 → 0.0.4

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.
@@ -1,4 +1,5 @@
1
1
  export namespace images {
2
2
  let arrowLeft: any;
3
3
  let chevronDown: any;
4
+ let shriramLogo: any;
4
5
  }
@@ -7,4 +7,5 @@ exports.images = void 0;
7
7
  exports.images = {
8
8
  arrowLeft: require('./arrow-left.png'),
9
9
  chevronDown: require('./chevron-down.png'),
10
+ shriramLogo: require('./shriram.png'),
10
11
  };
@@ -7,6 +7,7 @@ const react_1 = __importDefault(require("react"));
7
7
  const react_native_1 = require("react-native");
8
8
  const ThemeContext_1 = require("../theme/ThemeContext");
9
9
  const theme_1 = require("../theme");
10
+ const base64Images_1 = require("../constants/strings/base64Images");
10
11
  const FDCard = ({ id, name, accountNumber, roi, tenure, amount, maturityDate, status, creditRating, onPress, customStyles = {}, }) => {
11
12
  const colors = (0, ThemeContext_1.useColors)();
12
13
  const typography = (0, ThemeContext_1.useTypography)();
@@ -31,6 +32,8 @@ const FDCard = ({ id, name, accountNumber, roi, tenure, amount, maturityDate, st
31
32
  };
32
33
  return (react_1.default.createElement(react_native_1.TouchableOpacity, { style: [styles.fdCard, customStyles.container], onPress: () => onPress === null || onPress === void 0 ? void 0 : onPress(id), activeOpacity: 0.8 },
33
34
  react_1.default.createElement(react_native_1.View, { style: styles.fdCardHeader },
35
+ react_1.default.createElement(react_native_1.View, null,
36
+ react_1.default.createElement(react_native_1.Image, { source: { uri: base64Images_1.base64Images.shriramLogo }, style: styles.logo, resizeMode: "contain" })),
34
37
  react_1.default.createElement(react_native_1.Text, { style: [styles.fdName, customStyles.name] }, name)),
35
38
  react_1.default.createElement(react_native_1.View, { style: styles.fdDetailsRow },
36
39
  react_1.default.createElement(react_native_1.View, { style: styles.fdDetailItem },
@@ -91,6 +94,12 @@ const createStyles = (colors, typography, spacing, shadows, themeName) => {
91
94
  roiText: {
92
95
  color: colors.success,
93
96
  },
97
+ logo: {
98
+ width: 25,
99
+ height: 25,
100
+ marginRight: 5,
101
+ borderRadius: 15,
102
+ },
94
103
  });
95
104
  };
96
105
  exports.default = FDCard;
@@ -3,6 +3,7 @@ import type { SDKNavigationConfig } from './types';
3
3
  interface RootNavigatorProps {
4
4
  config?: SDKNavigationConfig;
5
5
  onExit?: (fdDetails?: any) => void;
6
+ onPanRequired?: () => void;
6
7
  }
7
8
  declare const RootNavigator: React.FC<RootNavigatorProps>;
8
9
  export default RootNavigator;
@@ -57,7 +57,7 @@ const PaymentStatus_1 = __importDefault(require("../screens/PaymentStatus"));
57
57
  const helpers_2 = require("./helpers");
58
58
  const paymentSession_1 = require("../state/paymentSession");
59
59
  const Stack = (0, stack_1.createStackNavigator)();
60
- const RootNavigator = ({ config = {}, onExit }) => {
60
+ const RootNavigator = ({ config = {}, onExit, onPanRequired, }) => {
61
61
  // Handle Android hardware back button
62
62
  (0, react_1.useEffect)(() => {
63
63
  if (react_native_1.Platform.OS !== 'android')
@@ -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)(), 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)));
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(), onPanRequired: onPanRequired, 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
@@ -6,6 +6,7 @@ import { type CustomColors } from '../config/appDataConfig';
6
6
  interface SDKNavigationContainerProps {
7
7
  config?: SDKNavigationConfig;
8
8
  onExit?: (fdDetails?: any) => void;
9
+ onPanRequired?: () => void;
9
10
  children?: React.ReactNode;
10
11
  theme?: ThemeName | Theme;
11
12
  colors?: CustomColors;
@@ -15,7 +15,7 @@ const MasterDataProvider_1 = require("../providers/MasterDataProvider");
15
15
  const helpers_1 = require("./helpers");
16
16
  const appDataConfig_1 = require("../config/appDataConfig");
17
17
  // Main navigation container for the SDK
18
- const SDKNavigationContainer = ({ config, onExit, children, theme, colors: propColors, useReactNavigation = true, // Default to React Navigation
18
+ const SDKNavigationContainer = ({ config, onExit, onPanRequired, children, theme, colors: propColors, useReactNavigation = true, // Default to React Navigation
19
19
  }) => {
20
20
  // Merge color overrides: prop-level colors take priority over global SDK colors
21
21
  const globalColors = (0, appDataConfig_1.getSDKColors)();
@@ -23,7 +23,7 @@ const SDKNavigationContainer = ({ config, onExit, children, theme, colors: propC
23
23
  ? Object.assign(Object.assign({}, (globalColors || {})), (propColors || {})) : null;
24
24
  // Choose navigator based on flag
25
25
  const navigator = useReactNavigation
26
- ? react_1.default.createElement(RootNavigator_1.default, { config: config, onExit: onExit })
26
+ ? react_1.default.createElement(RootNavigator_1.default, { config: config, onExit: onExit, onPanRequired: onPanRequired })
27
27
  : react_1.default.createElement(SimpleNavigator_1.default, { config: config, onExit: onExit });
28
28
  const content = children || (useReactNavigation ? (react_1.default.createElement(native_1.NavigationContainer, { ref: helpers_1.navigationRef }, navigator)) : (navigator));
29
29
  // Build ThemeProvider props
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  export interface FDCalculatorProps {
3
3
  onGoBack?: () => void;
4
4
  onExitSDK?: () => void;
5
+ onPanRequired?: () => void;
5
6
  onNavigateToReviewKYC?: () => void;
6
7
  fdData?: {
7
8
  id: string;
@@ -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, onExitSDK, onNavigateToReviewKYC, fdData }) => {
58
+ const FDCalculator = ({ onGoBack, onExitSDK, onPanRequired, 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)();
@@ -339,7 +339,10 @@ const FDCalculator = ({ onGoBack, onExitSDK, onNavigateToReviewKYC, fdData }) =>
339
339
  {
340
340
  text: 'OK',
341
341
  onPress: () => {
342
- if (onExitSDK) {
342
+ if (onPanRequired) {
343
+ onPanRequired();
344
+ }
345
+ else if (onExitSDK) {
343
346
  onExitSDK();
344
347
  }
345
348
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finspringinnovations/fdsdk",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "FD SDK for React Native applications",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -5,4 +5,5 @@
5
5
  export const images = {
6
6
  arrowLeft: require('./arrow-left.png'),
7
7
  chevronDown: require('./chevron-down.png'),
8
+ shriramLogo: require('./shriram.png'),
8
9
  };
Binary file
@@ -5,10 +5,12 @@ import {
5
5
  StyleSheet,
6
6
  TouchableOpacity,
7
7
  Platform,
8
+ Image,
8
9
  } from 'react-native';
9
10
  import { useColors, useTypography, useSpacing, useShadows, useTheme } from '../theme/ThemeContext';
10
11
  import { getBorderColor } from '../theme';
11
12
  import type { ColorScheme, ThemeName } from '../theme';
13
+ import { base64Images } from '../constants/strings/base64Images';
12
14
 
13
15
  interface FDCardProps {
14
16
  id: string;
@@ -74,6 +76,13 @@ const FDCard: React.FC<FDCardProps> = ({
74
76
  activeOpacity={0.8}
75
77
  >
76
78
  <View style={styles.fdCardHeader}>
79
+ <View>
80
+ <Image
81
+ source={{ uri: base64Images.shriramLogo }}
82
+ style={styles.logo}
83
+ resizeMode="contain"
84
+ />
85
+ </View>
77
86
  <Text style={[styles.fdName, customStyles.name]}>{name}</Text>
78
87
  </View>
79
88
 
@@ -160,6 +169,12 @@ const createStyles = (colors: ColorScheme, typography: any, spacing: any, shadow
160
169
  roiText: {
161
170
  color: colors.success,
162
171
  },
172
+ logo: {
173
+ width: 25,
174
+ height: 25,
175
+ marginRight: 5,
176
+ borderRadius: 15,
177
+ },
163
178
  });
164
179
 
165
180
  export default FDCard;
@@ -27,11 +27,13 @@ const Stack = createStackNavigator<RootStackParamList>();
27
27
  interface RootNavigatorProps {
28
28
  config?: SDKNavigationConfig;
29
29
  onExit?: (fdDetails?: any) => void;
30
+ onPanRequired?: () => void;
30
31
  }
31
32
 
32
33
  const RootNavigator: React.FC<RootNavigatorProps> = ({
33
34
  config = {},
34
- onExit
35
+ onExit,
36
+ onPanRequired,
35
37
  }) => {
36
38
  // Handle Android hardware back button
37
39
  useEffect(() => {
@@ -151,6 +153,7 @@ const RootNavigator: React.FC<RootNavigatorProps> = ({
151
153
  <FDCalculatorScreen
152
154
  onGoBack={() => goBack()}
153
155
  onExitSDK={() => onExit?.()}
156
+ onPanRequired={onPanRequired} // <── add this
154
157
  onNavigateToReviewKYC={() => navigate('ReviewKYC', { fdData: props.route.params?.fdData })}
155
158
  fdData={(props.route.params as any)?.fdData}
156
159
  {...props}
@@ -14,6 +14,7 @@ import { getSDKColors, type CustomColors } from '../config/appDataConfig';
14
14
  interface SDKNavigationContainerProps {
15
15
  config?: SDKNavigationConfig;
16
16
  onExit?: (fdDetails?: any) => void;
17
+ onPanRequired?: () => void;
17
18
  children?: React.ReactNode;
18
19
  theme?: ThemeName | Theme;
19
20
  colors?: CustomColors; // Custom color overrides (prop-level, highest priority)
@@ -24,6 +25,7 @@ interface SDKNavigationContainerProps {
24
25
  export const SDKNavigationContainer: React.FC<SDKNavigationContainerProps> = ({
25
26
  config,
26
27
  onExit,
28
+ onPanRequired,
27
29
  children,
28
30
  theme,
29
31
  colors: propColors,
@@ -37,7 +39,7 @@ export const SDKNavigationContainer: React.FC<SDKNavigationContainerProps> = ({
37
39
 
38
40
  // Choose navigator based on flag
39
41
  const navigator = useReactNavigation
40
- ? <RootNavigator config={config} onExit={onExit} />
42
+ ? <RootNavigator config={config} onExit={onExit} onPanRequired={onPanRequired} />
41
43
  : <SimpleNavigator config={config as SimpleNavigationConfig} onExit={onExit} />;
42
44
 
43
45
  const content = children || (
@@ -42,6 +42,7 @@ import { base64Images } from '../constants/strings/base64Images';
42
42
  export interface FDCalculatorProps {
43
43
  onGoBack?: () => void;
44
44
  onExitSDK?: () => void;
45
+ onPanRequired?: () => void;
45
46
  onNavigateToReviewKYC?: () => void;
46
47
  fdData?: {
47
48
  id: string;
@@ -56,7 +57,7 @@ export interface FDCalculatorProps {
56
57
  };
57
58
  }
58
59
 
59
- const FDCalculator: React.FC<FDCalculatorProps> = ({ onGoBack, onExitSDK, onNavigateToReviewKYC, fdData }) => {
60
+ const FDCalculator: React.FC<FDCalculatorProps> = ({ onGoBack, onExitSDK, onPanRequired, onNavigateToReviewKYC, fdData }) => {
60
61
  const typography = useTypography();
61
62
  const colors = useColors();
62
63
  const { themeName } = useTheme();
@@ -376,7 +377,9 @@ const FDCalculator: React.FC<FDCalculatorProps> = ({ onGoBack, onExitSDK, onNavi
376
377
  {
377
378
  text: 'OK',
378
379
  onPress: () => {
379
- if (onExitSDK) {
380
+ if (onPanRequired) {
381
+ onPanRequired();
382
+ } else if (onExitSDK) {
380
383
  onExitSDK();
381
384
  }
382
385
  },