react-native-app-intro-slider-spaceo
Version:
Simple and configurable app introduction slider for react native
49 lines (46 loc) • 1.15 kB
JavaScript
import React from 'react';
import {
StyleSheet,
Text,
View,
Image,
Dimensions,
Platform,
} from 'react-native';
export default class DefaultSlide extends React.PureComponent {
render() {
const style = {
backgroundColor: this.props.backgroundColor,
paddingTop: this.props.topSpacer,
paddingBottom: this.props.bottomSpacer,
width: this.props.width,
height: this.props.height,
}
return (
<View style={[styles.mainContent, style]}>
<Text style={[styles.title, this.props.titleStyle]}>{this.props.title}</Text>
<Image source={this.props.image} style={this.props.imageStyle} />
<Text style={[styles.text, this.props.textStyle]}>{this.props.text}</Text>
</View>
);
}
}
const styles = StyleSheet.create({
mainContent: {
justifyContent: 'space-around',
alignItems: 'center',
},
text: {
color: 'rgba(255, 255, 255, .7)',
fontSize: 16,
textAlign: 'center',
fontWeight: '300',
paddingHorizontal: 16,
},
title: {
fontSize: 26,
color: 'rgba(255, 255, 255, .7)',
fontWeight: '300',
paddingHorizontal: 16,
}
});