2020-04-30 20:05:59 +00:00
|
|
|
import React, { useContext } from 'react';
|
|
|
|
import Touchable from 'react-native-platform-touchable';
|
|
|
|
|
|
|
|
import MessageContext from './Context';
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
const RCTouchable: any = React.memo(({ children, ...props }: any) => {
|
2020-04-30 20:05:59 +00:00
|
|
|
const { onLongPress } = useContext(MessageContext);
|
|
|
|
|
|
|
|
return (
|
2021-09-13 20:41:05 +00:00
|
|
|
<Touchable onLongPress={onLongPress} {...props}>
|
2020-04-30 20:05:59 +00:00
|
|
|
{children}
|
|
|
|
</Touchable>
|
|
|
|
);
|
|
|
|
});
|
2021-09-13 20:41:05 +00:00
|
|
|
|
|
|
|
// @ts-ignore
|
|
|
|
RCTouchable.Ripple = (...args: any[]) => Touchable.Ripple(...args);
|
2020-04-30 20:05:59 +00:00
|
|
|
RCTouchable.SelectableBackgroundBorderless = () => Touchable.SelectableBackgroundBorderless();
|
|
|
|
|
|
|
|
export default RCTouchable;
|