@trustchex/react-native-sdk 1.250.0 → 1.253.0
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/module/Screens/Static/VerificationSessionCheckScreen.js +44 -73
- package/lib/module/Shared/Components/FaceCamera.js +5 -3
- package/lib/module/Shared/Components/IdentityDocumentCamera.js +5 -3
- package/lib/module/Shared/Components/LanguageSelector.js +14 -10
- package/lib/module/Shared/Components/NavigationManager.js +2 -2
- package/lib/module/Shared/Components/QrCodeScannerCamera.js +4 -1
- package/lib/module/Shared/Components/StyledButton.js +108 -9
- package/lib/module/Shared/Components/StyledTextInput.js +87 -0
- package/lib/module/Shared/Contexts/ThemeContext.js +40 -0
- package/lib/module/Translation/index.js +12 -5
- package/lib/module/Trustchex.js +5 -12
- package/lib/typescript/src/Screens/Static/VerificationSessionCheckScreen.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Components/FaceCamera.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Components/LanguageSelector.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Components/QrCodeScannerCamera.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Components/StyledButton.d.ts +12 -2
- package/lib/typescript/src/Shared/Components/StyledButton.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Components/StyledTextInput.d.ts +15 -0
- package/lib/typescript/src/Shared/Components/StyledTextInput.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Contexts/ThemeContext.d.ts +26 -0
- package/lib/typescript/src/Shared/Contexts/ThemeContext.d.ts.map +1 -0
- package/lib/typescript/src/Translation/index.d.ts.map +1 -1
- package/lib/typescript/src/Trustchex.d.ts.map +1 -1
- package/package.json +1 -6
- package/src/Screens/Static/VerificationSessionCheckScreen.tsx +53 -85
- package/src/Shared/Components/FaceCamera.tsx +4 -2
- package/src/Shared/Components/IdentityDocumentCamera.tsx +4 -2
- package/src/Shared/Components/LanguageSelector.tsx +12 -11
- package/src/Shared/Components/NavigationManager.tsx +3 -3
- package/src/Shared/Components/QrCodeScannerCamera.tsx +3 -1
- package/src/Shared/Components/StyledButton.tsx +141 -10
- package/src/Shared/Components/StyledTextInput.tsx +128 -0
- package/src/Shared/Contexts/ThemeContext.tsx +67 -0
- package/src/Translation/index.ts +12 -10
- package/src/Trustchex.tsx +11 -18
package/lib/module/Trustchex.js
CHANGED
|
@@ -4,8 +4,8 @@ import React, { useEffect, useState, useMemo } from 'react';
|
|
|
4
4
|
import { NavigationContainer } from '@react-navigation/native';
|
|
5
5
|
import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
|
6
6
|
import { View, ActivityIndicator, StyleSheet } from 'react-native';
|
|
7
|
-
import { MD3LightTheme, PaperProvider } from 'react-native-paper';
|
|
8
7
|
import 'react-native-get-random-values';
|
|
8
|
+
import { ThemeProvider } from "./Shared/Contexts/ThemeContext.js";
|
|
9
9
|
import IdentityDocumentEIDScanningScreen from "./Screens/Dynamic/IdentityDocumentEIDScanningScreen.js";
|
|
10
10
|
import IdentityDocumentScanningScreen from "./Screens/Dynamic/IdentityDocumentScanningScreen.js";
|
|
11
11
|
import LivenessDetectionScreen from "./Screens/Dynamic/LivenessDetectionScreen.js";
|
|
@@ -40,15 +40,6 @@ const Trustchex = ({
|
|
|
40
40
|
...DEFAULT_BRANDING,
|
|
41
41
|
...propBranding
|
|
42
42
|
}), [propBranding]);
|
|
43
|
-
const theme = useMemo(() => ({
|
|
44
|
-
...MD3LightTheme,
|
|
45
|
-
colors: {
|
|
46
|
-
...MD3LightTheme.colors,
|
|
47
|
-
primary: branding.primaryColor,
|
|
48
|
-
secondary: branding.secondaryColor,
|
|
49
|
-
tertiary: branding.tertiaryColor
|
|
50
|
-
}
|
|
51
|
-
}), [branding]);
|
|
52
43
|
const contextValue = useMemo(() => ({
|
|
53
44
|
isDemoSession: false,
|
|
54
45
|
baseUrl,
|
|
@@ -96,8 +87,10 @@ const Trustchex = ({
|
|
|
96
87
|
})
|
|
97
88
|
});
|
|
98
89
|
}
|
|
99
|
-
return /*#__PURE__*/_jsx(
|
|
100
|
-
|
|
90
|
+
return /*#__PURE__*/_jsx(ThemeProvider, {
|
|
91
|
+
primaryColor: branding.primaryColor,
|
|
92
|
+
secondaryColor: branding.secondaryColor,
|
|
93
|
+
tertiaryColor: branding.tertiaryColor,
|
|
101
94
|
children: /*#__PURE__*/_jsx(AppContext.Provider, {
|
|
102
95
|
value: contextValue,
|
|
103
96
|
children: /*#__PURE__*/_jsx(NavigationContainer, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VerificationSessionCheckScreen.d.ts","sourceRoot":"","sources":["../../../../../src/Screens/Static/VerificationSessionCheckScreen.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VerificationSessionCheckScreen.d.ts","sourceRoot":"","sources":["../../../../../src/Screens/Static/VerificationSessionCheckScreen.tsx"],"names":[],"mappings":"AA2CA,QAAA,MAAM,8BAA8B,+CA8XnC,CAAC;AAuHF,eAAe,8BAA8B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FaceCamera.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Components/FaceCamera.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FaceCamera.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Components/FaceCamera.tsx"],"names":[],"mappings":"AAYA,OAAO,EAGL,MAAM,EAKP,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EACL,KAAK,IAAI,EAEV,MAAM,qCAAqC,CAAC;AAQ7C,MAAM,MAAM,eAAe,GAAG;IAC5B,eAAe,EAAE,CACf,KAAK,EAAE,IAAI,EAAE,EACb,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,OAAO,KACnB,IAAI,CAAC;IACV,mBAAmB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/C,CAAC;AAQF,QAAA,MAAM,UAAU,GAAI,2CAGjB,eAAe,4CA4LjB,CAAC;AA6BF,eAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdentityDocumentCamera.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Components/IdentityDocumentCamera.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IdentityDocumentCamera.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Components/IdentityDocumentCamera.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,KAAK,CAAC;AA4BxC,MAAM,MAAM,mBAAmB,GAAG;IAChC,YAAY,EAAE,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,YAAY,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,KAAK,UAAU,GAAG;IAChB,UAAU,EAAE,SAAS,CAAC;IACtB,iBAAiB,EAAE,gBAAgB,CAAC;IACpC,KAAK,EAAE,SAAS,CAAC;IACjB,cAAc,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,KAAK,gBAAgB,GAAG,CAAC;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEnD,KAAK,SAAS,GAAG;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,KAAK,SAAS,GAAG;IACf,gBAAgB,EAAE,gBAAgB;IAClC,QAAQ,EAAE,YAAY;IACtB,SAAS,EAAE,SAAS;IACpB,aAAa,EAAE,MAAM,EAAE,GAAG,EAAE;IAC5B,QAAQ,EAAE,MAAM;CACjB,CAAC;AAEF,KAAK,YAAY,GAAG;IAClB,mBAAmB,EAAE,gBAAgB;IACrC,YAAY,EAAE,SAAS;IACvB,WAAW,EAAE,MAAM;CACpB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EACR,gBAAgB,GAChB,UAAU,GACV,oBAAoB,GACpB,eAAe,CAAC;CACrB,CAAC;AAEF,MAAM,WAAW,2BAA2B;IAC1C,WAAW,EAAE,OAAO,CAAC;IACrB,yBAAyB,EAAE,CAAC,WAAW,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACtE,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAaD,QAAA,MAAM,sBAAsB,GAAI,8DAI7B,2BAA2B,4CAskC7B,CAAC;AAuJF,eAAe,sBAAsB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LanguageSelector.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Components/LanguageSelector.tsx"],"names":[],"mappings":"AAKA,QAAA,MAAM,gBAAgB,+
|
|
1
|
+
{"version":3,"file":"LanguageSelector.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Components/LanguageSelector.tsx"],"names":[],"mappings":"AAKA,QAAA,MAAM,gBAAgB,+CAkCrB,CAAC;AAuBF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QrCodeScannerCamera.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Components/QrCodeScannerCamera.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"QrCodeScannerCamera.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Components/QrCodeScannerCamera.tsx"],"names":[],"mappings":"AA2BA,MAAM,WAAW,wBAAwB;IACvC,eAAe,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC;AAED,QAAA,MAAM,mBAAmB,GAAI,qBAAqB,wBAAwB,4CA4MzE,CAAC;AAqFF,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type
|
|
3
|
-
|
|
2
|
+
import { type ViewStyle, type TextStyle } from 'react-native';
|
|
3
|
+
interface StyledButtonProps {
|
|
4
|
+
mode?: 'text' | 'outlined' | 'contained';
|
|
5
|
+
onPress?: () => void;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
style?: ViewStyle;
|
|
10
|
+
labelStyle?: TextStyle;
|
|
11
|
+
buttonColor?: string;
|
|
12
|
+
textColor?: string;
|
|
13
|
+
}
|
|
4
14
|
declare const StyledButton: React.FC<StyledButtonProps>;
|
|
5
15
|
export default StyledButton;
|
|
6
16
|
//# sourceMappingURL=StyledButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StyledButton.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Components/StyledButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"StyledButton.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Components/StyledButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAoBtB,UAAU,iBAAiB;IACzB,IAAI,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,WAAW,CAAC;IACzC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAqF7C,CAAC;AAwCF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TextInput, type TextInputProps, type ViewStyle, type TextStyle } from 'react-native';
|
|
3
|
+
interface StyledTextInputProps extends TextInputProps {
|
|
4
|
+
containerStyle?: ViewStyle;
|
|
5
|
+
inputStyle?: TextStyle;
|
|
6
|
+
placeholderStyle?: TextStyle;
|
|
7
|
+
borderColor?: string;
|
|
8
|
+
focusedBorderColor?: string;
|
|
9
|
+
backgroundColor?: string;
|
|
10
|
+
textColor?: string;
|
|
11
|
+
placeholderColor?: string;
|
|
12
|
+
}
|
|
13
|
+
declare const StyledTextInput: React.ForwardRefExoticComponent<StyledTextInputProps & React.RefAttributes<TextInput>>;
|
|
14
|
+
export default StyledTextInput;
|
|
15
|
+
//# sourceMappingURL=StyledTextInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StyledTextInput.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Components/StyledTextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAEL,SAAS,EAGT,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAEtB,UAAU,oBAAqB,SAAQ,cAAc;IACnD,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,QAAA,MAAM,eAAe,wFAyEpB,CAAC;AAgCF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ThemeColors {
|
|
3
|
+
primary: string;
|
|
4
|
+
secondary: string;
|
|
5
|
+
tertiary: string;
|
|
6
|
+
background: string;
|
|
7
|
+
surface: string;
|
|
8
|
+
text: string;
|
|
9
|
+
textSecondary: string;
|
|
10
|
+
border: string;
|
|
11
|
+
error: string;
|
|
12
|
+
success: string;
|
|
13
|
+
}
|
|
14
|
+
interface ThemeContextType {
|
|
15
|
+
colors: ThemeColors;
|
|
16
|
+
}
|
|
17
|
+
export declare const useTheme: () => ThemeContextType;
|
|
18
|
+
interface ThemeProviderProps {
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
primaryColor?: string;
|
|
21
|
+
secondaryColor?: string;
|
|
22
|
+
tertiaryColor?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare const ThemeProvider: React.FC<ThemeProviderProps>;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=ThemeContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemeContext.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Contexts/ThemeContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAElE,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,gBAAgB;IACxB,MAAM,EAAE,WAAW,CAAC;CACrB;AAmBD,eAAO,MAAM,QAAQ,wBAAiC,CAAC;AAEvD,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAqBtD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Translation/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Translation/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,SAAS,CAAC;AAsC3B,eAAe,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Trustchex.d.ts","sourceRoot":"","sources":["../../../src/Trustchex.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Trustchex.d.ts","sourceRoot":"","sources":["../../../src/Trustchex.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAI5D,OAAO,gCAAgC,CAAC;AAgBxC,UAAU,iBAAiB;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,cAAc;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,MAAM,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AASD,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CA4HvC,CAAC;AAWF,eAAe,SAAS,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trustchex/react-native-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.253.0",
|
|
4
4
|
"description": "Trustchex mobile app react native SDK for android or ios devices",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -98,7 +98,6 @@
|
|
|
98
98
|
"react-native-gesture-handler": "^2.27.1",
|
|
99
99
|
"react-native-get-random-values": "^1.11.0",
|
|
100
100
|
"react-native-nfc-manager": "^3.16.2",
|
|
101
|
-
"react-native-paper": "^5.14.5",
|
|
102
101
|
"react-native-safe-area-context": "^5.5.2",
|
|
103
102
|
"react-native-screens": "^4.13.1",
|
|
104
103
|
"react-native-svg": "^15.12.0",
|
|
@@ -135,7 +134,6 @@
|
|
|
135
134
|
"react-native-gesture-handler": ">=2.27.1",
|
|
136
135
|
"react-native-get-random-values": ">=1.11.0",
|
|
137
136
|
"react-native-nfc-manager": ">=3.16.2",
|
|
138
|
-
"react-native-paper": ">=5.14.5",
|
|
139
137
|
"react-native-safe-area-context": ">=5.5.2",
|
|
140
138
|
"react-native-screens": ">=4.13.1",
|
|
141
139
|
"react-native-svg": ">=15.12.0",
|
|
@@ -188,9 +186,6 @@
|
|
|
188
186
|
"react-native-nfc-manager": {
|
|
189
187
|
"optional": false
|
|
190
188
|
},
|
|
191
|
-
"react-native-paper": {
|
|
192
|
-
"optional": false
|
|
193
|
-
},
|
|
194
189
|
"react-native-safe-area-context": {
|
|
195
190
|
"optional": false
|
|
196
191
|
},
|
|
@@ -27,8 +27,9 @@ import NavigationManager, {
|
|
|
27
27
|
type NavigationManagerRef,
|
|
28
28
|
} from '../../Shared/Components/NavigationManager';
|
|
29
29
|
import type { VerificationSession } from '../../Shared/Types/verificationSession';
|
|
30
|
-
import { TextInput, useTheme } from 'react-native-paper';
|
|
31
30
|
import StyledButton from '../../Shared/Components/StyledButton';
|
|
31
|
+
import StyledTextInput from '../../Shared/Components/StyledTextInput';
|
|
32
|
+
import { useTheme } from '../../Shared/Contexts/ThemeContext';
|
|
32
33
|
import LottieView from 'lottie-react-native';
|
|
33
34
|
import {
|
|
34
35
|
getSimulatedDemoData,
|
|
@@ -51,9 +52,10 @@ const VerificationSessionCheckScreen = () => {
|
|
|
51
52
|
const { t } = useTranslation();
|
|
52
53
|
const navigationManagerRef = React.useRef<NavigationManagerRef>(null);
|
|
53
54
|
const navigation = useNavigation();
|
|
54
|
-
const theme = useTheme();
|
|
55
55
|
const initialized = useRef(false);
|
|
56
56
|
const insets = useSafeAreaInsets();
|
|
57
|
+
const theme = useTheme();
|
|
58
|
+
const primaryColor = theme.colors.primary;
|
|
57
59
|
|
|
58
60
|
const apiUrl = useMemo(
|
|
59
61
|
() => `${appContext.baseUrl}/api/app/mobile`,
|
|
@@ -216,9 +218,6 @@ const VerificationSessionCheckScreen = () => {
|
|
|
216
218
|
appContext.workflowSteps = session?.workflowSteps;
|
|
217
219
|
if (session?.branding) {
|
|
218
220
|
appContext.branding = appContext.branding || session.branding;
|
|
219
|
-
theme.colors.primary = appContext.branding.primaryColor;
|
|
220
|
-
theme.colors.secondary = appContext.branding.secondaryColor;
|
|
221
|
-
theme.colors.tertiary = appContext.branding.tertiaryColor;
|
|
222
221
|
}
|
|
223
222
|
|
|
224
223
|
if (session?.sendOTP) {
|
|
@@ -240,10 +239,6 @@ const VerificationSessionCheckScreen = () => {
|
|
|
240
239
|
appContext.identificationInfo.sessionId,
|
|
241
240
|
getSession,
|
|
242
241
|
sendOTPCode,
|
|
243
|
-
theme.colors,
|
|
244
|
-
theme.colors.primary,
|
|
245
|
-
theme.colors.secondary,
|
|
246
|
-
theme.colors.tertiary,
|
|
247
242
|
]);
|
|
248
243
|
|
|
249
244
|
return (
|
|
@@ -287,59 +282,53 @@ const VerificationSessionCheckScreen = () => {
|
|
|
287
282
|
<Text style={styles.mainText}>
|
|
288
283
|
{t('verificationSessionCheckScreen.mainText')}
|
|
289
284
|
</Text>
|
|
290
|
-
<
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
}
|
|
319
|
-
} catch {
|
|
285
|
+
<StyledTextInput
|
|
286
|
+
autoCapitalize="characters"
|
|
287
|
+
placeholder={t(
|
|
288
|
+
'verificationSessionCheckScreen.enterSessionCode'
|
|
289
|
+
)}
|
|
290
|
+
borderColor={primaryColor}
|
|
291
|
+
focusedBorderColor={primaryColor}
|
|
292
|
+
inputStyle={styles.sessionCodeTextInput}
|
|
293
|
+
placeholderStyle={styles.sessionCodeTextInputPlaceholder}
|
|
294
|
+
value={sessionCode.toUpperCase()}
|
|
295
|
+
onChangeText={async (text) => {
|
|
296
|
+
const alphanumericText = text
|
|
297
|
+
.toUpperCase()
|
|
298
|
+
.replace(SESSION_CODE_CHARSET_PATTERN, '');
|
|
299
|
+
if (alphanumericText.length <= 8) {
|
|
300
|
+
setSessionCode(alphanumericText);
|
|
301
|
+
if (
|
|
302
|
+
validateSessionCode(alphanumericText) &&
|
|
303
|
+
alphanumericText.length === 8
|
|
304
|
+
) {
|
|
305
|
+
try {
|
|
306
|
+
setIsCheckingSession(true);
|
|
307
|
+
const session =
|
|
308
|
+
await getSessionByCode(alphanumericText);
|
|
309
|
+
if (session?.id) {
|
|
310
|
+
appContext.identificationInfo.sessionId =
|
|
311
|
+
session.id;
|
|
312
|
+
} else {
|
|
320
313
|
setSessionCode('');
|
|
321
|
-
} finally {
|
|
322
|
-
setTimeout(() => {
|
|
323
|
-
setIsCheckingSession(false);
|
|
324
|
-
}, 1000);
|
|
325
314
|
}
|
|
315
|
+
} catch {
|
|
316
|
+
setSessionCode('');
|
|
317
|
+
} finally {
|
|
318
|
+
setTimeout(() => {
|
|
319
|
+
setIsCheckingSession(false);
|
|
320
|
+
}, 1000);
|
|
326
321
|
}
|
|
327
322
|
}
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
{!sessionCode && (
|
|
333
|
-
<Text style={styles.placeholderText}>
|
|
334
|
-
{t('verificationSessionCheckScreen.enterSessionCode')}
|
|
335
|
-
</Text>
|
|
336
|
-
)}
|
|
337
|
-
</View>
|
|
323
|
+
}
|
|
324
|
+
}}
|
|
325
|
+
maxLength={8}
|
|
326
|
+
/>
|
|
338
327
|
<View style={styles.horizontalLineContainer}>
|
|
339
328
|
<View
|
|
340
329
|
style={[
|
|
341
330
|
styles.horizontalLine,
|
|
342
|
-
{ backgroundColor:
|
|
331
|
+
{ backgroundColor: primaryColor },
|
|
343
332
|
]}
|
|
344
333
|
/>
|
|
345
334
|
<Text style={styles.mainText}>
|
|
@@ -348,7 +337,7 @@ const VerificationSessionCheckScreen = () => {
|
|
|
348
337
|
<View
|
|
349
338
|
style={[
|
|
350
339
|
styles.horizontalLine,
|
|
351
|
-
{ backgroundColor:
|
|
340
|
+
{ backgroundColor: primaryColor },
|
|
352
341
|
]}
|
|
353
342
|
/>
|
|
354
343
|
</View>
|
|
@@ -366,14 +355,12 @@ const VerificationSessionCheckScreen = () => {
|
|
|
366
355
|
<Text style={styles.mainText}>
|
|
367
356
|
{t('verificationSessionCheckScreen.codeText')}
|
|
368
357
|
</Text>
|
|
369
|
-
<
|
|
370
|
-
mode="outlined"
|
|
358
|
+
<StyledTextInput
|
|
371
359
|
autoFocus={true}
|
|
372
360
|
placeholder=""
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
contentStyle={styles.otpCodeInputWithText}
|
|
361
|
+
borderColor={primaryColor}
|
|
362
|
+
focusedBorderColor={primaryColor}
|
|
363
|
+
inputStyle={styles.otpCodeTextInput}
|
|
377
364
|
keyboardType="number-pad"
|
|
378
365
|
textContentType="oneTimeCode"
|
|
379
366
|
autoComplete="sms-otp"
|
|
@@ -464,7 +451,7 @@ const styles = StyleSheet.create({
|
|
|
464
451
|
},
|
|
465
452
|
horizontalLine: {
|
|
466
453
|
flex: 1,
|
|
467
|
-
height:
|
|
454
|
+
height: 1,
|
|
468
455
|
},
|
|
469
456
|
loadingAnimation: {
|
|
470
457
|
width: '100%',
|
|
@@ -533,40 +520,21 @@ const styles = StyleSheet.create({
|
|
|
533
520
|
alignItems: 'center',
|
|
534
521
|
position: 'absolute',
|
|
535
522
|
},
|
|
536
|
-
inputContainer: {
|
|
537
|
-
position: 'relative',
|
|
538
|
-
width: '100%',
|
|
539
|
-
},
|
|
540
523
|
sessionCodeTextInput: {
|
|
541
|
-
backgroundColor: 'white',
|
|
542
|
-
},
|
|
543
|
-
sessionCodeInputWithText: {
|
|
544
524
|
textTransform: 'uppercase',
|
|
545
525
|
fontWeight: '800',
|
|
546
526
|
fontSize: 28,
|
|
547
527
|
textAlign: 'center',
|
|
548
528
|
letterSpacing: 8,
|
|
549
529
|
},
|
|
550
|
-
|
|
551
|
-
position: 'absolute',
|
|
552
|
-
top: 0,
|
|
553
|
-
left: 0,
|
|
554
|
-
right: 0,
|
|
555
|
-
height: '100%',
|
|
556
|
-
lineHeight: 56,
|
|
557
|
-
fontSize: 16,
|
|
558
|
-
color: '#666',
|
|
559
|
-
textAlign: 'center',
|
|
560
|
-
pointerEvents: 'none',
|
|
561
|
-
},
|
|
562
|
-
sessionCodeInputPlaceholder: {
|
|
530
|
+
sessionCodeTextInputPlaceholder: {
|
|
563
531
|
fontSize: 16,
|
|
532
|
+
fontWeight: '400',
|
|
533
|
+
letterSpacing: 0,
|
|
564
534
|
textAlign: 'center',
|
|
535
|
+
textTransform: 'none',
|
|
565
536
|
},
|
|
566
537
|
otpCodeTextInput: {
|
|
567
|
-
backgroundColor: 'white',
|
|
568
|
-
},
|
|
569
|
-
otpCodeInputWithText: {
|
|
570
538
|
fontWeight: '800',
|
|
571
539
|
fontSize: 28,
|
|
572
540
|
textAlign: 'center',
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
Platform,
|
|
9
9
|
Linking,
|
|
10
10
|
Dimensions,
|
|
11
|
+
ActivityIndicator,
|
|
11
12
|
} from 'react-native';
|
|
12
13
|
import {
|
|
13
14
|
useCameraDevice,
|
|
@@ -28,8 +29,8 @@ import { Worklets, useSharedValue } from 'react-native-worklets-core';
|
|
|
28
29
|
import { crop } from '../VisionCameraPlugins/Cropper';
|
|
29
30
|
import { isFrameBright } from '../Libs/camera.utils';
|
|
30
31
|
import { useTranslation } from 'react-i18next';
|
|
31
|
-
import { ActivityIndicator } from 'react-native-paper';
|
|
32
32
|
import StyledButton from './StyledButton';
|
|
33
|
+
import { useTheme } from '../Contexts/ThemeContext';
|
|
33
34
|
|
|
34
35
|
export type FaceCameraProps = {
|
|
35
36
|
onFacesDetected: (
|
|
@@ -51,6 +52,7 @@ const FaceCamera = ({
|
|
|
51
52
|
onCameraInitialized,
|
|
52
53
|
}: FaceCameraProps) => {
|
|
53
54
|
useKeepAwake();
|
|
55
|
+
const theme = useTheme();
|
|
54
56
|
const cameraPermission = useCameraPermission();
|
|
55
57
|
const microphonePermission = useMicrophonePermission();
|
|
56
58
|
const [permissionsRequested, setPermissionsRequested] = useState(false);
|
|
@@ -164,7 +166,7 @@ const FaceCamera = ({
|
|
|
164
166
|
if (!permissionsRequested) {
|
|
165
167
|
return (
|
|
166
168
|
<View style={styles.permissionContainer}>
|
|
167
|
-
<ActivityIndicator size="large" />
|
|
169
|
+
<ActivityIndicator size="large" color={theme.colors.primary} />
|
|
168
170
|
</View>
|
|
169
171
|
);
|
|
170
172
|
}
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
Text,
|
|
12
12
|
Linking,
|
|
13
13
|
Image,
|
|
14
|
+
ActivityIndicator,
|
|
14
15
|
} from 'react-native';
|
|
15
16
|
import {
|
|
16
17
|
Camera,
|
|
@@ -46,11 +47,11 @@ import {
|
|
|
46
47
|
import { getAverageBrightness } from '../Libs/camera.utils';
|
|
47
48
|
import { useTranslation } from 'react-i18next';
|
|
48
49
|
import LottieView from 'lottie-react-native';
|
|
49
|
-
import { ActivityIndicator } from 'react-native-paper';
|
|
50
50
|
import StyledButton from './StyledButton';
|
|
51
51
|
import { type Barcode, scanCodes } from '../VisionCameraPlugins/BarcodeScanner';
|
|
52
52
|
import { speakWithDebounce } from '../Libs/tts.utils';
|
|
53
53
|
import AppContext from '../Contexts/AppContext';
|
|
54
|
+
import { useTheme } from '../Contexts/ThemeContext';
|
|
54
55
|
|
|
55
56
|
export type DocumentScannedData = {
|
|
56
57
|
documentType: 'ID_FRONT' | 'ID_BACK' | 'PASSPORT' | 'UNKNOWN';
|
|
@@ -133,6 +134,7 @@ const IdentityDocumentCamera = ({
|
|
|
133
134
|
showDebugImages = false,
|
|
134
135
|
}: IdentityDocumentCameraProps) => {
|
|
135
136
|
useKeepAwake();
|
|
137
|
+
const theme = useTheme();
|
|
136
138
|
const appContext = React.useContext(AppContext);
|
|
137
139
|
const cameraRef = React.useRef<Camera>(null);
|
|
138
140
|
const cameraPermission = useCameraPermission();
|
|
@@ -971,7 +973,7 @@ const IdentityDocumentCamera = ({
|
|
|
971
973
|
if (!permissionsRequested) {
|
|
972
974
|
return (
|
|
973
975
|
<View style={styles.permissionContainer}>
|
|
974
|
-
<ActivityIndicator size="large" />
|
|
976
|
+
<ActivityIndicator size="large" color={theme.colors.primary} />
|
|
975
977
|
</View>
|
|
976
978
|
);
|
|
977
979
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Pressable, StyleSheet, Text, View } from 'react-native';
|
|
3
3
|
import i18n from '../../Translation';
|
|
4
|
-
import
|
|
4
|
+
import { useTheme } from '../Contexts/ThemeContext';
|
|
5
5
|
|
|
6
6
|
const LanguageSelector = () => {
|
|
7
|
-
const
|
|
7
|
+
const theme = useTheme();
|
|
8
|
+
const isEnglish = i18n.language.startsWith('en');
|
|
9
|
+
const isTurkish = i18n.language.startsWith('tr');
|
|
8
10
|
|
|
9
11
|
return (
|
|
10
12
|
<View style={styles.container}>
|
|
@@ -12,21 +14,22 @@ const LanguageSelector = () => {
|
|
|
12
14
|
<Text
|
|
13
15
|
style={[
|
|
14
16
|
styles.buttonText,
|
|
15
|
-
|
|
16
|
-
{
|
|
17
|
-
color: appContext.branding.primaryColor,
|
|
18
|
-
},
|
|
17
|
+
isEnglish && styles.buttonTextSelected,
|
|
18
|
+
isEnglish && { color: theme.colors.primary },
|
|
19
19
|
]}
|
|
20
20
|
>
|
|
21
21
|
EN
|
|
22
22
|
</Text>
|
|
23
23
|
</Pressable>
|
|
24
|
-
<View
|
|
24
|
+
<View
|
|
25
|
+
style={[styles.verticalSeperator, { borderColor: theme.colors.border }]}
|
|
26
|
+
/>
|
|
25
27
|
<Pressable onPress={() => i18n.changeLanguage('tr')}>
|
|
26
28
|
<Text
|
|
27
29
|
style={[
|
|
28
30
|
styles.buttonText,
|
|
29
|
-
|
|
31
|
+
isTurkish && styles.buttonTextSelected,
|
|
32
|
+
isTurkish && { color: theme.colors.primary },
|
|
30
33
|
]}
|
|
31
34
|
>
|
|
32
35
|
TR
|
|
@@ -46,16 +49,14 @@ const styles = StyleSheet.create({
|
|
|
46
49
|
},
|
|
47
50
|
buttonText: {
|
|
48
51
|
fontSize: 18,
|
|
49
|
-
color: '
|
|
52
|
+
color: '#999999',
|
|
50
53
|
},
|
|
51
54
|
buttonTextSelected: {
|
|
52
|
-
color: '#000000',
|
|
53
55
|
fontWeight: 'bold',
|
|
54
56
|
},
|
|
55
57
|
verticalSeperator: {
|
|
56
58
|
borderLeftWidth: 1,
|
|
57
59
|
height: 24,
|
|
58
|
-
borderColor: 'black',
|
|
59
60
|
},
|
|
60
61
|
});
|
|
61
62
|
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
import { View, StyleSheet, Alert } from 'react-native';
|
|
15
15
|
import { useTranslation } from 'react-i18next';
|
|
16
16
|
import i18n from '../../Translation';
|
|
17
|
-
import
|
|
17
|
+
import StyledButton from './StyledButton';
|
|
18
18
|
|
|
19
19
|
// Simple global navigation lock
|
|
20
20
|
let isNavigating = false;
|
|
@@ -235,9 +235,9 @@ const NavigationManager = forwardRef(
|
|
|
235
235
|
appContext.currentWorkflowStep &&
|
|
236
236
|
(!appContext.currentWorkflowStep?.required || canSkipStep) && (
|
|
237
237
|
<View style={styles.container}>
|
|
238
|
-
<
|
|
238
|
+
<StyledButton mode="text" onPress={goToNextRouteWithAlert}>
|
|
239
239
|
{t('navigationManager.skipStepLabel')}
|
|
240
|
-
</
|
|
240
|
+
</StyledButton>
|
|
241
241
|
</View>
|
|
242
242
|
)
|
|
243
243
|
);
|
|
@@ -23,6 +23,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
23
23
|
import LottieView from 'lottie-react-native';
|
|
24
24
|
import { type Barcode, scanCodes } from '../VisionCameraPlugins/BarcodeScanner';
|
|
25
25
|
import StyledButton from './StyledButton';
|
|
26
|
+
import { useTheme } from '../Contexts/ThemeContext';
|
|
26
27
|
|
|
27
28
|
export interface QrCodeScannerCameraProps {
|
|
28
29
|
onQrCodeScanned: (data: string) => void;
|
|
@@ -30,6 +31,7 @@ export interface QrCodeScannerCameraProps {
|
|
|
30
31
|
|
|
31
32
|
const QrCodeScannerCamera = ({ onQrCodeScanned }: QrCodeScannerCameraProps) => {
|
|
32
33
|
useKeepAwake();
|
|
34
|
+
const theme = useTheme();
|
|
33
35
|
const cameraPermission = useCameraPermission();
|
|
34
36
|
const [permissionsRequested, setPermissionsRequested] = React.useState(false);
|
|
35
37
|
const [isActive, setIsActive] = React.useState(false);
|
|
@@ -164,7 +166,7 @@ const QrCodeScannerCamera = ({ onQrCodeScanned }: QrCodeScannerCameraProps) => {
|
|
|
164
166
|
if (!permissionsRequested) {
|
|
165
167
|
return (
|
|
166
168
|
<View style={styles.permissionContainer}>
|
|
167
|
-
<ActivityIndicator size="large" />
|
|
169
|
+
<ActivityIndicator size="large" color={theme.colors.primary} />
|
|
168
170
|
</View>
|
|
169
171
|
);
|
|
170
172
|
}
|