From 8c55384545e08980e04160ad5ab2e8ca7c17ac20 Mon Sep 17 00:00:00 2001 From: Emmanouil Konstantinidis Date: Thu, 7 May 2015 23:03:06 +0100 Subject: [PATCH 1/3] Accept css classes and icons --- index.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index f1e122e..4326fc1 100644 --- a/index.js +++ b/index.js @@ -7,14 +7,21 @@ module.exports = React.createClass({ displayName: 'Reloading', render: function () { - var text = this.props.text ? this.props.text : 'Loading...'; + var classname = this.props.className ? this.props.className : ''; + var content = this.props.text ? this.props.text : 'Loading'; + + if (this.props.faIcon) { + content = React.createElement("i", {className: this.props.faIcon}, '') + } + if (!this.props.shouldShow) { loadingStyle.display = 'none'; } else { loadingStyle.display = 'block'; } + return ( - React.createElement("div", {style: loadingStyle}, text) + React.createElement("div", {className: classname, style: loadingStyle}, content) ); } From 965ede0f00afd3d543847b7363ea9a425e9d5051 Mon Sep 17 00:00:00 2001 From: Emmanouil Konstantinidis Date: Thu, 7 May 2015 23:06:43 +0100 Subject: [PATCH 2/3] Update README.md --- README.md | 6 ++++++ index.js | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7b49b6f..464fd36 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,12 @@ ##### Loading Text +##### CSS Class + + +##### Font Awesome Icon + + ### Development Install `http-server` from npm, run it and go to http://127.0.0.1:8080/ diff --git a/index.js b/index.js index 4326fc1..54b5d76 100644 --- a/index.js +++ b/index.js @@ -11,7 +11,7 @@ module.exports = React.createClass({ var content = this.props.text ? this.props.text : 'Loading'; if (this.props.faIcon) { - content = React.createElement("i", {className: this.props.faIcon}, '') + content = React.createElement("i", {className: this.props.faIcon}, ''); } if (!this.props.shouldShow) { From 9784cfe8a8ee51aedb4566489af43ecac62fc862 Mon Sep 17 00:00:00 2001 From: Emmanouil Konstantinidis Date: Thu, 7 May 2015 23:11:06 +0100 Subject: [PATCH 3/3] Update version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8a86676..06d1c4f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "reloading", - "version": "0.0.3", + "version": "0.0.4", "description": "A Loading component for ReactJS.", "main": "index.js", "scripts": {