This repository has been archived by the owner on Feb 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(loader): add ability to specify custom loading content
- Loading branch information
1 parent
e70559b
commit 09de8bf
Showing
17 changed files
with
130 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import React from 'react'; | ||
import { Button, Col, Input, Row } from 'reactstrap'; | ||
import BlockUi from 'react-block-ui'; | ||
import { Loader, Types } from 'react-loaders'; | ||
import 'react-block-ui/style.css'; | ||
import 'loaders.css/loaders.min.css'; | ||
|
||
export default class Example extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
|
||
this.toggleBlocking = this.toggleBlocking.bind(this); | ||
this.setLoaderType = this.setLoaderType.bind(this); | ||
this.state = { | ||
blocking: false, | ||
loaderType: 'ball-triangle-path', | ||
}; | ||
} | ||
|
||
toggleBlocking() { | ||
this.setState({blocking: !this.state.blocking}); | ||
} | ||
|
||
setLoaderType(e) { | ||
this.setState({loaderType: e.target.value}); | ||
} | ||
|
||
render() { | ||
return ( | ||
<div> | ||
<BlockUi tag="div" blocking={this.state.blocking} loader={<Loader active type={this.state.loaderType} color="#02a17c"/>}> | ||
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> | ||
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> | ||
</BlockUi> | ||
<Row> | ||
<Col xs={12} sm={6}> | ||
<Input type="select" onChange={this.setLoaderType}> | ||
{Object.keys(Types).map(type => | ||
<option key={type} value={type}>{type}</option> | ||
)} | ||
</Input> | ||
</Col> | ||
<Col xs={12} sm={3}> | ||
<Button onClick={this.toggleBlocking} color="primary">Toggle Block</Button> | ||
</Col> | ||
</Row> | ||
</div> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,10 @@ | |
} | ||
} | ||
|
||
.loader-inner { | ||
display: inline-block; | ||
} | ||
|
||
.content { | ||
margin-top: 2rem; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "react-block-ui", | ||
"version": "0.1.1", | ||
"version": "0.2.0", | ||
"author": "Evan Sharp <[email protected]>", | ||
"description": "Block UI for react", | ||
"main": "lib/index.js", | ||
|
@@ -69,13 +69,16 @@ | |
"babel-eslint": "^6.1.2", | ||
"babel-loader": "^6.2.5", | ||
"babel-plugin-istanbul": "^1.1.0", | ||
"babel-plugin-transform-class-properties": "^6.18.0", | ||
"babel-plugin-transform-proto-to-assign": "^6.9.0", | ||
"babel-plugin-transform-runtime": "^6.15.0", | ||
"babel-polyfill": "^6.13.0", | ||
"babel-preset-es2015": "^6.13.2", | ||
"babel-preset-es2015-loose": "^7.0.0", | ||
"babel-preset-react": "^6.5.0", | ||
"babel-preset-stage-0": "^6.5.0", | ||
"babel-register": "^6.11.6", | ||
"bootstrap": "^4.0.0-alpha.3", | ||
"bootstrap": "^4.0.0-alpha.5", | ||
"chai": "^3.5.0", | ||
"chai-enzyme": "^0.5.0", | ||
"cheerio": "^0.20.0", | ||
|
@@ -97,6 +100,7 @@ | |
"jasmine-core": "^2.4.1", | ||
"jsdom": "^9.4.2", | ||
"json-loader": "^0.5.4", | ||
"loaders.css": "^0.1.2", | ||
"mocha": "^3.0.2", | ||
"mocha-webpack": "^0.6.0", | ||
"nyc": "^8.1.0", | ||
|
@@ -107,13 +111,15 @@ | |
"react-addons-pure-render-mixin": "^15.3.1", | ||
"react-addons-test-utils": "^15.3.1", | ||
"react-addons-transition-group": "^15.3.1", | ||
"react-addons-css-transition-group": "^15.3.1", | ||
"react-dom": "^15.3.1", | ||
"react-helmet": "^3.0.1", | ||
"react-highlight": "^0.8.0", | ||
"react-loaders": "^2.3.0", | ||
"react-prism": "3.2.1", | ||
"react-redux": "^4.4.5", | ||
"react-router": "^2.0.1", | ||
"reactstrap": "^2.6.0", | ||
"reactstrap": "^3.9.0", | ||
"redux": "^3.5.2", | ||
"rimraf": "^2.5.4", | ||
"sinon": "^1.17.5", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters