react-native-app-intro-slider
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -44,3 +44,3 @@ import React from 'react'; | ||
const { width, height } = this.state; | ||
const bottomSpacer = (this.props.bottomButton ? 44 : 0) + (isIphoneX ? 98 : 64); | ||
const bottomSpacer = (this.props.bottomButton ? 44 : 0) + (isIphoneX ? 34: 0) + 80; | ||
const topSpacer = (isIphoneX ? 44 : 0) + (Platform.OS === 'ios' ? 20 : 0); | ||
@@ -47,0 +47,0 @@ const props = { ...item.item, bottomSpacer, topSpacer }; |
@@ -13,11 +13,12 @@ import React from 'react'; | ||
render() { | ||
const style = { | ||
backgroundColor: this.props.backgroundColor, | ||
paddingTop: this.props.topSpacer, | ||
paddingBottom: this.props.bottomSpacer, | ||
} | ||
return ( | ||
<View style={{ flex: 1, backgroundColor: this.props.backgroundColor }}> | ||
<View style={{ height: this.props.topSpacer }} /> | ||
<View style={styles.mainContent}> | ||
<Text style={styles.title}>{this.props.title}</Text> | ||
<Image source={this.props.image} style={this.props.imageStyle} /> | ||
<Text style={styles.text}>{this.props.text}</Text> | ||
</View> | ||
<View style={{ height: this.props.bottomSpacer }} /> | ||
<View style={[styles.mainContent, style]}> | ||
<Text style={styles.title}>{this.props.title}</Text> | ||
<Image source={this.props.image} style={this.props.imageStyle} /> | ||
<Text style={styles.text}>{this.props.text}</Text> | ||
</View> | ||
@@ -24,0 +25,0 @@ ); |
{ | ||
"name": "react-native-app-intro-slider", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Simple and configurable app introduction slider for react native", | ||
@@ -26,2 +26,2 @@ "main": "AppIntroSlider.js", | ||
"homepage": "https://github.com/jacse/react-native-app-intro-slider" | ||
} | ||
} |
@@ -5,4 +5,2 @@ # react-native-app-intro-slider | ||
**NOTE:** It is quite recent so it has not yet been released to `npm`. For now please install using `npm install https://github.com/jacse/react-native-app-intro-slider.git` and let me know if it works for you! After a little positive feedback I'll publish to npm. | ||
## Showcase | ||
@@ -153,2 +151,4 @@ | ||
slides={slides} | ||
renderDoneButton={this._renderDoneButton} | ||
renderNextButton={this._renderNextButton} | ||
/> | ||
@@ -164,3 +164,3 @@ ); | ||
Here a custom `renderItem` is supplied. Notice how the setup of `slides` has been configured too. | ||
Here a custom `renderItem` is supplied and the `bottomButton`-props has been set to `true`. Notice how the setup of `slides` has been configured to support icons and gradient backgrounds. | ||
@@ -175,13 +175,5 @@ ```js | ||
const styles = StyleSheet.create({ | ||
button: { | ||
flex: 1, | ||
backgroundColor: 'rgba(0, 0, 0, .2)', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
alignSelf: 'stretch' | ||
}, | ||
mainContent: { | ||
flex: 1, | ||
alignItems: 'center', | ||
paddingVertical: 64, | ||
justifyContent: 'space-around', | ||
@@ -235,15 +227,14 @@ }, | ||
<LinearGradient | ||
style={{ flex: 1 }} | ||
style={[styles.mainContent, { | ||
paddingTop: props.topSpacer, | ||
paddingBottom: props.bottomSpacer, | ||
}]} | ||
colors={props.colors} | ||
start={{x: 0, y: .1}} end={{x: .1, y: 1}} | ||
> | ||
<View style={{ height: props.topSpacer }} /> | ||
<View style={styles.mainContent}> | ||
<Ionicons style={{ backgroundColor: 'transparent' }} name={props.icon} size={200} color="white" /> | ||
<View> | ||
<Text style={styles.title}>{props.title}</Text> | ||
<Text style={styles.text}>{props.text}</Text> | ||
</View> | ||
<Ionicons style={{ backgroundColor: 'transparent' }} name={props.icon} size={200} color="white" /> | ||
<View> | ||
<Text style={styles.title}>{props.title}</Text> | ||
<Text style={styles.text}>{props.text}</Text> | ||
</View> | ||
<View style={{ height: props.bottomSpacer }} /> | ||
</LinearGradient> | ||
@@ -250,0 +241,0 @@ ); |
231
16126
285