Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions AppIntroSlider.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export default class AppIntroSlider extends React.Component {
paginationStyle: null,
showDoneButton: true,
showNextButton: true,
testId: testID => ({ testID }),
};
state = {
width,
Expand Down Expand Up @@ -117,13 +118,15 @@ export default class AppIntroSlider extends React.Component {
};

_renderOuterButton = (content, name, onPress) => {
const { testId } = this.props;
const style =
name === 'Skip' || name === 'Prev' ? styles.leftButtonContainer : styles.rightButtonContainer;
return (
<View style={!this.props.bottomButton && style}>
<TouchableOpacity
onPress={onPress}
style={this.props.bottomButton ? styles.flexOne : this.props.buttonStyle}
{...testId(`button_${name}`)}
>
{content}
</TouchableOpacity>
Expand Down Expand Up @@ -151,6 +154,8 @@ export default class AppIntroSlider extends React.Component {
(!isFirstSlide && this._renderPrevButton()) || (!isLastSlide && this._renderSkipButton());
const btn = isLastSlide ? this._renderDoneButton() : this._renderNextButton();

const { testId } = this.props;

return (
<View style={[styles.paginationContainer, this.props.paginationStyle]}>
<View style={styles.paginationDots}>
Expand All @@ -165,6 +170,7 @@ export default class AppIntroSlider extends React.Component {
: this.props.dotStyle,
]}
onPress={() => this._onPaginationPress(i)}
{...testId(`page_${i}`)}
/>
))}
</View>
Expand Down