-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathARTouchableMonoView.js
More file actions
30 lines (30 loc) · 1.08 KB
/
ARTouchableMonoView.js
File metadata and controls
30 lines (30 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { TouchableWithoutFeedback } from "react-native";
import React, { Component } from "react";
import ARMonoView from "./ARMonoView";
import { ARTouchProvider } from "./ARTouchProvider";
const ARTouchableMonoView = props => (
<ARTouchProvider>
{({ triggerAtLocation }) => {
return (
<TouchableWithoutFeedback
onPress={({ nativeEvent: { locationX, locationY } }) => {
if (triggerAtLocation)
triggerAtLocation("onPress", locationX, locationY);
}}
onPressIn={({ nativeEvent: { locationX, locationY } }) => {
if (triggerAtLocation)
triggerAtLocation("onPressIn", locationX, locationY);
}}
onPressOut={({ nativeEvent: { locationX, locationY } }) => {
if (triggerAtLocation)
triggerAtLocation("onPressOut", locationX, locationY);
}}
>
<ARMonoView {...props} />
</TouchableWithoutFeedback>
);
}}
</ARTouchProvider>
);
ARTouchableMonoView.propTypes = ARMonoView.propTypes;
export default ARTouchableMonoView;