summaryrefslogtreecommitdiff
path: root/client/src/lib/components/button.js
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/lib/components/button.js')
-rw-r--r--client/src/lib/components/button.js14
1 files changed, 5 insertions, 9 deletions
diff --git a/client/src/lib/components/button.js b/client/src/lib/components/button.js
index edd75de..6860f49 100644
--- a/client/src/lib/components/button.js
+++ b/client/src/lib/components/button.js
@@ -2,11 +2,13 @@ import React, { Component } from 'react';
import {
StyleSheet,
Text,
- TouchableOpacity,
View
} from 'react-native';
import DeviceInfo from 'react-native-device-info'
+import Touchable from './touchable'
+import { isMobile } from './browser'
+
export default class Button extends Component {
render() {
let { buttonStyle, textStyle, ...others } = this.props
@@ -19,23 +21,17 @@ export default class Button extends Component {
activeOpacity = 1.0
}
return (
- <TouchableOpacity {...others} onPress={() => { if (! this.props.disabled) { this.props.onPress() }}}>
+ <Touchable {...others} onPress={() => { if (! this.props.disabled) { this.props.onPress() }}}>
<View style={viewElementStyle}>
<Text style={textElementStyle}>
{this.props.label}
</Text>
</View>
- </TouchableOpacity>
+ </Touchable>
)
}
}
-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 styles = StyleSheet.create({
text: {
color: '#000',