mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-05-18 00:37:47 +00:00
TouchableWithoutFeedback and TouchableHighlight interfere with the implementation of 'pinch to zoom' to come. We prepare for it by driving the onClick/onPress handler(s) out of Conference, through LargeVideo and ParticipantView into Video itself where the bulk of 'pinch to zoom' will be implemented.
47 lines
1.2 KiB
JavaScript
47 lines
1.2 KiB
JavaScript
// @flow
|
|
|
|
import React, { Component } from 'react';
|
|
import { TouchableWithoutFeedback } from 'react-native';
|
|
|
|
/**
|
|
* The type of the React {@link Component} props of {@link Pressable}.
|
|
*/
|
|
type Props = {
|
|
children: React$Node,
|
|
|
|
/**
|
|
* Called when the touch is released, but not if cancelled (e.g. by a scroll
|
|
* that steals the responder lock).
|
|
*/
|
|
onPress: Function
|
|
};
|
|
|
|
/**
|
|
* Adds support for {@code onPress} to a child React {@link Component} (which
|
|
* should probably not support the prop in question; otherwise, there's little
|
|
* point of using {@code Pressable} then in the first place).
|
|
*/
|
|
export default class Pressable extends Component<Props> {
|
|
/**
|
|
* Implements React's {@link Component#render()}.
|
|
*
|
|
* @inheritdoc
|
|
* @returns {React$Node}
|
|
*/
|
|
render() {
|
|
// onPress
|
|
const { children, onPress } = this.props;
|
|
|
|
if (onPress) {
|
|
return (
|
|
<TouchableWithoutFeedback onPress = { onPress }>
|
|
{ children }
|
|
</TouchableWithoutFeedback>
|
|
);
|
|
}
|
|
|
|
// A Pressable without an onPress is a "no-op".
|
|
return children;
|
|
}
|
|
}
|