Skip to content

Commit

Permalink
Merge pull request #4 from ekonstantinidis/fix-bug
Browse files Browse the repository at this point in the history
Fix bug - transform JSX
  • Loading branch information
ekonstantinidis committed May 7, 2015
2 parents 5a6ce58 + 095eb7e commit ec27f09
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 48 deletions.
2 changes: 1 addition & 1 deletion README.md
@@ -1,4 +1,4 @@
# Re-loading
# Reloading

[![npm version](https://badge.fury.io/js/reloading.svg)](http://badge.fury.io/js/reloading)
[![Build Status](https://travis-ci.org/ekonstantinidis/reloading.svg?branch=master)](https://travis-ci.org/ekonstantinidis/re-loading)
Expand Down
31 changes: 8 additions & 23 deletions example/build/app.js
@@ -1,41 +1,26 @@
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
var React = require('react');

var loadingStyle = {
textAlign: 'center',
padding: '5px 0',
fontSize: '30px'
};

var Loading = React.createClass({displayName: "Loading",
var loadingStyle = {};

getInitialState: function () {
return {
show: this.props.shouldShow,
text: this.props.text || "Loading..."
};
},
module.exports = React.createClass({

componentWillReceiveProps: function (newProps) {
this.replaceState({
show: newProps.shouldShow
});
},
displayName: 'Reloading',

render: function () {
var loading;
if (!this.state.show) {
var text = this.props.text ? this.props.text : 'Loading...';
if (!this.props.shouldShow) {
loadingStyle.display = 'none';
} else {
loadingStyle.display = 'block';
}
return (
React.createElement("div", {style: loadingStyle}, this.state.text)
React.createElement("div", {style: loadingStyle}, text)
);

}
});

module.exports = Loading;
});


},{"react":157}],2:[function(require,module,exports){
Expand Down
31 changes: 8 additions & 23 deletions index.js
@@ -1,37 +1,22 @@
var React = require('react');

var loadingStyle = {
textAlign: 'center',
padding: '5px 0',
fontSize: '30px'
};
var loadingStyle = {};

var Loading = React.createClass({
module.exports = React.createClass({

getInitialState: function () {
return {
show: this.props.shouldShow,
text: this.props.text || "Loading..."
};
},

componentWillReceiveProps: function (newProps) {
this.replaceState({
show: newProps.shouldShow
});
},
displayName: 'Reloading',

render: function () {
var loading;
if (!this.state.show) {
var text = this.props.text ? this.props.text : 'Loading...';
if (!this.props.shouldShow) {
loadingStyle.display = 'none';
} else {
loadingStyle.display = 'block';
}
return (
<div style={loadingStyle}>{this.state.text}</div>
React.createElement("div", {style: loadingStyle}, text)
);

}
});

module.exports = Loading;
});
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "reloading",
"version": "0.0.2",
"version": "0.0.3",
"description": "A Loading component for ReactJS.",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit ec27f09

Please sign in to comment.