mirror of
https://github.com/selfxyz/self.git
synced 2026-04-05 03:00:53 -04:00
Refine app typings and drop type casts (#850)
* Refine typings and drop casts * Fix type references * Remove leftover casts * format * fix types * fix typigns * fix types. revert nfc method selection changes
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
|
||||
|
||||
import React from 'react';
|
||||
import type { ViewStyle } from 'react-native';
|
||||
import type { GestureResponderEvent, ViewStyle } from 'react-native';
|
||||
import { Platform, StyleSheet } from 'react-native';
|
||||
import type { ViewProps } from 'tamagui';
|
||||
import { Button, Text } from 'tamagui';
|
||||
@@ -22,7 +22,7 @@ interface AbstractButtonProps extends ButtonProps {
|
||||
borderColor?: string;
|
||||
borderWidth?: number;
|
||||
color: string;
|
||||
onPress?: ((e: any) => void) | null | undefined;
|
||||
onPress?: ((e: GestureResponderEvent) => void) | null | undefined;
|
||||
}
|
||||
|
||||
const { trackEvent: analyticsTrackEvent } = analytics();
|
||||
@@ -47,7 +47,7 @@ export default function AbstractButton({
|
||||
}: AbstractButtonProps) {
|
||||
const hasBorder = borderColor ? true : false;
|
||||
|
||||
const handlePress = (e: any) => {
|
||||
const handlePress = (e: GestureResponderEvent) => {
|
||||
if (trackEvent) {
|
||||
// attempt to remove event category from click event
|
||||
const parsedEvent = trackEvent?.split(':')?.[1]?.trim();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
|
||||
|
||||
import React, { useCallback } from 'react';
|
||||
import type { NativeSyntheticEvent } from 'react-native';
|
||||
import type { NativeSyntheticEvent, StyleProp, ViewStyle } from 'react-native';
|
||||
import { PixelRatio, Platform, requireNativeComponent } from 'react-native';
|
||||
|
||||
import { extractMRZInfo } from '../../utils/utils';
|
||||
@@ -28,7 +28,7 @@ interface NativePassportOCRViewProps {
|
||||
stackTrace: string;
|
||||
}>,
|
||||
) => void;
|
||||
style?: any; // Or a more specific style type if available
|
||||
style?: StyleProp<ViewStyle>;
|
||||
}
|
||||
|
||||
const RCTPassportOCRViewNativeComponent = Platform.select({
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
|
||||
|
||||
import React, { useCallback } from 'react';
|
||||
import type { NativeSyntheticEvent } from 'react-native';
|
||||
import type { NativeSyntheticEvent, StyleProp, ViewStyle } from 'react-native';
|
||||
import { PixelRatio, Platform, requireNativeComponent } from 'react-native';
|
||||
|
||||
import { RCTFragment } from './RCTFragment';
|
||||
@@ -15,7 +15,7 @@ interface NativeQRCodeScannerViewProps {
|
||||
stackTrace: string;
|
||||
}>,
|
||||
) => void;
|
||||
style?: any; // Or a more specific style type
|
||||
style?: StyleProp<ViewStyle>;
|
||||
}
|
||||
|
||||
const QRCodeNativeComponent = Platform.select({
|
||||
|
||||
Reference in New Issue
Block a user