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;

‎lib/components/AppMenu/CloseWindow.js‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ var React = require('react');
1717
var react_redux_1 = require('react-redux');
1818
var IconButton_1 = require('material-ui/IconButton');
1919
var close_1 = require('material-ui/svg-icons/navigation/close');
20+
var actions_1 = require('../../actions');
2021
var CloseWindow = (function (_super) {
2122
__extends(CloseWindow, _super);
2223
function CloseWindow() {
@@ -26,11 +27,9 @@ var CloseWindow = (function (_super) {
2627
return (React.createElement(IconButton_1.default, {onClick: this.props.windowToggle}, React.createElement(close_1.default, {color: 'white'})));
2728
};
2829
CloseWindow = __decorate([
29-
react_redux_1.connect(null, function (dispatch) {
30-
return {
31-
windowToggle: function () { return dispatch({ type: 'WINDOW_TOGGLE' }); }
32-
};
33-
}),
30+
react_redux_1.connect(null, function (dispatch) { return ({
31+
windowToggle: function () { return dispatch(actions_1.windowToggle()); },
32+
}); }),
3433
__metadata('design:paramtypes', [])
3534
], CloseWindow);
3635
return CloseWindow;

‎lib/components/AppMenu/MenuLink/index.js‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,9 @@ var MenuLink = (function (_super) {
3131
return (React.createElement(MenuItem_1.default, {style: styles, primaryText: title ? title : route, onTouchTap: routeTo.bind(this, route), key: route}));
3232
};
3333
MenuLink = __decorate([
34-
react_redux_1.connect(null, function (dispatch) {
35-
return {
36-
routeTo: function (route) { return dispatch(actions_1.routeSet(route)); },
37-
};
38-
}),
34+
react_redux_1.connect(null, function (dispatch) { return ({
35+
routeTo: function (route) { return dispatch(actions_1.routeSet(route)); },
36+
}); }),
3937
__metadata('design:paramtypes', [])
4038
], MenuLink);
4139
return MenuLink;

0 commit comments

Comments
 (0)
This repository has been archived.