Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Commit bc22661

Browse files
committedJun 8, 2016
restructure with connected components
·
v0.13.3v0.10.0
1 parent 339fe6a commit bc22661

File tree

52 files changed

+388
-389
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+388
-389
lines changed
 

‎lib/components/common/Alert.js renamed to ‎lib/components/Alert/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ var Alert = (function (_super) {
3636
return (React.createElement(Snackbar_1.default, {style: styles, bodyStyle: { color: color }, open: open, message: message || '', action: action || '', autoHideDuration: duration || 2000, onActionTouchTap: close, onRequestClose: close}));
3737
};
3838
Alert = __decorate([
39-
react_redux_1.connect(null, function (dispatch) {
40-
return {
41-
close: function () { return dispatch(actions_1.alertClose()); }
42-
};
43-
}),
39+
react_redux_1.connect(function (state) { return ({
40+
alert: state.alert,
41+
}); }, function (dispatch) { return ({
42+
close: function () { return dispatch(actions_1.alertClose()); },
43+
}); }),
4444
__metadata('design:paramtypes', [])
4545
], Alert);
4646
return Alert;

‎lib/components/App.js

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@ var __extends = (this && this.__extends) || function (d, b) {
44
function __() { this.constructor = d; }
55
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
66
};
7-
var __assign = (this && this.__assign) || Object.assign || function(t) {
8-
for (var s, i = 1, n = arguments.length; i < n; i++) {
9-
s = arguments[i];
10-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11-
t[p] = s[p];
12-
}
13-
return t;
14-
};
157
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
168
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
179
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -32,13 +24,13 @@ var App = (function (_super) {
3224
_super.apply(this, arguments);
3325
}
3426
App.prototype.render = function () {
35-
var store = this.props.store;
36-
return (React.createElement("section", null, React.createElement(Drawer_1.default, {width: 400, openSecondary: true, open: store.windowToggle}, React.createElement("div", {className: 'cr-bg'}, React.createElement(index_1.AppMenu, __assign({}, store)), React.createElement(Routes_1.default, __assign({}, store)))), React.createElement(index_1.Alert, __assign({}, store))));
27+
var windowToggle = this.props.windowToggle;
28+
return (React.createElement("section", null, React.createElement(Drawer_1.default, {width: 400, openSecondary: true, open: windowToggle}, React.createElement("div", {className: 'cr-bg'}, React.createElement(index_1.AppMenu, null), React.createElement(Routes_1.default, null))), React.createElement(index_1.Alert, null)));
3729
};
3830
App = __decorate([
39-
react_redux_1.connect(function (store) {
40-
return { store: store };
41-
}),
31+
react_redux_1.connect(function (state) { return ({
32+
windowToggle: state.windowToggle,
33+
}); }),
4234
__metadata('design:paramtypes', [])
4335
], App);
4436
return App;

0 commit comments

Comments
 (0)
This repository has been archived.