Skip to content

Commit

Permalink
[Demo] Update demo with build script and modernized code.
Browse files Browse the repository at this point in the history
  • Loading branch information
lsanwick committed Sep 23, 2020
1 parent 5b4e239 commit 9131b4a
Show file tree
Hide file tree
Showing 8 changed files with 2,715 additions and 18,507 deletions.
14 changes: 14 additions & 0 deletions demo-src/index.html
@@ -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>
38 changes: 38 additions & 0 deletions demo-src/index.js
@@ -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'));
355 changes: 355 additions & 0 deletions demo/250d9d033e637f0ffb8b901316720c75.js

Large diffs are not rendered by default.

43 changes: 0 additions & 43 deletions demo/browser.js

This file was deleted.

11 changes: 1 addition & 10 deletions demo/index.html
@@ -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>

0 comments on commit 9131b4a

Please sign in to comment.