summaryrefslogtreecommitdiff
path: root/client/src/lib/components/touchable.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2017-06-05 17:42:51 -0400
committerJules Laplace <julescarbon@gmail.com>2017-06-05 17:42:51 -0400
commit658263c5beac838240a19627894ef0621f681442 (patch)
treef6377a4dd3d6059a967cbd0e2b7ec73d4ac33e93 /client/src/lib/components/touchable.js
parent5b83db9434059cbc6c57909db036297325ca2ac9 (diff)
browser, touchable
Diffstat (limited to 'client/src/lib/components/touchable.js')
-rw-r--r--client/src/lib/components/touchable.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/client/src/lib/components/touchable.js b/client/src/lib/components/touchable.js
new file mode 100644
index 0000000..fd72c60
--- /dev/null
+++ b/client/src/lib/components/touchable.js
@@ -0,0 +1,28 @@
+import React, { Component } from 'react';
+import {
+ TouchableOpacity,
+ TouchableWithoutFeedback,
+} from 'react-native';
+
+const isIphone = (navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))
+const isIpad = (navigator.userAgent.match(/iPad/i))
+const isAndroid = (navigator.userAgent.match(/Android/i))
+const isMobile = isIphone || isIpad || isAndroid
+const isDesktop = ! isMobile
+const isFirefox = navigator.userAgent.match('Firefox')
+
+export default class Touchable extends Component {
+ render() {
+ if (isFirefox) {
+ return (
+ <TouchableWithoutFeedback {...this.props} />
+ )
+ }
+ else {
+ return (
+ <TouchableOpacity {...this.props} />
+ )
+ }
+ }
+}
+