react-native-swipeable-up-down
Version:
47 lines (43 loc) • 1.1 kB
JavaScript
import React, { Component } from 'react'
import { Platform, StyleSheet, Text, View } from 'react-native'
import SwipeableUpDown from 'react-native-swipeable-up-down'
type Props = {}
export default class App extends Component<Props> {
render() {
return (
<View style={{ marginTop: 50, padding: 15 }}>
<Text
onPress={() => {
this.refs.SwipeableBoxRef.isVisble()
}}
>
Show
</Text>
<SwipeableUpDown ref='SwipeableBoxRef'>
<View style={styles.container}>
<Text style={styles.welcome}>Welcome to React Native!</Text>
<Text style={styles.instructions}>To get started, edit App.js</Text>
</View>
</SwipeableUpDown>
</View>
)
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF'
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5
}
})