Skip to content

Commit ed32640

Browse files
committed
Merged with upstream
2 parents e1b41a4 + d77d044 commit ed32640

File tree

5 files changed

+17
-29
lines changed

5 files changed

+17
-29
lines changed

AppIntro.js

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -247,13 +247,13 @@ export default class AppIntro extends Component {
247247
}
248248

249249
renderPagination = (index, total, context) => {
250-
const { dotStyles, activeDotColor, dotColor, rightTextColor } = this.props;
250+
const { activeDotColor, dotColor, rightTextColor, leftTextColor } = this.props;
251251
const ActiveDot = (
252252
<View
253-
style={[this.styles.activeDotStyle, dotStyles, { backgroundColor: activeDotColor }]}
253+
style={[this.styles.activeDotStyle, { backgroundColor: activeDotColor }]}
254254
/>
255255
);
256-
const Dot = <View style={[this.styles.dotStyle, dotStyles, { backgroundColor: dotColor }]} />;
256+
const Dot = <View style={[this.styles.dotStyle, { backgroundColor: dotColor }]} />;
257257
let dots = [];
258258
for (let i = 0; i < total; i++) {
259259
dots.push(i === index ?
@@ -301,7 +301,7 @@ export default class AppIntro extends Component {
301301
style={this.styles.full}
302302
onPress={isSkipBtnShow ? () => this.props.onSkipBtnClick(index) : null}
303303
>
304-
<Text style={[this.styles.controllText, { color: rightTextColor }]}>{this.props.skipBtnLabel}</Text>
304+
<Text style={[this.styles.controllText, { color: leftTextColor }]}>{this.props.skipBtnLabel}</Text>
305305
</TouchableOpacity>
306306
</View>
307307
<View style={this.styles.dotContainer}>
@@ -359,13 +359,7 @@ export default class AppIntro extends Component {
359359
const root = children.props.children;
360360
let nodes = children;
361361
if (Array.isArray(root)) {
362-
nodes = root.map((node, i) => {
363-
let element = node;
364-
if (node.type.displayName === 'View') {
365-
element = this.renderChild(node, pageIndex, `${index}_${i}`);
366-
}
367-
return element;
368-
});
362+
nodes = root.map((node, i) => this.renderChild(node, pageIndex, `${index}_${i}`));
369363
}
370364
let animatedChild = children;
371365
if (level !== 0) {

Example/AppIntro.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ export default class AppIntro extends Component {
189189
}
190190

191191
renderPagination = (index, total, context) => {
192-
const { activeDotColor, dotColor, rightTextColor } = this.props;
192+
const { activeDotColor, dotColor, rightTextColor, leftTextColor } = this.props;
193193
const ActiveDot = (
194194
<View
195195
style={[this.styles.activeDotStyle, { backgroundColor: activeDotColor }]}
@@ -237,7 +237,7 @@ export default class AppIntro extends Component {
237237
style={this.styles.full}
238238
onPress={isSkipBtnShow ? () => this.props.onSkipBtnClick(index) : null}
239239
>
240-
<Text style={[this.styles.controllText, { color: rightTextColor }]}>{this.props.skipBtnLabel}</Text>
240+
<Text style={[this.styles.controllText, { color: leftTextColor }]}>{this.props.skipBtnLabel}</Text>
241241
</TouchableOpacity>
242242
</Animated.View>
243243
<View style={this.styles.dotContainer}>
@@ -284,7 +284,7 @@ export default class AppIntro extends Component {
284284
style={this.styles.full}
285285
onPress={isSkipBtnShow ? () => this.props.onSkipBtnClick(index) : null}
286286
>
287-
<Text style={[this.styles.controllText, { color: rightTextColor }]}>{this.props.skipBtnLabel}</Text>
287+
<Text style={[this.styles.controllText, { color: leftTextColor }]}>{this.props.skipBtnLabel}</Text>
288288
</TouchableOpacity>
289289
</View>
290290
<View style={this.styles.dotContainer}>
@@ -342,13 +342,7 @@ export default class AppIntro extends Component {
342342
const root = children.props.children;
343343
let nodes = children;
344344
if (Array.isArray(root)) {
345-
nodes = root.map((node, i) => {
346-
let element = node;
347-
if (node.type.displayName === 'View') {
348-
element = this.renderChild(node, pageIndex, `${index}_${i}`);
349-
}
350-
return element;
351-
});
345+
nodes = root.map((node, i) => this.renderChild(node, pageIndex, `${index}_${i}`));
352346
}
353347
let animatedChild = children;
354348
if (level !== 0) {

Example/index.android.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class Example extends Component {
6666
doneBtnHandle = () => {
6767
Alert.alert('Done');
6868
}
69-
nextBtnHendle = (index) => {
69+
nextBtnHandle = (index) => {
7070
Alert.alert('Next');
7171
console.log(index);
7272
}
@@ -77,7 +77,7 @@ class Example extends Component {
7777
render() {
7878
return (
7979
<AppIntro
80-
onNextBtnClick={this.nextBtnHendle}
80+
onNextBtnClick={this.nextBtnHandle}
8181
onDoneBtnClick={this.doneBtnHandle}
8282
onSkipBtnClick={this.onSkipBtnHandle}
8383
onSlideChange={this.onSlideChangeHandle}

Example/index.ios.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
import React, { Component } from 'react';
88
import { AppRegistry, StyleSheet, Text, View, Alert, Image } from 'react-native';
9-
import AppIntro from 'react-native-app-intro';
10-
// import AppIntro from './AppIntro';
9+
// import AppIntro from 'react-native-app-intro';
10+
import AppIntro from './AppIntro';
1111

1212
const styles = StyleSheet.create({
1313
slide: {
@@ -57,7 +57,7 @@ class Example extends Component {
5757
doneBtnHandle = () => {
5858
Alert.alert('Done');
5959
}
60-
nextBtnHendle = (index) => {
60+
nextBtnHandle = (index) => {
6161
Alert.alert('Next');
6262
console.log(index);
6363
}
@@ -68,7 +68,7 @@ class Example extends Component {
6868
render() {
6969
return (
7070
<AppIntro
71-
onNextBtnClick={this.nextBtnHendle}
71+
onNextBtnClick={this.nextBtnHandle}
7272
onDoneBtnClick={this.doneBtnHandle}
7373
onSkipBtnClick={this.onSkipBtnHandle}
7474
onSlideChange={this.onSlideChangeHandle}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class Example extends Component {
3636
doneBtnHandle = () => {
3737
Alert.alert('Done');
3838
}
39-
nextBtnHendle = (index) => {
39+
nextBtnHandle = (index) => {
4040
Alert.alert('Next');
4141
console.log(index);
4242
}
@@ -69,7 +69,7 @@ class Example extends Component {
6969
}];
7070
return (
7171
<AppIntro
72-
onNextBtnClick={this.nextBtnHendle}
72+
onNextBtnClick={this.nextBtnHandle}
7373
onDoneBtnClick={this.doneBtnHandle}
7474
onSkipBtnClick={this.onSkipBtnHandle}
7575
onSlideChange={this.onSlideChangeHandle}

0 commit comments

Comments
 (0)