Skip to content

Commit ee69195

Browse files
committed
Updated with dot styles and pagination container custom styles (as well as documentation on README
1 parent 9ff4699 commit ee69195

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

AppIntro.js

Lines changed: 12 additions & 7 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 { activeDotColor, dotColor, rightTextColor } = this.props;
250+
const { dotStyles, activeDotColor, dotColor, rightTextColor } = this.props;
251251
const ActiveDot = (
252252
<View
253-
style={[this.styles.activeDotStyle, { backgroundColor: activeDotColor }]}
253+
style={[this.styles.activeDotStyle, dotStyles, { backgroundColor: activeDotColor }]}
254254
/>
255255
);
256-
const Dot = <View style={[this.styles.dotStyle, { backgroundColor: dotColor }]} />;
256+
const Dot = <View style={[this.styles.dotStyle, dotStyles, { backgroundColor: dotColor }]} />;
257257
let dots = [];
258258
for (let i = 0; i < total; i++) {
259259
dots.push(i === index ?
@@ -278,9 +278,10 @@ export default class AppIntro extends Component {
278278
isSkipBtnShow = true;
279279
}
280280
let controllBts;
281+
const {paginationStyles} = this.props;
281282
if (Platform.OS === 'ios') {
282283
controllBts = (
283-
<View style={this.styles.paginationContainer}>
284+
<View style={[this.styles.paginationContainer, paginationStyles]}>
284285
{this.renderSkipButton()}
285286
<View style={this.styles.dotContainer}>
286287
{dots}
@@ -290,7 +291,7 @@ export default class AppIntro extends Component {
290291
);
291292
} else {
292293
controllBts = (
293-
<View style={this.styles.paginationContainer}>
294+
<View style={[this.styles.paginationContainer, paginationStyles]}>
294295
<View style={[this.styles.btnContainer, {
295296
paddingBottom: 5,
296297
opacity: isSkipBtnShow ? 1 : 0,
@@ -459,7 +460,9 @@ AppIntro.propTypes = {
459460
customStyles: PropTypes.object,
460461
defaultIndex: PropTypes.number,
461462
showSkipButton: PropTypes.bool,
462-
showDoneButton: PropTypes.bool
463+
showDoneButton: PropTypes.bool,
464+
paginationStyles: PropTypes.object,
465+
dotStyles: PropTypes.object
463466
};
464467

465468
AppIntro.defaultProps = {
@@ -477,5 +480,7 @@ AppIntro.defaultProps = {
477480
nextBtnLabel: '›',
478481
defaultIndex: 0,
479482
showSkipButton: true,
480-
showDoneButton: true
483+
showDoneButton: true,
484+
paginationStyles: {},
485+
dotStyles: {}
481486
};

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,11 @@ And in Android, image inside view component, view need width、height.
174174
| skipBtnLabel | string、Text element | Skip | The bottom left custom Text label |
175175
| nextBtnLabel | string、Text element || The bottom left custom Text label |
176176
| pageArray | array | | In the basic usage, you can input object array to render basic view example: ```[[{title: 'Page 1', description: 'Description 1', img: 'https://goo.gl/uwzs0C', imgStyle: {height: 80 * 2.5, width: 109 * 2.5 }, backgroundColor: '#fa931d', fontColor: '#fff', level: 10 }]``` , level is parallax effect level ,if you use pageArray you can't use custom view |
177+
| defaultIndex | number | number of the index of the initial index |
178+
| renderSkipButton | bool | a boolean defining if we should render the skip button |
179+
| renderDoneButton | bool | a boolean that defines if we should render the done button |
180+
| paginationStyles | object | an object of custom styling for the pagination container |
181+
| dotStyles | object | an object of custom styling for the dot pagination |
177182

178183
##### **Children View Properties**
179184
| Prop | PropType | Default Value | Description |

0 commit comments

Comments
 (0)