summaryrefslogtreecommitdiff
path: root/client/src/lib/components/heading.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2017-06-01 19:47:08 -0400
committerJules Laplace <julescarbon@gmail.com>2017-06-01 19:47:08 -0400
commit3e72bfa56c860826429a842f6c128d78d4a930db (patch)
tree3cecd31c92d53fae32e9761b80802c82f3dcb7fa /client/src/lib/components/heading.js
parentb694bd511ceccd00d4a4c98f36f910d5fc5f79c4 (diff)
react-native-web port of fmf app
Diffstat (limited to 'client/src/lib/components/heading.js')
-rw-r--r--client/src/lib/components/heading.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/client/src/lib/components/heading.js b/client/src/lib/components/heading.js
new file mode 100644
index 0000000..4ec19fb
--- /dev/null
+++ b/client/src/lib/components/heading.js
@@ -0,0 +1,34 @@
+import React, { Component } from 'react';
+import {
+ StyleSheet
+} from 'react-native';
+import DeviceInfo from 'react-native-device-info'
+
+import ClearText from './text'
+
+export default class Heading extends Component {
+ render() {
+ const {style, ...props} = this.props
+ return (
+ <ClearText style={[styles.heading, style]} {...props} />
+ )
+ }
+}
+
+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({
+ heading: {
+ marginLeft: 0,
+ paddingTop: isMobile ? 5 : 10,
+ paddingLeft: 0,
+ paddingRight: 0,
+ paddingBottom: isMobile ? 10 : 30,
+ fontSize: isMobile ? 20 : 25,
+ textAlign: 'center',
+ }
+})