react-native-sliding-up-down-panel-galesburg
Version:
Sliding up and sliding down panels for android and ios | react native
70 lines (66 loc) • 1.61 kB
JavaScript
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
StyleSheet,
Text,
View,
Dimensions,
} from 'react-native';
import SlidingPanel from 'react-native-sliding-up-down-panels';
const { width, height } = Dimensions.get('window');
export default class App extends Component {
render() {
return (
<View style={styles.container}>
<View style={styles.bodyViewStyle}>
<Text>Hello My World</Text>
</View>
<SlidingPanel
headerLayoutHeight = {100}
headerLayout = { () =>
<View style={styles.headerLayoutStyle}>
<Text style={styles.commonTextStyle}>My Awesome sliding panel</Text>
</View>
}
slidingPanelLayout = { () =>
<View style={styles.slidingPanelLayoutStyle}>
<Text style={styles.commonTextStyle}>The best thing about me is you</Text>
</View>
}
/>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
bodyViewStyle: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
headerLayoutStyle: {
width,
height: 100,
backgroundColor: 'orange',
justifyContent: 'center',
alignItems: 'center',
},
slidingPanelLayoutStyle: {
width,
height,
backgroundColor: '#7E52A0',
justifyContent: 'center',
alignItems: 'center',
},
commonTextStyle: {
color: 'white',
fontSize: 18,
},
});