From 56da14619986acc4da8bf1cd0360eb761e2cdb21 Mon Sep 17 00:00:00 2001 From: rtallmadge Date: Wed, 23 Mar 2016 12:13:16 -0400 Subject: [PATCH 1/2] Adding the ability to override class name --- README.md | 3 +++ countdown_timer.jsx | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a9fdcff..e2f5ca5 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,9 @@ A timer component for React that counts down to zero for a specified number of m `initialTimeRemaining: Number` The time remaining for the countdown (in ms). +`setClass: String (optional -- default: 'timer')` +Override the 'timer' class with a custom class name + `interval: Number (optional -- default: 1000ms)` The time between timer ticks (in ms). diff --git a/countdown_timer.jsx b/countdown_timer.jsx index 59b85d0..6c0d8dd 100644 --- a/countdown_timer.jsx +++ b/countdown_timer.jsx @@ -126,7 +126,7 @@ var CountdownTimer = React.createClass({ var timeRemaining = this.state.timeRemaining; return ( -
+
{this.getFormattedTime(timeRemaining)}
); From c3209cc13948689354b0f16a7fc4110657a71eba Mon Sep 17 00:00:00 2001 From: rtallmadge Date: Mon, 18 Apr 2016 09:22:41 -0400 Subject: [PATCH 2/2] Changed customer css class prop name to "className", Updated README and COMMENTS to reflect the change --- README.md | 4 ++-- countdown_timer.jsx | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e2f5ca5..7916044 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ A timer component for React that counts down to zero for a specified number of m `initialTimeRemaining: Number` The time remaining for the countdown (in ms). -`setClass: String (optional -- default: 'timer')` -Override the 'timer' class with a custom class name + `className: String` + Custom class name to be applied to the timer `interval: Number (optional -- default: 1000ms)` The time between timer ticks (in ms). diff --git a/countdown_timer.jsx b/countdown_timer.jsx index 6c0d8dd..af0d7fd 100644 --- a/countdown_timer.jsx +++ b/countdown_timer.jsx @@ -7,6 +7,8 @@ var React = require('react'); // props: // - initialTimeRemaining: Number // The time remaining for the countdown (in ms). +// - className: String +// Custom class name to be applied to the timer // // - interval: Number (optional -- default: 1000ms) // The time between timer ticks (in ms). @@ -126,7 +128,7 @@ var CountdownTimer = React.createClass({ var timeRemaining = this.state.timeRemaining; return ( -
+
{this.getFormattedTime(timeRemaining)}
);