summaryrefslogtreecommitdiffhomepage
path: root/app/components/CustomScrollbars.android.js
diff options
context:
space:
mode:
authoranderklander <anderklander@gmail.com>2018-04-12 09:41:13 +0200
committerAndrej Mihajlov <and@mullvad.net>2018-04-16 12:01:12 +0200
commit7f485b287d9a501e7de11d470d68f1e698ff10c2 (patch)
tree81767a79b7d47f813da5ef2edcff150a243b3416 /app/components/CustomScrollbars.android.js
parentc9f2ec62790a62e674b1252a6a18dec451d17bf3 (diff)
downloadmullvadvpn-7f485b287d9a501e7de11d470d68f1e698ff10c2.tar.xz
mullvadvpn-7f485b287d9a501e7de11d470d68f1e698ff10c2.zip
JS fixes for react-native
Diffstat (limited to 'app/components/CustomScrollbars.android.js')
-rw-r--r--app/components/CustomScrollbars.android.js36
1 files changed, 36 insertions, 0 deletions
diff --git a/app/components/CustomScrollbars.android.js b/app/components/CustomScrollbars.android.js
new file mode 100644
index 0000000000..8c9ea03da2
--- /dev/null
+++ b/app/components/CustomScrollbars.android.js
@@ -0,0 +1,36 @@
+// @flow
+
+import * as React from 'react';
+import { View, Component } from 'reactxp';
+
+type Props = {
+ autoHide: boolean,
+ thumbInset: { x: number, y: number },
+ children?: React.Node,
+};
+
+type State = {
+ canScroll: boolean,
+ showScrollIndicators: boolean,
+};
+
+export default class CustomScrollbars extends Component<Props, State> {
+ static defaultProps = {
+ autoHide: true,
+ thumbInset: { x: 2, y: 2 },
+ };
+
+ state = {
+ canScroll: false,
+ showScrollIndicators: true,
+ };
+
+ render() {
+ const { autoHide: _autoHide, thumbInset: _thumbInset, children, ...otherProps } = this.props;
+
+ return (
+ <View { ...otherProps }>
+ { children }
+ </View>);
+ }
+}