From e24392045f60ed9dddf400375f223cb058cead73 Mon Sep 17 00:00:00 2001 From: Ehsan Maders Date: Mon, 25 Feb 2019 01:58:29 +0330 Subject: [PATCH 1/2] add main style container prop --- index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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, From a15c161e345c826d616ea457c08efc2a5f1467ba Mon Sep 17 00:00:00 2001 From: Ehsan Maders Date: Mon, 25 Feb 2019 02:45:10 +0330 Subject: [PATCH 2/2] update README --- README.md | 1 + 1 file changed, 1 insertion(+) 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'`} |