tweak types

This commit is contained in:
Hailey
2024-10-01 16:20:42 -07:00
parent 368a9df8a2
commit a4c7e2f393
4 changed files with 11 additions and 12 deletions
+5 -8
View File
@@ -1,6 +1,6 @@
import React from 'react'
import {StyleProp, View, ViewStyle} from 'react-native'
import {} from 'react-native-gesture-handler'
import {BlueskyBottomSheetPressable as Pressable} from '@haileyok/bluesky-bottom-sheet'
import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react'
import flattenReactChildren from 'react-keyed-flatten-children'
@@ -103,7 +103,7 @@ export function Outer({
export function Item({children, label, style, onPress, ...rest}: ItemProps) {
const t = useTheme()
const {control} = React.useContext(Context)
const {state: focused, onIn: onFocus, onOut: onBlur} = useInteractionState()
const {state: focused} = useInteractionState()
const {
state: pressed,
onIn: onPressIn,
@@ -116,14 +116,11 @@ export function Item({children, label, style, onPress, ...rest}: ItemProps) {
accessibilityHint=""
accessibilityLabel={label}
onPress={e => {
control?.close()
onPress(e)
if (!e.defaultPrevented) {
control?.close()
}
}}
onFocus={onFocus}
onBlur={onBlur}
// onFocus={onFocus}
// onBlur={onBlur}
onPressIn={e => {
onPressIn()
rest.onPressIn?.(e)
+4 -2
View File
@@ -4,6 +4,8 @@ import {
GestureResponderEvent,
PressableProps,
} from 'react-native'
import {PressableEvent} from 'react-native-gesture-handler/lib/typescript/components/Pressable/PressableProps'
import {BueskyBottomSheetPressableProps} from '@haileyok/bluesky-bottom-sheet'
import {TextStyleProp, ViewStyleProp} from '#/alf'
import * as Dialog from '#/components/Dialog'
@@ -87,10 +89,10 @@ export type TriggerChildProps =
}
export type ItemProps = React.PropsWithChildren<
Omit<PressableProps, 'style'> &
Omit<BueskyBottomSheetPressableProps, 'style'> &
ViewStyleProp & {
label: string
onPress: (e: GestureResponderEvent) => void
onPress: (e: PressableEvent | GestureResponderEvent) => void
}
>