Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Demo] Update demo with build script and modernized code.
- Loading branch information
Showing
8 changed files
with
2,715 additions
and
18,507 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head lang="en"> | ||
<meta charset="UTF-8"> | ||
<title>react-progressbar</title> | ||
</head> | ||
|
||
<body> | ||
<div id="demo"></div> | ||
<script src="./index.js"></script> | ||
</body> | ||
|
||
</html> |
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,38 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import ProgressBar from '../'; | ||
|
||
class ProgressBarDemo extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
completed: 0, | ||
}; | ||
} | ||
|
||
componentDidMount() { | ||
var id = window.setInterval(() => { | ||
var diff = Math.random() * 10; | ||
|
||
this.setState({ | ||
completed: Math.min(this.state.completed + diff, 100), | ||
}); | ||
|
||
if (this.state.completed >= 100) { | ||
window.clearInterval(id); | ||
} | ||
}, 1000); | ||
} | ||
|
||
render() { | ||
return ( | ||
<div> | ||
<h1>react-progressbar</h1> | ||
<br /> | ||
<br /> | ||
<ProgressBar completed={this.state.completed} /> | ||
</div> | ||
); | ||
} | ||
} | ||
ReactDOM.render(<ProgressBarDemo />, document.getElementById('demo')); |
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,10 +1 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head lang="en"> | ||
<meta charset="UTF-8"> | ||
<title>react-progressbar</title> | ||
</head> | ||
<body> | ||
<script src="script.js"></script> | ||
</body> | ||
</html> | ||
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title>react-progressbar</title> </head> <body> <div id="demo"></div> <script src="250d9d033e637f0ffb8b901316720c75.js"></script> </body> </html> |
Oops, something went wrong.