assentify-sdk-react-native 0.0.1 → 0.0.2
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/README.md +4 -0
- package/lib/commonjs/AssentifyProvider.js +49 -2
- package/lib/commonjs/AssentifyProvider.js.map +1 -1
- package/lib/commonjs/AssentifyWrapper.js +13 -30
- package/lib/commonjs/AssentifyWrapper.js.map +1 -1
- package/lib/commonjs/components/BackButton.js +33 -0
- package/lib/commonjs/components/BackButton.js.map +1 -0
- package/lib/commonjs/components/BaseButton.js +41 -0
- package/lib/commonjs/components/BaseButton.js.map +1 -0
- package/lib/commonjs/components/BaseIcon.js +83 -0
- package/lib/commonjs/components/BaseIcon.js.map +1 -0
- package/lib/commonjs/components/CloseButton.js +33 -0
- package/lib/commonjs/components/CloseButton.js.map +1 -0
- package/lib/commonjs/components/CustomHeader.js +54 -0
- package/lib/commonjs/components/CustomHeader.js.map +1 -0
- package/lib/commonjs/components/Each.js +16 -0
- package/lib/commonjs/components/Each.js.map +1 -0
- package/lib/commonjs/components/Page.js +45 -0
- package/lib/commonjs/components/Page.js.map +1 -0
- package/lib/commonjs/components/icons/arrow-left.js +28 -0
- package/lib/commonjs/components/icons/arrow-left.js.map +1 -0
- package/lib/commonjs/components/icons/big-warning.js +34 -0
- package/lib/commonjs/components/icons/big-warning.js.map +1 -0
- package/lib/commonjs/components/icons/check-success.js +28 -0
- package/lib/commonjs/components/icons/check-success.js.map +1 -0
- package/lib/commonjs/components/icons/chevron-down.js +28 -0
- package/lib/commonjs/components/icons/chevron-down.js.map +1 -0
- package/lib/commonjs/components/icons/chevron-left.js +28 -0
- package/lib/commonjs/components/icons/chevron-left.js.map +1 -0
- package/lib/commonjs/components/icons/chevron-right.js +28 -0
- package/lib/commonjs/components/icons/chevron-right.js.map +1 -0
- package/lib/commonjs/components/icons/chevron-up.js +27 -0
- package/lib/commonjs/components/icons/chevron-up.js.map +1 -0
- package/lib/commonjs/components/icons/close.js +28 -0
- package/lib/commonjs/components/icons/close.js.map +1 -0
- package/lib/commonjs/components/type.js +2 -0
- package/lib/commonjs/components/type.js.map +1 -0
- package/lib/commonjs/helpers/NavigationService.js +80 -0
- package/lib/commonjs/helpers/NavigationService.js.map +1 -0
- package/lib/commonjs/helpers/constants.js +16 -0
- package/lib/commonjs/helpers/constants.js.map +1 -0
- package/lib/commonjs/helpers/useBackHandler.js +16 -0
- package/lib/commonjs/helpers/useBackHandler.js.map +1 -0
- package/lib/commonjs/navigator/index.js +30 -0
- package/lib/commonjs/navigator/index.js.map +1 -0
- package/lib/commonjs/screens/SelectDocument.js +248 -0
- package/lib/commonjs/screens/SelectDocument.js.map +1 -0
- package/lib/commonjs/themes/index.js +22 -0
- package/lib/commonjs/themes/index.js.map +1 -0
- package/lib/commonjs/themes/styling.js +64 -0
- package/lib/commonjs/themes/styling.js.map +1 -0
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/useGlobalStore.js +52 -0
- package/lib/commonjs/useGlobalStore.js.map +1 -0
- package/lib/module/AssentifyProvider.js +50 -2
- package/lib/module/AssentifyProvider.js.map +1 -1
- package/lib/module/AssentifyWrapper.js +13 -31
- package/lib/module/AssentifyWrapper.js.map +1 -1
- package/lib/module/components/BackButton.js +26 -0
- package/lib/module/components/BackButton.js.map +1 -0
- package/lib/module/components/BaseButton.js +34 -0
- package/lib/module/components/BaseButton.js.map +1 -0
- package/lib/module/components/BaseIcon.js +76 -0
- package/lib/module/components/BaseIcon.js.map +1 -0
- package/lib/module/components/CloseButton.js +26 -0
- package/lib/module/components/CloseButton.js.map +1 -0
- package/lib/module/components/CustomHeader.js +47 -0
- package/lib/module/components/CustomHeader.js.map +1 -0
- package/lib/module/components/Each.js +9 -0
- package/lib/module/components/Each.js.map +1 -0
- package/lib/module/components/Page.js +38 -0
- package/lib/module/components/Page.js.map +1 -0
- package/lib/module/components/icons/arrow-left.js +19 -0
- package/lib/module/components/icons/arrow-left.js.map +1 -0
- package/lib/module/components/icons/big-warning.js +25 -0
- package/lib/module/components/icons/big-warning.js.map +1 -0
- package/lib/module/components/icons/check-success.js +19 -0
- package/lib/module/components/icons/check-success.js.map +1 -0
- package/lib/module/components/icons/chevron-down.js +19 -0
- package/lib/module/components/icons/chevron-down.js.map +1 -0
- package/lib/module/components/icons/chevron-left.js +19 -0
- package/lib/module/components/icons/chevron-left.js.map +1 -0
- package/lib/module/components/icons/chevron-right.js +19 -0
- package/lib/module/components/icons/chevron-right.js.map +1 -0
- package/lib/module/components/icons/chevron-up.js +19 -0
- package/lib/module/components/icons/chevron-up.js.map +1 -0
- package/lib/module/components/icons/close.js +19 -0
- package/lib/module/components/icons/close.js.map +1 -0
- package/lib/module/components/type.js +2 -0
- package/lib/module/components/type.js.map +1 -0
- package/lib/module/helpers/NavigationService.js +75 -0
- package/lib/module/helpers/NavigationService.js.map +1 -0
- package/lib/module/helpers/constants.js +10 -0
- package/lib/module/helpers/constants.js.map +1 -0
- package/lib/module/helpers/useBackHandler.js +10 -0
- package/lib/module/helpers/useBackHandler.js.map +1 -0
- package/lib/module/navigator/index.js +23 -0
- package/lib/module/navigator/index.js.map +1 -0
- package/lib/module/screens/SelectDocument.js +240 -0
- package/lib/module/screens/SelectDocument.js.map +1 -0
- package/lib/module/themes/index.js +16 -0
- package/lib/module/themes/index.js.map +1 -0
- package/lib/module/themes/styling.js +52 -0
- package/lib/module/themes/styling.js.map +1 -0
- package/lib/module/types.js.map +1 -1
- package/lib/module/useGlobalStore.js +46 -0
- package/lib/module/useGlobalStore.js.map +1 -0
- package/lib/typescript/example/src/Home.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/AssentifyProvider.d.ts +2 -0
- package/lib/typescript/lib/commonjs/AssentifyProvider.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/AssentifyWrapper.d.ts +1 -0
- package/lib/typescript/lib/commonjs/AssentifyWrapper.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/components/BackButton.d.ts +6 -0
- package/lib/typescript/lib/commonjs/components/BackButton.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/BaseButton.d.ts +7 -0
- package/lib/typescript/lib/commonjs/components/BaseButton.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/BaseIcon.d.ts +29 -0
- package/lib/typescript/lib/commonjs/components/BaseIcon.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/CloseButton.d.ts +6 -0
- package/lib/typescript/lib/commonjs/components/CloseButton.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/CustomHeader.d.ts +9 -0
- package/lib/typescript/lib/commonjs/components/CustomHeader.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Each.d.ts +7 -0
- package/lib/typescript/lib/commonjs/components/Each.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Page.d.ts +14 -0
- package/lib/typescript/lib/commonjs/components/Page.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/icons/arrow-left.d.ts +4 -0
- package/lib/typescript/lib/commonjs/components/icons/arrow-left.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/icons/big-warning.d.ts +4 -0
- package/lib/typescript/lib/commonjs/components/icons/big-warning.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/icons/check-success.d.ts +4 -0
- package/lib/typescript/lib/commonjs/components/icons/check-success.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/icons/chevron-down.d.ts +4 -0
- package/lib/typescript/lib/commonjs/components/icons/chevron-down.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/icons/chevron-left.d.ts +4 -0
- package/lib/typescript/lib/commonjs/components/icons/chevron-left.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/icons/chevron-right.d.ts +4 -0
- package/lib/typescript/lib/commonjs/components/icons/chevron-right.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/icons/chevron-up.d.ts +4 -0
- package/lib/typescript/lib/commonjs/components/icons/chevron-up.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/icons/close.d.ts +4 -0
- package/lib/typescript/lib/commonjs/components/icons/close.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/type.d.ts +1 -0
- package/lib/typescript/lib/commonjs/components/type.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/helpers/NavigationService.d.ts +29 -0
- package/lib/typescript/lib/commonjs/helpers/NavigationService.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/helpers/constants.d.ts +11 -0
- package/lib/typescript/lib/commonjs/helpers/constants.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/helpers/useBackHandler.d.ts +3 -0
- package/lib/typescript/lib/commonjs/helpers/useBackHandler.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/navigator/index.d.ts +4 -0
- package/lib/typescript/lib/commonjs/navigator/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/screens/SelectDocument.d.ts +4 -0
- package/lib/typescript/lib/commonjs/screens/SelectDocument.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/themes/index.d.ts +17 -0
- package/lib/typescript/lib/commonjs/themes/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/themes/styling.d.ts +8 -0
- package/lib/typescript/lib/commonjs/themes/styling.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/useGlobalStore.d.ts +5 -0
- package/lib/typescript/lib/commonjs/useGlobalStore.d.ts.map +1 -0
- package/lib/typescript/lib/module/AssentifyProvider.d.ts +3 -1
- package/lib/typescript/lib/module/AssentifyProvider.d.ts.map +1 -1
- package/lib/typescript/lib/module/AssentifyWrapper.d.ts +1 -0
- package/lib/typescript/lib/module/AssentifyWrapper.d.ts.map +1 -1
- package/lib/typescript/lib/module/components/BackButton.d.ts +7 -0
- package/lib/typescript/lib/module/components/BackButton.d.ts.map +1 -0
- package/lib/typescript/lib/module/components/BaseButton.d.ts +8 -0
- package/lib/typescript/lib/module/components/BaseButton.d.ts.map +1 -0
- package/lib/typescript/lib/module/components/BaseIcon.d.ts +29 -0
- package/lib/typescript/lib/module/components/BaseIcon.d.ts.map +1 -0
- package/lib/typescript/lib/module/components/CloseButton.d.ts +7 -0
- package/lib/typescript/lib/module/components/CloseButton.d.ts.map +1 -0
- package/lib/typescript/lib/module/components/CustomHeader.d.ts +10 -0
- package/lib/typescript/lib/module/components/CustomHeader.d.ts.map +1 -0
- package/lib/typescript/lib/module/components/Each.d.ts +7 -0
- package/lib/typescript/lib/module/components/Each.d.ts.map +1 -0
- package/lib/typescript/lib/module/components/Page.d.ts +15 -0
- package/lib/typescript/lib/module/components/Page.d.ts.map +1 -0
- package/lib/typescript/lib/module/components/icons/arrow-left.d.ts +5 -0
- package/lib/typescript/lib/module/components/icons/arrow-left.d.ts.map +1 -0
- package/lib/typescript/lib/module/components/icons/big-warning.d.ts +5 -0
- package/lib/typescript/lib/module/components/icons/big-warning.d.ts.map +1 -0
- package/lib/typescript/lib/module/components/icons/check-success.d.ts +5 -0
- package/lib/typescript/lib/module/components/icons/check-success.d.ts.map +1 -0
- package/lib/typescript/lib/module/components/icons/chevron-down.d.ts +5 -0
- package/lib/typescript/lib/module/components/icons/chevron-down.d.ts.map +1 -0
- package/lib/typescript/lib/module/components/icons/chevron-left.d.ts +5 -0
- package/lib/typescript/lib/module/components/icons/chevron-left.d.ts.map +1 -0
- package/lib/typescript/lib/module/components/icons/chevron-right.d.ts +5 -0
- package/lib/typescript/lib/module/components/icons/chevron-right.d.ts.map +1 -0
- package/lib/typescript/lib/module/components/icons/chevron-up.d.ts +5 -0
- package/lib/typescript/lib/module/components/icons/chevron-up.d.ts.map +1 -0
- package/lib/typescript/lib/module/components/icons/close.d.ts +5 -0
- package/lib/typescript/lib/module/components/icons/close.d.ts.map +1 -0
- package/lib/typescript/lib/module/components/type.d.ts +1 -0
- package/lib/typescript/lib/module/components/type.d.ts.map +1 -0
- package/lib/typescript/lib/module/helpers/NavigationService.d.ts +28 -0
- package/lib/typescript/lib/module/helpers/NavigationService.d.ts.map +1 -0
- package/lib/typescript/lib/module/helpers/constants.d.ts +10 -0
- package/lib/typescript/lib/module/helpers/constants.d.ts.map +1 -0
- package/lib/typescript/lib/module/helpers/useBackHandler.d.ts +2 -0
- package/lib/typescript/lib/module/helpers/useBackHandler.d.ts.map +1 -0
- package/lib/typescript/lib/module/index.d.ts +1 -0
- package/lib/typescript/lib/module/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/navigator/index.d.ts +4 -0
- package/lib/typescript/lib/module/navigator/index.d.ts.map +1 -0
- package/lib/typescript/lib/module/screens/SelectDocument.d.ts +4 -0
- package/lib/typescript/lib/module/screens/SelectDocument.d.ts.map +1 -0
- package/lib/typescript/lib/module/themes/index.d.ts +16 -0
- package/lib/typescript/lib/module/themes/index.d.ts.map +1 -0
- package/lib/typescript/lib/module/themes/styling.d.ts +7 -0
- package/lib/typescript/lib/module/themes/styling.d.ts.map +1 -0
- package/lib/typescript/lib/module/useGlobalStore.d.ts +3 -0
- package/lib/typescript/lib/module/useGlobalStore.d.ts.map +1 -0
- package/lib/typescript/src/AssentifyProvider.d.ts +3 -0
- package/lib/typescript/src/AssentifyProvider.d.ts.map +1 -1
- package/lib/typescript/src/AssentifyWrapper.d.ts +1 -0
- package/lib/typescript/src/AssentifyWrapper.d.ts.map +1 -1
- package/lib/typescript/src/components/BackButton.d.ts +7 -0
- package/lib/typescript/src/components/BackButton.d.ts.map +1 -0
- package/lib/typescript/src/components/BaseButton.d.ts +8 -0
- package/lib/typescript/src/components/BaseButton.d.ts.map +1 -0
- package/lib/typescript/src/components/BaseIcon.d.ts +45 -0
- package/lib/typescript/src/components/BaseIcon.d.ts.map +1 -0
- package/lib/typescript/src/components/CloseButton.d.ts +7 -0
- package/lib/typescript/src/components/CloseButton.d.ts.map +1 -0
- package/lib/typescript/src/components/CustomHeader.d.ts +12 -0
- package/lib/typescript/src/components/CustomHeader.d.ts.map +1 -0
- package/lib/typescript/src/components/Each.d.ts +8 -0
- package/lib/typescript/src/components/Each.d.ts.map +1 -0
- package/lib/typescript/src/components/Page.d.ts +17 -0
- package/lib/typescript/src/components/Page.d.ts.map +1 -0
- package/lib/typescript/src/components/icons/arrow-left.d.ts +4 -0
- package/lib/typescript/src/components/icons/arrow-left.d.ts.map +1 -0
- package/lib/typescript/src/components/icons/big-warning.d.ts +4 -0
- package/lib/typescript/src/components/icons/big-warning.d.ts.map +1 -0
- package/lib/typescript/src/components/icons/check-success.d.ts +4 -0
- package/lib/typescript/src/components/icons/check-success.d.ts.map +1 -0
- package/lib/typescript/src/components/icons/chevron-down.d.ts +4 -0
- package/lib/typescript/src/components/icons/chevron-down.d.ts.map +1 -0
- package/lib/typescript/src/components/icons/chevron-left.d.ts +4 -0
- package/lib/typescript/src/components/icons/chevron-left.d.ts.map +1 -0
- package/lib/typescript/src/components/icons/chevron-right.d.ts +4 -0
- package/lib/typescript/src/components/icons/chevron-right.d.ts.map +1 -0
- package/lib/typescript/src/components/icons/chevron-up.d.ts +4 -0
- package/lib/typescript/src/components/icons/chevron-up.d.ts.map +1 -0
- package/lib/typescript/src/components/icons/close.d.ts +4 -0
- package/lib/typescript/src/components/icons/close.d.ts.map +1 -0
- package/lib/typescript/src/components/type.d.ts +3 -0
- package/lib/typescript/src/components/type.d.ts.map +1 -0
- package/lib/typescript/src/helpers/NavigationService.d.ts +29 -0
- package/lib/typescript/src/helpers/NavigationService.d.ts.map +1 -0
- package/lib/typescript/src/helpers/constants.d.ts +10 -0
- package/lib/typescript/src/helpers/constants.d.ts.map +1 -0
- package/lib/typescript/src/helpers/useBackHandler.d.ts +2 -0
- package/lib/typescript/src/helpers/useBackHandler.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/navigator/index.d.ts +4 -0
- package/lib/typescript/src/navigator/index.d.ts.map +1 -0
- package/lib/typescript/src/screens/SelectDocument.d.ts +5 -0
- package/lib/typescript/src/screens/SelectDocument.d.ts.map +1 -0
- package/lib/typescript/src/themes/index.d.ts +16 -0
- package/lib/typescript/src/themes/index.d.ts.map +1 -0
- package/lib/typescript/src/themes/styling.d.ts +7 -0
- package/lib/typescript/src/themes/styling.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +2 -0
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/useGlobalStore.d.ts +25 -0
- package/lib/typescript/src/useGlobalStore.d.ts.map +1 -0
- package/package.json +1 -2
- package/src/AssentifyProvider.tsx +59 -5
- package/src/AssentifyWrapper.ts +29 -71
- package/src/components/BackButton.tsx +28 -0
- package/src/components/BaseButton.tsx +44 -0
- package/src/components/BaseIcon.tsx +96 -0
- package/src/components/CloseButton.tsx +28 -0
- package/src/components/CustomHeader.tsx +58 -0
- package/src/components/Each.tsx +12 -0
- package/src/components/Page.tsx +64 -0
- package/src/components/icons/arrow-left.tsx +22 -0
- package/src/components/icons/big-warning.tsx +29 -0
- package/src/components/icons/check-success.tsx +22 -0
- package/src/components/icons/chevron-down.tsx +22 -0
- package/src/components/icons/chevron-left.tsx +22 -0
- package/src/components/icons/chevron-right.tsx +22 -0
- package/src/components/icons/chevron-up.tsx +22 -0
- package/src/components/icons/close.tsx +22 -0
- package/src/components/type.ts +11 -0
- package/src/helpers/NavigationService.ts +89 -0
- package/src/helpers/constants.ts +13 -0
- package/src/helpers/useBackHandler.ts +14 -0
- package/src/navigator/index.tsx +34 -0
- package/src/screens/SelectDocument.tsx +250 -0
- package/src/themes/index.ts +16 -0
- package/src/themes/styling.ts +53 -0
- package/src/types.ts +3 -0
- package/src/useGlobalStore.ts +65 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Svg, { Path, type SvgProps } from 'react-native-svg';
|
|
3
|
+
|
|
4
|
+
const ChevronLeftIcon: React.FC = (props: SvgProps) => (
|
|
5
|
+
<Svg
|
|
6
|
+
width={24}
|
|
7
|
+
height={24}
|
|
8
|
+
viewBox="0 0 24 24"
|
|
9
|
+
fill="none"
|
|
10
|
+
// @ts-ignore
|
|
11
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12
|
+
{...props}
|
|
13
|
+
>
|
|
14
|
+
<Path
|
|
15
|
+
fillRule="evenodd"
|
|
16
|
+
clipRule="evenodd"
|
|
17
|
+
d="M15.5303 5.46967C15.8232 5.76256 15.8232 6.23744 15.5303 6.53033L10.0607 12L15.5303 17.4697C15.8232 17.7626 15.8232 18.2374 15.5303 18.5303C15.2374 18.8232 14.7626 18.8232 14.4697 18.5303L8.46967 12.5303C8.17678 12.2374 8.17678 11.7626 8.46967 11.4697L14.4697 5.46967C14.7626 5.17678 15.2374 5.17678 15.5303 5.46967Z"
|
|
18
|
+
fill={props.color}
|
|
19
|
+
/>
|
|
20
|
+
</Svg>
|
|
21
|
+
);
|
|
22
|
+
export default ChevronLeftIcon;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Svg, { Path, type SvgProps } from 'react-native-svg';
|
|
3
|
+
|
|
4
|
+
const ChevronRightIcon: React.FC = (props: SvgProps) => (
|
|
5
|
+
<Svg
|
|
6
|
+
width={24}
|
|
7
|
+
height={24}
|
|
8
|
+
viewBox="0 0 24 24"
|
|
9
|
+
fill="none"
|
|
10
|
+
// @ts-ignore
|
|
11
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12
|
+
{...props}
|
|
13
|
+
>
|
|
14
|
+
<Path
|
|
15
|
+
fillRule="evenodd"
|
|
16
|
+
clipRule="evenodd"
|
|
17
|
+
d="M8.46967 18.5303C8.17678 18.2374 8.17678 17.7626 8.46967 17.4697L13.9393 12L8.46967 6.53033C8.17678 6.23744 8.17678 5.76256 8.46967 5.46967C8.76256 5.17678 9.23744 5.17678 9.53033 5.46967L15.5303 11.4697C15.8232 11.7626 15.8232 12.2374 15.5303 12.5303L9.53033 18.5303C9.23744 18.8232 8.76256 18.8232 8.46967 18.5303Z"
|
|
18
|
+
fill={props.color}
|
|
19
|
+
/>
|
|
20
|
+
</Svg>
|
|
21
|
+
);
|
|
22
|
+
export default ChevronRightIcon;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import Svg, { Path, type SvgProps } from 'react-native-svg';
|
|
3
|
+
|
|
4
|
+
const ChevronUpIcon: React.FC = (props: SvgProps) => (
|
|
5
|
+
<Svg
|
|
6
|
+
width={24}
|
|
7
|
+
height={24}
|
|
8
|
+
viewBox="0 0 24 24"
|
|
9
|
+
fill="none"
|
|
10
|
+
// @ts-ignore
|
|
11
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12
|
+
{...props}
|
|
13
|
+
>
|
|
14
|
+
<Path
|
|
15
|
+
fillRule="evenodd"
|
|
16
|
+
clipRule="evenodd"
|
|
17
|
+
d="M18.5303 15.5303C18.2374 15.8232 17.7626 15.8232 17.4697 15.5303L12 10.0607L6.53033 15.5303C6.23744 15.8232 5.76256 15.8232 5.46967 15.5303C5.17678 15.2374 5.17678 14.7626 5.46967 14.4697L11.4697 8.46967C11.7626 8.17678 12.2374 8.17678 12.5303 8.46967L18.5303 14.4697C18.8232 14.7626 18.8232 15.2374 18.5303 15.5303Z"
|
|
18
|
+
fill={props.color}
|
|
19
|
+
/>
|
|
20
|
+
</Svg>
|
|
21
|
+
);
|
|
22
|
+
export default ChevronUpIcon;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Svg, { Path, type SvgProps } from 'react-native-svg';
|
|
3
|
+
|
|
4
|
+
const CloseIcon: React.FC = (props: SvgProps) => (
|
|
5
|
+
<Svg
|
|
6
|
+
width={24}
|
|
7
|
+
height={24}
|
|
8
|
+
viewBox="0 0 24 24"
|
|
9
|
+
fill="none"
|
|
10
|
+
// @ts-ignore
|
|
11
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12
|
+
{...props}
|
|
13
|
+
>
|
|
14
|
+
<Path
|
|
15
|
+
fillRule="evenodd"
|
|
16
|
+
clipRule="evenodd"
|
|
17
|
+
d="M6.22772 6.22662C6.52064 5.93376 6.99551 5.9338 7.28838 6.22672L12.0001 10.9393L16.7137 6.22662C17.0066 5.93376 17.4815 5.9338 17.7744 6.22672C18.0672 6.51965 18.0672 6.99452 17.7743 7.28738L13.0612 11.9996L17.7743 16.7127C18.0672 17.0056 18.0672 17.4804 17.7743 17.7733C17.4814 18.0662 17.0066 18.0662 16.7137 17.7733L12.001 13.0607L7.28833 17.7733C6.99543 18.0662 6.52056 18.0662 6.22767 17.7733C5.93477 17.4804 5.93477 17.0056 6.22767 16.7127L10.9399 12.0005L6.22761 7.28728C5.93475 6.99436 5.93479 6.51949 6.22772 6.22662Z"
|
|
18
|
+
fill={props.color}
|
|
19
|
+
/>
|
|
20
|
+
</Svg>
|
|
21
|
+
);
|
|
22
|
+
export default CloseIcon;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import {
|
|
2
|
+
StackActions,
|
|
3
|
+
CommonActions,
|
|
4
|
+
type NavigationContainerRef,
|
|
5
|
+
} from '@react-navigation/native';
|
|
6
|
+
|
|
7
|
+
let _navigator: NavigationContainerRef<any>;
|
|
8
|
+
let currentRoute = 'Profile';
|
|
9
|
+
|
|
10
|
+
function setTopLevelNavigator(navigatorRef?: NavigationContainerRef<any>) {
|
|
11
|
+
_navigator = navigatorRef!;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function navigate(routeName: string, params?: any) {
|
|
15
|
+
_navigator.navigate(routeName, params);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function replace(routeName: string, params?: any) {
|
|
19
|
+
_navigator.dispatch(StackActions.replace(routeName, params));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function push(routeName: string, params?: any) {
|
|
23
|
+
_navigator.dispatch(StackActions.push(routeName, params));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function pop(number = 1) {
|
|
27
|
+
_navigator.dispatch(StackActions.pop(number));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function popToTop() {
|
|
31
|
+
_navigator.dispatch(StackActions.popToTop());
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function goBack() {
|
|
35
|
+
_navigator.goBack();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function canGoBack() {
|
|
39
|
+
return _navigator.canGoBack();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function getNavigator() {
|
|
43
|
+
return _navigator;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function reset(routeName: string) {
|
|
47
|
+
// _navigator.dispatch(
|
|
48
|
+
// StackActions.reset({
|
|
49
|
+
// index: 0,
|
|
50
|
+
// actions: [NavigationActions.navigate({ routeName })],
|
|
51
|
+
// }),
|
|
52
|
+
// );
|
|
53
|
+
|
|
54
|
+
const resetAction = CommonActions.reset({
|
|
55
|
+
index: 0,
|
|
56
|
+
routes: [{ name: routeName }],
|
|
57
|
+
});
|
|
58
|
+
_navigator.dispatch(resetAction);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function setCurrentRoute(route: string) {
|
|
62
|
+
currentRoute = route;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function getCurrentRoute() {
|
|
66
|
+
return currentRoute;
|
|
67
|
+
// let route = _navigator.state.nav;
|
|
68
|
+
// while (route.routes) {
|
|
69
|
+
// route = route.routes[route.index];
|
|
70
|
+
// }
|
|
71
|
+
// return route.routeName;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// add other navigation functions that you need and export them
|
|
75
|
+
|
|
76
|
+
export default {
|
|
77
|
+
replace,
|
|
78
|
+
push,
|
|
79
|
+
pop,
|
|
80
|
+
setTopLevelNavigator,
|
|
81
|
+
setCurrentRoute,
|
|
82
|
+
getCurrentRoute,
|
|
83
|
+
getNavigator,
|
|
84
|
+
navigate,
|
|
85
|
+
reset,
|
|
86
|
+
popToTop,
|
|
87
|
+
goBack,
|
|
88
|
+
canGoBack,
|
|
89
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useFocusEffect } from '@react-navigation/native';
|
|
2
|
+
import { useCallback } from 'react';
|
|
3
|
+
import { BackHandler } from 'react-native';
|
|
4
|
+
|
|
5
|
+
export function useBackHandler(handler: () => boolean) {
|
|
6
|
+
useFocusEffect(
|
|
7
|
+
useCallback(() => {
|
|
8
|
+
BackHandler.addEventListener('hardwareBackPress', handler);
|
|
9
|
+
|
|
10
|
+
return () =>
|
|
11
|
+
BackHandler.removeEventListener('hardwareBackPress', handler);
|
|
12
|
+
}, [handler])
|
|
13
|
+
);
|
|
14
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { NavigationContainer, type NavigationContainerRef } from '@react-navigation/native';
|
|
4
|
+
import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
|
5
|
+
import NavigationService from '../helpers/NavigationService';
|
|
6
|
+
import { PAGES } from '../helpers/constants';
|
|
7
|
+
import SelectDocument from '../screens/SelectDocument';
|
|
8
|
+
|
|
9
|
+
const Stack = createNativeStackNavigator();
|
|
10
|
+
|
|
11
|
+
const EmptyScreen = () => null;
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
const AssentifyNavigator = () => {
|
|
16
|
+
const navigationRef = React.useRef<NavigationContainerRef<any> | null>(null);
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<NavigationContainer
|
|
20
|
+
independent
|
|
21
|
+
ref={navigationRef}
|
|
22
|
+
onReady={() => {
|
|
23
|
+
NavigationService.setTopLevelNavigator(navigationRef.current!);
|
|
24
|
+
}}
|
|
25
|
+
>
|
|
26
|
+
<Stack.Navigator>
|
|
27
|
+
<Stack.Screen name={PAGES.SELECT_DOCUMENT} component={SelectDocument} />
|
|
28
|
+
</Stack.Navigator>
|
|
29
|
+
</NavigationContainer>
|
|
30
|
+
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export default AssentifyNavigator;
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { NativeModules,StyleSheet, Text, TouchableOpacity, View, FlatList } from 'react-native';
|
|
2
|
+
import React, { useEffect, useState } from 'react';
|
|
3
|
+
import { type TemplatesByCountry, type Templates ,type KycDocumentDetails } from '../types';
|
|
4
|
+
import { fontPixel, pixelSizeHorizontal, pixelSizeVertical } from '../themes/styling';
|
|
5
|
+
import { COLORS } from '../themes';
|
|
6
|
+
import BaseIcon from '../components/BaseIcon';
|
|
7
|
+
import Page from '../components/Page';
|
|
8
|
+
import CloseButton from '../components/CloseButton';
|
|
9
|
+
import { DOC_TYPE, PAGES } from '../helpers/constants';
|
|
10
|
+
import useGlobalStore from '../useGlobalStore';
|
|
11
|
+
import Each from '../components/Each';
|
|
12
|
+
import NavigationService from '../helpers/NavigationService';
|
|
13
|
+
import { useBackHandler } from '../helpers/useBackHandler';
|
|
14
|
+
import { Image } from 'react-native';
|
|
15
|
+
import { kycDocumentDetailsSize,bottomSheetModalRef } from '../AssentifyProvider';
|
|
16
|
+
import AssentifyWrapper from '../AssentifyWrapper';
|
|
17
|
+
import type { CountryCode } from 'react-native-country-picker-modal';
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
type Props = {};
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
const SelectDocument: React.FC<Props> = () => {
|
|
25
|
+
const {
|
|
26
|
+
supportedTemplates,
|
|
27
|
+
languageCode,
|
|
28
|
+
supportedCountries,
|
|
29
|
+
preferredCountry,
|
|
30
|
+
countryCode,
|
|
31
|
+
setCountryCode,
|
|
32
|
+
setSupportedTemplates,
|
|
33
|
+
setKYCDocumentDetails,
|
|
34
|
+
setDocType,
|
|
35
|
+
setIsVisible,
|
|
36
|
+
} = useGlobalStore();
|
|
37
|
+
const [isOpenModal, setIsOpenModal] = useState<boolean>(false);
|
|
38
|
+
const [selectedCountry, setSelectedCountry] = useState<TemplatesByCountry | null>(null);
|
|
39
|
+
useBackHandler(() => {
|
|
40
|
+
onClose();
|
|
41
|
+
return false;
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
const onClose = () => {
|
|
45
|
+
setCountryCode(null);
|
|
46
|
+
setDocType(null);
|
|
47
|
+
setIsVisible(false);
|
|
48
|
+
bottomSheetModalRef.current?.dismiss();
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const onScanId = (kycDocumentDetailsList?: KycDocumentDetails[]) => {
|
|
52
|
+
kycDocumentDetailsSize.current = kycDocumentDetailsList?.length ?? 0;
|
|
53
|
+
AssentifyWrapper.startScanIDCard(kycDocumentDetailsList ?? [], languageCode, true);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const onScanPassport = () => {
|
|
57
|
+
console.log("ExampleEvents : ", languageCode);
|
|
58
|
+
AssentifyWrapper.startScanPassport(languageCode);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
const onSelect = (country: TemplatesByCountry) => {
|
|
63
|
+
setCountryCode(country.sourceCountryCode as CountryCode);
|
|
64
|
+
setSelectedCountry(country);
|
|
65
|
+
setIsOpenModal(false);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const onOpen = () => {
|
|
69
|
+
setIsOpenModal(true);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
if (supportedCountries) {
|
|
74
|
+
const codeToUse = (countryCode ?? '') || supportedCountries[0]?.sourceCountryCode;
|
|
75
|
+
const selected = supportedCountries.find(
|
|
76
|
+
(item) => item.sourceCountryCode === codeToUse
|
|
77
|
+
);
|
|
78
|
+
if (selected) {
|
|
79
|
+
const templates = selected.templates;
|
|
80
|
+
const kycDetails: Templates[] = [];
|
|
81
|
+
templates.forEach((item) => {
|
|
82
|
+
if (item.kycDocumentDetails && item.kycDocumentDetails.length) {
|
|
83
|
+
kycDetails.push(item);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
setSupportedTemplates(kycDetails);
|
|
87
|
+
setSelectedCountry(selected);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}, [countryCode, setSupportedTemplates, supportedCountries]);
|
|
91
|
+
|
|
92
|
+
return (
|
|
93
|
+
<Page scrollViewStyle={styles.ScrollView} headerLeft={<CloseButton onPress={onClose} />}>
|
|
94
|
+
<View style={styles.container}>
|
|
95
|
+
<Text style={styles.CardTitle}>Select Document</Text>
|
|
96
|
+
{preferredCountry && (
|
|
97
|
+
<TouchableOpacity style={styles.DropdownSelect} onPress={onOpen}>
|
|
98
|
+
{selectedCountry ? (
|
|
99
|
+
<View style={styles.selectedCountryContainer}>
|
|
100
|
+
<Image source={{ uri: selectedCountry.flag }} style={[styles.flag, { width: 30, height: undefined, aspectRatio: 1 }]} />
|
|
101
|
+
<Text style={styles.DropdownTitle}>{selectedCountry.name}</Text>
|
|
102
|
+
</View>
|
|
103
|
+
) : (
|
|
104
|
+
<Text style={styles.DropdownTitle}>Select Country</Text>
|
|
105
|
+
)}
|
|
106
|
+
<BaseIcon name="chevron_down" color={COLORS.secondary800} />
|
|
107
|
+
</TouchableOpacity>
|
|
108
|
+
)}
|
|
109
|
+
</View>
|
|
110
|
+
{isOpenModal && (
|
|
111
|
+
<View style={styles.dropdownModal}>
|
|
112
|
+
<FlatList
|
|
113
|
+
data={supportedCountries}
|
|
114
|
+
renderItem={({ item }) => (
|
|
115
|
+
<TouchableOpacity
|
|
116
|
+
style={styles.dropdownItem}
|
|
117
|
+
onPress={() => onSelect(item)}
|
|
118
|
+
>
|
|
119
|
+
<Image source={{ uri: item.flag }} style={styles.flag} />
|
|
120
|
+
<Text style={styles.DropdownTitle}>{item.name}</Text>
|
|
121
|
+
</TouchableOpacity>
|
|
122
|
+
)}
|
|
123
|
+
keyExtractor={(item) => item.sourceCountryCode}
|
|
124
|
+
/>
|
|
125
|
+
</View>
|
|
126
|
+
)}
|
|
127
|
+
<View style={styles.Card}>
|
|
128
|
+
<Text style={styles.CardTitle}>Select document type</Text>
|
|
129
|
+
<View style={styles.CardContent}>
|
|
130
|
+
<TouchableOpacity
|
|
131
|
+
style={[styles.CardItem, supportedTemplates?.length ? styles.CardItemBordered : null]}
|
|
132
|
+
onPress={() => onScanPassport()}
|
|
133
|
+
>
|
|
134
|
+
<Text style={styles.CardItemText}>Passport</Text>
|
|
135
|
+
<BaseIcon name="chevron_right" color={COLORS.secondary800} />
|
|
136
|
+
</TouchableOpacity>
|
|
137
|
+
{supportedTemplates && (
|
|
138
|
+
<Each
|
|
139
|
+
of={supportedTemplates}
|
|
140
|
+
render={(item, index) => (
|
|
141
|
+
<TouchableOpacity
|
|
142
|
+
key={`supported_template_${index}`}
|
|
143
|
+
style={[
|
|
144
|
+
styles.CardItem,
|
|
145
|
+
index !== supportedTemplates.length - 1 ? styles.CardItemBordered : null,
|
|
146
|
+
]}
|
|
147
|
+
onPress={() => onScanId(item.kycDocumentDetails)}
|
|
148
|
+
>
|
|
149
|
+
<Text style={styles.CardItemText}>{item?.kycDocumentType}</Text>
|
|
150
|
+
<BaseIcon name="chevron_right" color={COLORS.secondary800} />
|
|
151
|
+
</TouchableOpacity>
|
|
152
|
+
)}
|
|
153
|
+
/>
|
|
154
|
+
)}
|
|
155
|
+
</View>
|
|
156
|
+
</View>
|
|
157
|
+
</Page>
|
|
158
|
+
);
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export default SelectDocument;
|
|
162
|
+
|
|
163
|
+
const styles = StyleSheet.create({
|
|
164
|
+
ScrollView: {
|
|
165
|
+
flex: 1,
|
|
166
|
+
backgroundColor: '#fff',
|
|
167
|
+
paddingHorizontal: pixelSizeHorizontal(16),
|
|
168
|
+
},
|
|
169
|
+
container: {
|
|
170
|
+
marginTop: pixelSizeVertical(40),
|
|
171
|
+
},
|
|
172
|
+
Card: {
|
|
173
|
+
flex: 1,
|
|
174
|
+
marginVertical: pixelSizeVertical(16),
|
|
175
|
+
},
|
|
176
|
+
CardTitle: {
|
|
177
|
+
fontSize: fontPixel(14),
|
|
178
|
+
fontWeight: '600',
|
|
179
|
+
lineHeight: 20,
|
|
180
|
+
color: COLORS.secondary1200,
|
|
181
|
+
marginBottom: pixelSizeVertical(8),
|
|
182
|
+
},
|
|
183
|
+
CardContent: {
|
|
184
|
+
borderWidth: 1,
|
|
185
|
+
borderColor: COLORS.secondary300,
|
|
186
|
+
borderRadius: 16,
|
|
187
|
+
},
|
|
188
|
+
CardItem: {
|
|
189
|
+
flexDirection: 'row',
|
|
190
|
+
alignItems: 'center',
|
|
191
|
+
justifyContent: 'space-between',
|
|
192
|
+
paddingLeft: pixelSizeHorizontal(24),
|
|
193
|
+
paddingRight: pixelSizeHorizontal(12),
|
|
194
|
+
paddingVertical: pixelSizeVertical(16),
|
|
195
|
+
},
|
|
196
|
+
CardItemBordered: {
|
|
197
|
+
borderBottomWidth: 1,
|
|
198
|
+
borderBottomColor: COLORS.secondary300,
|
|
199
|
+
},
|
|
200
|
+
CardItemText: {
|
|
201
|
+
fontSize: fontPixel(14),
|
|
202
|
+
fontWeight: '600',
|
|
203
|
+
lineHeight: 20,
|
|
204
|
+
color: COLORS.secondaryBase1,
|
|
205
|
+
},
|
|
206
|
+
DropdownSelect: {
|
|
207
|
+
borderWidth: 1,
|
|
208
|
+
borderColor: COLORS.secondary300,
|
|
209
|
+
borderRadius: 16,
|
|
210
|
+
flexDirection: 'row',
|
|
211
|
+
alignItems: 'center',
|
|
212
|
+
justifyContent: 'space-between',
|
|
213
|
+
paddingVertical: pixelSizeVertical(10),
|
|
214
|
+
paddingHorizontal: pixelSizeVertical(16),
|
|
215
|
+
},
|
|
216
|
+
DropdownTitle: {
|
|
217
|
+
fontSize: fontPixel(14),
|
|
218
|
+
fontWeight: '500',
|
|
219
|
+
lineHeight: 20,
|
|
220
|
+
color: COLORS.secondaryBase1,
|
|
221
|
+
},
|
|
222
|
+
selectedCountryContainer: {
|
|
223
|
+
flexDirection: 'row',
|
|
224
|
+
alignItems: 'center',
|
|
225
|
+
},
|
|
226
|
+
flag: {
|
|
227
|
+
width: 24,
|
|
228
|
+
height: 24,
|
|
229
|
+
marginRight: pixelSizeHorizontal(8),
|
|
230
|
+
},
|
|
231
|
+
dropdownModal: {
|
|
232
|
+
backgroundColor: 'white',
|
|
233
|
+
borderRadius: 16,
|
|
234
|
+
marginTop: pixelSizeVertical(8),
|
|
235
|
+
position: 'absolute',
|
|
236
|
+
top: 80, // Adjust depending on your layout
|
|
237
|
+
left: 16,
|
|
238
|
+
right: 16,
|
|
239
|
+
maxHeight: 300,
|
|
240
|
+
borderWidth: 1,
|
|
241
|
+
borderColor: COLORS.secondary300,
|
|
242
|
+
zIndex: 1000,
|
|
243
|
+
},
|
|
244
|
+
dropdownItem: {
|
|
245
|
+
flexDirection: 'row',
|
|
246
|
+
alignItems: 'center',
|
|
247
|
+
paddingVertical: pixelSizeVertical(12),
|
|
248
|
+
paddingHorizontal: pixelSizeHorizontal(16),
|
|
249
|
+
},
|
|
250
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const COLORS = {
|
|
2
|
+
white: '#ffffff',
|
|
3
|
+
primaryBase1: '#66023C',
|
|
4
|
+
|
|
5
|
+
secondaryBase1: '#44546A',
|
|
6
|
+
secondary100: '#F9FAFB',
|
|
7
|
+
secondary200: '#EEF1F6',
|
|
8
|
+
secondary300: '#DBE0E9',
|
|
9
|
+
secondary700: '#808E9E',
|
|
10
|
+
secondary800: '#6C7B8E',
|
|
11
|
+
secondary1200: '#2C3844',
|
|
12
|
+
grey100: '#F9FAFA',
|
|
13
|
+
grey300: '#DCDEE1',
|
|
14
|
+
grey600: '#9AA0A7',
|
|
15
|
+
grey800: '#76797E',
|
|
16
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Dimensions, PixelRatio, Platform } from 'react-native';
|
|
2
|
+
|
|
3
|
+
const { width: SCREEN_WIDTH, height: SCREEN_HEIGHT } = Dimensions.get('window');
|
|
4
|
+
// const ratio = PixelRatio.get();
|
|
5
|
+
|
|
6
|
+
// Use iPhone5 as base size which is 320 x 568
|
|
7
|
+
// const baseWidth = 320;
|
|
8
|
+
// const baseHeight = 568;
|
|
9
|
+
|
|
10
|
+
// Use iPhone6 as base size which is 375 x 667
|
|
11
|
+
const baseWidth = 375;
|
|
12
|
+
const baseHeight = 667;
|
|
13
|
+
|
|
14
|
+
// const baseWidth = 375;
|
|
15
|
+
// const baseHeight = 811;
|
|
16
|
+
|
|
17
|
+
const scaleWidth = SCREEN_WIDTH / baseWidth;
|
|
18
|
+
const scaleHeight = SCREEN_HEIGHT / baseHeight;
|
|
19
|
+
const scale = Math.min(scaleWidth, scaleHeight);
|
|
20
|
+
|
|
21
|
+
export const normalize = (
|
|
22
|
+
size: number,
|
|
23
|
+
based: 'width' | 'height' = 'width'
|
|
24
|
+
) => {
|
|
25
|
+
// const newSize = size * scale;
|
|
26
|
+
const newSize = based === 'height' ? size * scale : size * scale;
|
|
27
|
+
if (Platform.OS === 'ios') {
|
|
28
|
+
return Math.round(PixelRatio.roundToNearestPixel(newSize));
|
|
29
|
+
} else {
|
|
30
|
+
return Math.round(PixelRatio.roundToNearestPixel(newSize)) - 2;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
//for width pixel
|
|
35
|
+
export const widthPixel = (size: number) => {
|
|
36
|
+
return normalize(size, 'width');
|
|
37
|
+
};
|
|
38
|
+
//for height pixel
|
|
39
|
+
export const heightPixel = (size: number) => {
|
|
40
|
+
return normalize(size, 'height');
|
|
41
|
+
};
|
|
42
|
+
//for font pixel
|
|
43
|
+
export const fontPixel = (size: number) => {
|
|
44
|
+
return heightPixel(size);
|
|
45
|
+
};
|
|
46
|
+
//for Margin and Padding vertical pixel
|
|
47
|
+
export const pixelSizeVertical = (size: number) => {
|
|
48
|
+
return heightPixel(size);
|
|
49
|
+
};
|
|
50
|
+
//for Margin and Padding horizontal pixel
|
|
51
|
+
export const pixelSizeHorizontal = (size: number) => {
|
|
52
|
+
return widthPixel(size);
|
|
53
|
+
};
|
package/src/types.ts
CHANGED
|
@@ -52,6 +52,8 @@ export interface Assentify {
|
|
|
52
52
|
|
|
53
53
|
submitData:(dataMap: Map<string, string>)=> void;
|
|
54
54
|
|
|
55
|
+
startFlow:()=> void;
|
|
56
|
+
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
export type MrzFields = {
|
|
@@ -156,6 +158,7 @@ export type FaceMatchCallback = {
|
|
|
156
158
|
export type KycDocumentDetails = {
|
|
157
159
|
name: string;
|
|
158
160
|
order: number;
|
|
161
|
+
templateSpecimen:String;
|
|
159
162
|
templateProcessingKeyInformation: string;
|
|
160
163
|
};
|
|
161
164
|
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
FaceExtractedModel,
|
|
3
|
+
IDExtractedModel,
|
|
4
|
+
KycDocumentDetails,
|
|
5
|
+
OtherExtractedModel,
|
|
6
|
+
PassportExtractedModel,
|
|
7
|
+
Templates,
|
|
8
|
+
TemplatesByCountry,
|
|
9
|
+
} from './types';
|
|
10
|
+
import { create } from 'zustand';
|
|
11
|
+
import type { CountryCode } from 'react-native-country-picker-modal';
|
|
12
|
+
import { type LanguageCode } from './Language';
|
|
13
|
+
|
|
14
|
+
type GlobalStoreState = {
|
|
15
|
+
countryCode: CountryCode | null;
|
|
16
|
+
languageCode: LanguageCode;
|
|
17
|
+
preferredCountry: CountryCode[] | string[];
|
|
18
|
+
supportedCountries: TemplatesByCountry[];
|
|
19
|
+
supportedTemplates: Templates[];
|
|
20
|
+
kycDocumentDetails: KycDocumentDetails[] | null;
|
|
21
|
+
docType: string | null;
|
|
22
|
+
isVisible: boolean;
|
|
23
|
+
|
|
24
|
+
setCountryCode: (countryCode: CountryCode | null) => void;
|
|
25
|
+
setFlowLanguage: (languageCode: LanguageCode | null) => void;
|
|
26
|
+
setPreferredCountry: (preferredCountry: CountryCode[]) => void;
|
|
27
|
+
setSupportedCountries: (supportedCountries: TemplatesByCountry[]) => void;
|
|
28
|
+
setSupportedTemplates: (supportedTemplates: Templates[]) => void;
|
|
29
|
+
setKYCDocumentDetails: (
|
|
30
|
+
kycDocumentDetails: KycDocumentDetails[] | null
|
|
31
|
+
) => void;
|
|
32
|
+
setDocType: (docType: string | null) => void;
|
|
33
|
+
setIsVisible: (isVisible: boolean) => void;
|
|
34
|
+
clearGlobalStore: () => void;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const persistState = {
|
|
38
|
+
countryCode: '' as CountryCode,
|
|
39
|
+
languageCode: '' as LanguageCode,
|
|
40
|
+
preferredCountry: [],
|
|
41
|
+
supportedCountries: [],
|
|
42
|
+
supportedTemplates: [],
|
|
43
|
+
kycDocumentDetails: [],
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const initialState = {
|
|
47
|
+
docType: null,
|
|
48
|
+
isVisible: false,
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const useGlobalStore = create<GlobalStoreState>()((set) => ({
|
|
52
|
+
...initialState,
|
|
53
|
+
...persistState,
|
|
54
|
+
setCountryCode: (countryCode: CountryCode | null) => set({ countryCode: countryCode as any }),
|
|
55
|
+
setFlowLanguage: (languageCode: LanguageCode | null) => set({ languageCode: languageCode as any }),
|
|
56
|
+
setPreferredCountry: (preferredCountry: CountryCode[]) =>set({ preferredCountry }),
|
|
57
|
+
setSupportedCountries: (supportedCountries: TemplatesByCountry[]) => set({ supportedCountries }),
|
|
58
|
+
setSupportedTemplates: (supportedTemplates: Templates[]) =>set({ supportedTemplates }),
|
|
59
|
+
setKYCDocumentDetails: (kycDocumentDetails: KycDocumentDetails[] | null) =>set({ kycDocumentDetails }),
|
|
60
|
+
setDocType: (docType: string | null) => set({ docType }),
|
|
61
|
+
setIsVisible: (isVisible: boolean) => set({ isVisible }),
|
|
62
|
+
clearGlobalStore: () => set({ ...initialState }),
|
|
63
|
+
}));
|
|
64
|
+
|
|
65
|
+
export default useGlobalStore;
|