summaryrefslogtreecommitdiff
path: root/client/src/lib/components/scrollableContainer.js
diff options
context:
space:
mode:
authorjules <jules@carbonpictures.com>2017-06-02 15:42:34 +0000
committerjules <jules@carbonpictures.com>2017-06-02 15:42:34 +0000
commit5f26431f03228a85273e7f7d51abd6098ea9f2a5 (patch)
tree6a709972cbb0babd68aaa10fe277b2c843fd7451 /client/src/lib/components/scrollableContainer.js
parent291fe3eedd9a460fc44d2ea3ea81c7d79f2dfbcf (diff)
parentdd70fa81a205304cb48bbc0494ad34c16d496ff2 (diff)
merge
Diffstat (limited to 'client/src/lib/components/scrollableContainer.js')
-rw-r--r--client/src/lib/components/scrollableContainer.js51
1 files changed, 51 insertions, 0 deletions
diff --git a/client/src/lib/components/scrollableContainer.js b/client/src/lib/components/scrollableContainer.js
new file mode 100644
index 0000000..b0beb63
--- /dev/null
+++ b/client/src/lib/components/scrollableContainer.js
@@ -0,0 +1,51 @@
+import React, { Component } from 'react';
+import {
+ StyleSheet,
+ View,
+ ScrollView
+} from 'react-native';
+
+import Heading from '../components/heading'
+
+export default class ScrollableContainer extends Component {
+ constructor(props) {
+ super()
+ }
+ render() {
+ const { heading, bodyStyle, headingOnPress, ...props } = this.props
+ let headingEl;
+ if (heading) {
+ headingEl = (
+ <Heading style={styles.heading} onPress={headingOnPress}>
+ {heading.toUpperCase()}
+ </Heading>
+ )
+ }
+ else {
+ headingEl = null
+ }
+ return (
+ <View style={styles.container} {...props}>
+ <ScrollView ref={(ref) => this.scrollView = ref} contentContainerStyle={[styles.body, bodyStyle]}>
+ {headingEl}
+ {this.props.children}
+ <div style={{height: 40}}>footer</div>
+ </ScrollView>
+ </View>
+ )
+ }
+}
+
+const styles = StyleSheet.create({
+ container: {
+ width: '100vw',
+ flex: 1,
+ justifyContent: 'flex-start',
+ },
+ heading: {
+ },
+ body: {
+ alignItems: 'center',
+ },
+})
+