Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions src/components/carousel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -459,13 +459,13 @@ class Carousel extends Component<CarouselProps, CarouselState> {
}

renderCounter() {
const {pageWidth, showCounter, counterTextStyle} = this.props;
const {pageWidth, showCounter, counterStyle, counterTextStyle} = this.props;
const {currentStandingPage} = this.state;
const pagesCount = presenter.getChildrenLength(this.props);

if (showCounter && !pageWidth) {
return (
<View center style={styles.counter}>
<View center style={[styles.counter, counterStyle]}>
<Text grey80 text90 style={[{fontWeight: 'bold'}, counterTextStyle]}>
{currentStandingPage + 1}/{pagesCount}
</Text>
Expand Down
4 changes: 4 additions & 0 deletions src/components/carousel/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ export interface CarouselProps extends ScrollViewProps {
* whether to show a page counter (will not work with 'pageWidth' prop)
*/
showCounter?: boolean;
/**
* the counter's style
*/
counterStyle?: StyleProp<ViewStyle>;
/**
* the counter's text style
*/
Expand Down