mirror of
https://github.com/selfxyz/self.git
synced 2026-04-05 03:00:53 -04:00
SEL-56: Setup Yarn Workspaces (#584)
This commit is contained in:
@@ -1,11 +1,8 @@
|
||||
import type { SelfAppDisclosureConfig } from '@selfxyz/common';
|
||||
import { Country3LetterCode, countryCodes } from '@selfxyz/common';
|
||||
import React from 'react';
|
||||
import { XStack, YStack } from 'tamagui';
|
||||
|
||||
import {
|
||||
Country3LetterCode,
|
||||
countryCodes,
|
||||
} from '../../../common/src/constants/constants';
|
||||
import { SelfAppDisclosureConfig } from '../../../common/src/utils/appType';
|
||||
import { BodyText } from '../components/typography/BodyText';
|
||||
import CheckMark from '../images/icons/checkmark.svg';
|
||||
import { slate200, slate500 } from '../utils/colors';
|
||||
|
||||
@@ -7,9 +7,9 @@ import {
|
||||
} from 'react-native';
|
||||
|
||||
import { extractMRZInfo } from '../../utils/utils';
|
||||
import { RCTFragment, RCTFragmentViewManagerProps } from './RCTFragment';
|
||||
import { RCTFragment } from './RCTFragment';
|
||||
|
||||
interface RCTPassportOCRViewManagerProps extends RCTFragmentViewManagerProps {
|
||||
interface NativePassportOCRViewProps {
|
||||
onPassportRead: (
|
||||
event: NativeSyntheticEvent<{
|
||||
data:
|
||||
@@ -23,11 +23,21 @@ interface RCTPassportOCRViewManagerProps extends RCTFragmentViewManagerProps {
|
||||
};
|
||||
}>,
|
||||
) => void;
|
||||
onError: (
|
||||
event: NativeSyntheticEvent<{
|
||||
error: string;
|
||||
errorMessage: string;
|
||||
stackTrace: string;
|
||||
}>,
|
||||
) => void;
|
||||
style?: any; // Or a more specific style type if available
|
||||
}
|
||||
|
||||
const RCTPassportOCRViewNativeComponent = Platform.select({
|
||||
ios: requireNativeComponent('PassportOCRView'),
|
||||
android: requireNativeComponent('PassportOCRViewManager'),
|
||||
ios: requireNativeComponent<NativePassportOCRViewProps>('PassportOCRView'),
|
||||
android: requireNativeComponent<NativePassportOCRViewProps>(
|
||||
'PassportOCRViewManager',
|
||||
),
|
||||
});
|
||||
|
||||
if (!RCTPassportOCRViewNativeComponent) {
|
||||
@@ -111,10 +121,16 @@ export const PassportCamera: React.FC<PassportCameraProps> = ({
|
||||
);
|
||||
} else {
|
||||
// For Android, wrap the native component inside your RCTFragment to preserve existing functionality.
|
||||
const Fragment = RCTFragment as React.FC<RCTPassportOCRViewManagerProps>;
|
||||
const Fragment = RCTFragment as React.FC<
|
||||
React.ComponentProps<typeof RCTFragment> & NativePassportOCRViewProps
|
||||
>;
|
||||
return (
|
||||
<Fragment
|
||||
RCTFragmentViewManager={RCTPassportOCRViewNativeComponent}
|
||||
RCTFragmentViewManager={
|
||||
RCTPassportOCRViewNativeComponent as ReturnType<
|
||||
typeof requireNativeComponent
|
||||
>
|
||||
}
|
||||
fragmentComponentName="PassportOCRViewManager"
|
||||
isMounted={isMounted}
|
||||
style={{
|
||||
|
||||
@@ -6,15 +6,27 @@ import {
|
||||
requireNativeComponent,
|
||||
} from 'react-native';
|
||||
|
||||
import { RCTFragment, RCTFragmentViewManagerProps } from './RCTFragment';
|
||||
import { RCTFragment } from './RCTFragment';
|
||||
|
||||
interface RCTQRCodeScannerViewProps extends RCTFragmentViewManagerProps {
|
||||
interface NativeQRCodeScannerViewProps {
|
||||
onQRData: (event: NativeSyntheticEvent<{ data: string }>) => void;
|
||||
onError: (
|
||||
event: NativeSyntheticEvent<{
|
||||
error: string;
|
||||
errorMessage: string;
|
||||
stackTrace: string;
|
||||
}>,
|
||||
) => void;
|
||||
style?: any; // Or a more specific style type
|
||||
}
|
||||
|
||||
const QRCodeNativeComponent = Platform.select({
|
||||
ios: requireNativeComponent('QRCodeScannerView'),
|
||||
android: requireNativeComponent('QRCodeScannerViewManager'),
|
||||
ios: requireNativeComponent<NativeQRCodeScannerViewProps>(
|
||||
'QRCodeScannerView',
|
||||
),
|
||||
android: requireNativeComponent<NativeQRCodeScannerViewProps>(
|
||||
'QRCodeScannerViewManager',
|
||||
),
|
||||
});
|
||||
|
||||
if (!QRCodeNativeComponent) {
|
||||
@@ -74,10 +86,14 @@ export const QRCodeScannerView: React.FC<QRCodeScannerViewProps> = ({
|
||||
);
|
||||
} else {
|
||||
// For Android, wrap the native component inside your RCTFragment to preserve existing functionality.
|
||||
const Fragment = RCTFragment as React.FC<RCTQRCodeScannerViewProps>;
|
||||
const Fragment = RCTFragment as React.FC<
|
||||
React.ComponentProps<typeof RCTFragment> & NativeQRCodeScannerViewProps
|
||||
>;
|
||||
return (
|
||||
<Fragment
|
||||
RCTFragmentViewManager={QRCodeNativeComponent}
|
||||
RCTFragmentViewManager={
|
||||
QRCodeNativeComponent as ReturnType<typeof requireNativeComponent>
|
||||
}
|
||||
fragmentComponentName="QRCodeScannerViewManager"
|
||||
isMounted={isMounted}
|
||||
style={{
|
||||
|
||||
Reference in New Issue
Block a user