react-loader-display
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -1,40 +0,42 @@ | ||
import React, {Component} from 'react'; | ||
import PropTypes from 'prop-types'; | ||
'use strict'; | ||
var createReactClass = require('create-react-class'); | ||
module.exports = createReactClass({ | ||
getDefaultProps: function() { | ||
return { | ||
IsLoading: false, | ||
LoaderMessage:'Please wait...', | ||
ZIndex:1000, | ||
BackDropRGBA:'rgba(0,0,0,0.1)', | ||
ForeGroundColor:'white', | ||
TextColor:'black' | ||
}; | ||
}, | ||
propTypes:{ | ||
IsLoading: React.PropTypes.bool.isRequired, | ||
LoadingImage:React.PropTypes.string.isRequired, | ||
ZIndex:React.PropTypes.number, | ||
LoaderMessage: React.PropTypes.string, | ||
BackDropRGBA: React.PropTypes.string, | ||
ForeGroundColor: React.PropTypes.string, | ||
TextColor: React.PropTypes.string | ||
}, | ||
render: function() { | ||
export default class AjaxLoaderDisplay extends Component{ | ||
constructor(props) | ||
{ | ||
super(props); | ||
this.state={}; | ||
} | ||
var LoadingContainerStyle=this.props.IsLoading?{ | ||
display:'block', | ||
position:'fixed', | ||
top:0, | ||
left:0, | ||
right:0, | ||
bottom:0, | ||
width:'100%', | ||
height:'100vh', | ||
backgroundColor:this.props.BackDropRGBA, | ||
zIndex:this.props.ZIndex, | ||
textAlign:'center' | ||
}:{ | ||
display:'none' | ||
}; | ||
static defaultProps = { | ||
IsLoading: false, | ||
LoaderMessage:'Please wait...', | ||
ZIndex:1000, | ||
BackDropRGBA:'rgba(0,0,0,0.1)', | ||
ForeGroundColor:'white', | ||
TextColor:'black' | ||
}; | ||
render=()=>{ | ||
let LoadingContainerStyle=this.props.IsLoading?{ | ||
display:'block', | ||
position:'fixed', | ||
top:0, | ||
left:0, | ||
right:0, | ||
bottom:0, | ||
width:'100%', | ||
height:'100vh', | ||
backgroundColor:this.props.BackDropRGBA, | ||
zIndex:this.props.ZIndex, | ||
textAlign:'center' | ||
}:{ | ||
display:'none' | ||
}; | ||
let LoaderChildComponentStyle={ | ||
var LoaderChildComponentStyle={ | ||
display:'block', | ||
@@ -52,3 +54,3 @@ marginLeft:'auto', | ||
let LoadingDisplayImage={ | ||
var LoadingDisplayImage={ | ||
display:'block', | ||
@@ -62,3 +64,3 @@ width:50, | ||
let LoadingDisplayText={ | ||
var LoadingDisplayText={ | ||
display:'block', | ||
@@ -76,23 +78,13 @@ width:'90%', | ||
<div style={LoadingContainerStyle}> | ||
{ | ||
this.props.IsLoading?<div style={LoaderChildComponentStyle}> | ||
<img src={this.props.LoadingImage} style={LoadingDisplayImage}/> | ||
<div style={LoadingDisplayText}> | ||
{this.props.LoaderMessage} | ||
</div> | ||
</div>:null | ||
} | ||
</div> | ||
{ | ||
this.props.IsLoading?<div style={LoaderChildComponentStyle}> | ||
<img src={this.props.LoadingImage} style={LoadingDisplayImage}/> | ||
<div style={LoadingDisplayText}> | ||
{this.props.LoaderMessage} | ||
</div> | ||
</div>:null | ||
} | ||
</div> | ||
) | ||
} | ||
} | ||
AjaxLoaderDisplay.propTypes = { | ||
IsLoading: PropTypes.bool.isRequired, | ||
LoadingImage:PropTypes.string.isRequired, | ||
ZIndex:PropTypes.number, | ||
LoaderMessage: PropTypes.string, | ||
BackDropRGBA: PropTypes.string, | ||
ForeGroundColor: PropTypes.string, | ||
TextColor: PropTypes.string | ||
}; | ||
}); |
@@ -1,4 +0,3 @@ | ||
import AjaxLoaderDisplay from './AjaxLoaderDisplay'; | ||
module.exports=AjaxLoaderDisplay; | ||
export let AjaxLoaderDisplay; | ||
'use strict'; | ||
module.exports = require('./AjaxLoaderDisplay'); |
{ | ||
"name": "react-loader-display", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "A simple customizable ReactJS component that allows a developer to display a loading modal.", | ||
@@ -18,3 +18,6 @@ "main": "index.js", | ||
}, | ||
"homepage": "https://github.com/albertusvdmerwe/react-loader-display#readme" | ||
"homepage": "https://github.com/albertusvdmerwe/react-loader-display#readme", | ||
"dependencies": { | ||
"createclass": "^0.2.4" | ||
} | ||
} |
19721
9
1
83
+ Addedcreateclass@^0.2.4
+ Addedcreateclass@0.2.4(transitive)