|
1 | 1 | "use strict";
|
| 2 | +var __extends = (this && this.__extends) || function (d, b) { |
| 3 | + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; |
| 4 | + function __() { this.constructor = d; } |
| 5 | + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); |
| 6 | +}; |
| 7 | +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { |
| 8 | + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; |
| 9 | + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); |
| 10 | + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; |
| 11 | + return c > 3 && r && Object.defineProperty(target, key, r), r; |
| 12 | +}; |
| 13 | +var __metadata = (this && this.__metadata) || function (k, v) { |
| 14 | + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); |
| 15 | +}; |
2 | 16 | var React = require('react');
|
| 17 | +var react_redux_1 = require('react-redux'); |
3 | 18 | var Paper_1 = require('material-ui/Paper');
|
4 | 19 | var List_1 = require('material-ui/List');
|
5 | 20 | var Subheader_1 = require('material-ui/Subheader');
|
6 | 21 | var ProgressPage_1 = require('./ProgressPage');
|
| 22 | +var actions_1 = require('../../modules/progress/actions'); |
7 | 23 | var pageStyle = {
|
8 | 24 | width: '100%',
|
9 | 25 | };
|
10 | 26 | var listStyle = {
|
11 | 27 | margin: '5px',
|
12 | 28 | };
|
13 |
| -var Progress = function (_a) { |
14 |
| - var progress = _a.progress, pagePosition = _a.pagePosition, info = _a.info, tutorial = _a.tutorial; |
15 |
| - return (React.createElement(Paper_1.default, {style: pageStyle}, React.createElement(List_1.List, {style: listStyle}, React.createElement(Subheader_1.default, null, info.name), tutorial.pages.map(function (page, index) { return (React.createElement(ProgressPage_1.default, {key: index, index: index, page: page, pagePosition: pagePosition, progress: progress})); })))); |
16 |
| -}; |
| 29 | +var Progress = (function (_super) { |
| 30 | + __extends(Progress, _super); |
| 31 | + function Progress() { |
| 32 | + _super.apply(this, arguments); |
| 33 | + } |
| 34 | + Progress.prototype.componentWillMount = function () { |
| 35 | + this.props.progressLoad(); |
| 36 | + }; |
| 37 | + Progress.prototype.render = function () { |
| 38 | + var _a = this.props, progress = _a.progress, pagePosition = _a.pagePosition, info = _a.info, tutorial = _a.tutorial; |
| 39 | + return (React.createElement(Paper_1.default, {style: pageStyle}, React.createElement(List_1.List, {style: listStyle}, React.createElement(Subheader_1.default, null, info.name), tutorial.pages.map(function (page, index) { return (React.createElement(ProgressPage_1.default, {key: index, index: index, page: page, pagePosition: pagePosition, progress: progress})); })))); |
| 40 | + }; |
| 41 | + Progress = __decorate([ |
| 42 | + react_redux_1.connect(null, function (dispatch) { |
| 43 | + return { |
| 44 | + progressLoad: function () { return dispatch(actions_1.progressLoad()); } |
| 45 | + }; |
| 46 | + }), |
| 47 | + __metadata('design:paramtypes', []) |
| 48 | + ], Progress); |
| 49 | + return Progress; |
| 50 | +}(React.Component)); |
17 | 51 | Object.defineProperty(exports, "__esModule", { value: true });
|
18 | 52 | exports.default = Progress;
|
0 commit comments