From 06e20cb460faa5c302511f6444c4017d5ebd07e0 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sun, 4 Jun 2017 18:19:08 -0400 Subject: more mobile hegemony --- client/src/lib/components/button.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'client/src/lib/components/button.js') diff --git a/client/src/lib/components/button.js b/client/src/lib/components/button.js index ca8388b..edd75de 100644 --- a/client/src/lib/components/button.js +++ b/client/src/lib/components/button.js @@ -30,6 +30,12 @@ export default class Button extends Component { } } +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', @@ -38,8 +44,8 @@ const styles = StyleSheet.create({ padding: 0, }, button: { - padding: 10, - margin: 10, + padding: isMobile ? 5 : 10, + margin: isMobile ? 5 : 10, borderRadius: 3, backgroundColor: '#fff', borderBottomColor: '#bbb', -- cgit v1.2.3-70-g09d2