diff --git a/README.md b/README.md index 0cb0cef..b08ebf4 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ Run `npm install react-native-countdown-component --save` OR `yarn add react-nat | onPress | What function should be invoked when clicking on the timer | func | null | | timeToShow | What Digits to show | array | ['D', 'H', 'M', 'S'] | | timeLabels | Text to show in time label | object | {d: 'Days', h: 'Hours', m: 'Minutes', s: 'Seconds'} | +| showTimeLabels | Show or hide time label | bool | true | | showSeparator | Should show separator | bool | false | | running | a boolean to pause and resume the component | bool | true | diff --git a/index.js b/index.js index b546b82..fff1e00 100644 --- a/index.js +++ b/index.js @@ -29,6 +29,7 @@ class CountDown extends React.Component { digitStyle: PropTypes.object, digitTxtStyle: PropTypes.object, timeLabelStyle: PropTypes.object, + showTimeLabels:PropTypes.bool, separatorStyle: PropTypes.object, timeToShow: PropTypes.array, showSeparator: PropTypes.bool, @@ -165,12 +166,13 @@ class CountDown extends React.Component { }; renderDoubleDigits = (label, digits) => { + const { showTimeLabels } = this.props; return ( {this.renderDigit(digits)} - {this.renderLabel(label)} + {showTimeLabels && this.renderLabel(label)} ); }; @@ -227,6 +229,7 @@ CountDown.defaultProps = { digitTxtStyle: DEFAULT_DIGIT_TXT_STYLE, timeLabelStyle: DEFAULT_TIME_LABEL_STYLE, timeLabels: DEFAULT_TIME_LABELS, + showTimeLabels:true, separatorStyle: DEFAULT_SEPARATOR_STYLE, timeToShow: DEFAULT_TIME_TO_SHOW, showSeparator: false,