diff --git a/README.md b/README.md index 73bd0bc..31f1f74 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ Run `npm install react-native-countdown-component --save` OR `yarn add react-nat | Name | Description | Type | Default Value | | :--- | :----- | :--- | :---: | | style | Override the component style | object | {} | +| countDownContainerStyle | Count Down Style | object | {} | | digitStyle | Digit style | object | {backgroundColor: ![#FAB913](https://placehold.it/15/FAB913/000000?text=+) `'#FAB913'`} | | digitTxtStyle | Digit Text style | object | {color: ![#FAB913](https://placehold.it/15/000000/000000?text=+) `'#000'`} | | timeLabelStyle | Time Label style | object | {color: ![#FAB913](https://placehold.it/15/000000/000000?text=+) `'#000'`} | diff --git a/index.js b/index.js index 689d293..f4b8ec7 100644 --- a/index.js +++ b/index.js @@ -25,6 +25,7 @@ const DEFAULT_TIME_LABELS = { class CountDown extends React.Component { static propTypes = { + countDownContainerStyle: PropTypes.object, digitStyle: PropTypes.object, digitTxtStyle: PropTypes.object, timeLabelStyle: PropTypes.object, @@ -177,7 +178,7 @@ class CountDown extends React.Component { }; renderCountDown = () => { - const {timeToShow, timeLabels, showSeparator} = this.props; + const {timeToShow, timeLabels, showSeparator, countDownContainerStyle} = this.props; const {until} = this.state; const {days, hours, minutes, seconds} = this.getTimeLeft(); const newTime = sprintf('%02d:%02d:%02d:%02d', days, hours, minutes, seconds).split(':'); @@ -185,7 +186,7 @@ class CountDown extends React.Component { return ( {timeToShow.includes('D') ? this.renderDoubleDigits(timeLabels.d, newTime[0]) : null} @@ -209,6 +210,7 @@ class CountDown extends React.Component { } CountDown.defaultProps = { + countDownContainerStyle: {}, digitStyle: DEFAULT_DIGIT_STYLE, digitTxtStyle: DEFAULT_DIGIT_TXT_STYLE, timeLabelStyle: DEFAULT_TIME_LABEL_STYLE,