-
Notifications
You must be signed in to change notification settings - Fork 2
/
archive
80 lines (69 loc) · 2.45 KB
/
archive
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
"use strict";
var Progress = React.createClass({
displayName: "Progress",
getInitialState: function getInitialState() {
return { qty: 0 };
},
render: function render() {
return React.createElement(
"div",
null,
React.createElement(
"div",
null,
React.createElement(
"span",
null,
this.props.name
),
React.createElement(
"span",
null,
this.props.filesize
)
),
React.createElement("progress", { value: this.props.value, max: this.props.maxvalue })
);
}
});
var ProgressList = React.createClass({
displayName: "ProgressList",
render: function render() {
return React.createElement(
"div",
null,
React.createElement(Progress, { name: "BassCSS", filesize: "14", value: "14", maxvalue: "1180" }),
React.createElement(Progress, { name: "Pure CSS", filesize: "18", value: "18", maxvalue: "1180" }),
React.createElement(Progress, { name: "Wikipedia", filesize: "32", value: "32", maxvalue: "1180" }),
React.createElement(Progress, { name: "Tachyons", filesize: "40", value: "40", maxvalue: "1180" }),
React.createElement(Progress, { name: "Smashing Magazine", filesize: "56", value: "56", maxvalue: "1180" }),
React.createElement(Progress, { name: "Google", filesize: "32", value: "32", maxvalue: "1180" })
);
}
});
var ProgressList = React.createClass({
displayName: "ProgressList",
getInitialState: function getInitialState() {
return {
total: 0,
productList: [{ name: "BassCss", filesize: 14, value: 14, maxvalue: 1180 }, { name: "Pure CSS", filesize: 18, value: 18, maxvalue: 1180 }, { name: "Wikipedia", filesize: 32, value: 32, maxvalue: 1180 }]
};
},
calculateTotal: function calculateTotal(price) {
this.setState({ total: this.state.total + filesize + value + maxvalue });
},
render: function render() {
var component = this;
var products = this.state.productList.map(function (product) {
return React.createElement(Progress, { name: product.name, filesize: product.filesize, value: product.value, maxvalue: product.maxvalue,
handleTotal: component.calculateTotal });
});
return React.createElement(
"div",
null,
products,
React.createElement(Total, { total: this.state.total })
);
}
});
ReactDOM.render(React.createElement(ProgressList, null), document.getElementById("progress"));