Skip to content

Commit 4e4528e

Browse files
Refactoring
1 parent 9578b2f commit 4e4528e

16 files changed

Lines changed: 172 additions & 116 deletions

File tree

example-project/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import tabs from './views/tabs';
2-
import dataModel from './data/model';
2+
import dataModel from './dataModel/model';
33

44
const App = {
55
init() {
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
import move from '../zoom/move';
2+
13
export default () => Promise.resolve({ data: [] });
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/**
2+
* Created by bliashenko on 2018-06-07.
3+
*/
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
export default 'HOME_PAGE';
1+
import stringFormat from '../../utils/string/format/string';
2+
export default 'HOME_PAGE';

example-project/zoom/move.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/**
2+
* Created by bliashenko on 2018-06-07.
3+
*/

src/public/dist/bundle.js

Lines changed: 96 additions & 60 deletions
Large diffs are not rendered by default.

src/public/dist/bundle.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/public/js/components/controls/ViewSwitches/ViewSwitchesContainer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import { toggleSwitch, fireButtonAction } from './store/actions';
44
import { CONTROLS_KEYS } from './store/constants';
55

66
const mapStateToProps = state => {
7-
const { switches, checkedState, hiddenState } = state.viewSwitches;
7+
const { switches, checkedState, disabledState } = state.viewSwitches;
88

9-
return { switches, checkedState, hiddenState };
9+
return { switches, checkedState, disabledState };
1010
};
1111

1212
const mapDispatchToProps = {

src/public/js/components/controls/ViewSwitches/component/ViewSwitchList.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
border-right: 1px solid #ebedf0;
2626
border-left: 1px solid #ebedf0;
2727
padding: 8px 8px 8px 8px;
28+
min-height: 42px;
2829
}
2930

3031
.ViewSwitchList-small-item {

src/public/js/components/controls/ViewSwitches/component/ViewsSwitchList.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,17 @@ import './ViewSwitchList.css';
44
import { VIEW_TYPES } from '../store/constants';
55

66
class ViewsSwitchList extends React.Component {
7-
renderChildren(children) {
7+
renderChildren(controls) {
88
const {
99
toggleSwitch,
1010
checkedState,
11-
hiddenState,
11+
disabledState,
1212
fireButtonAction
1313
} = this.props;
1414

15-
const visibleControls = children.filter(
16-
child => !hiddenState[child.key]
17-
);
18-
19-
if (!visibleControls.length) return null;
20-
2115
return (
2216
<div className="ViewSwitchList-small-group">
23-
{visibleControls.map((item, i) => {
17+
{controls.map((item, i) => {
2418
return (
2519
<div
2620
key={item.key}
@@ -30,6 +24,7 @@ class ViewsSwitchList extends React.Component {
3024
<Button
3125
title={item.title}
3226
size={'small'}
27+
disabled={disabledState[item.key]}
3328
onClick={() => fireButtonAction(item.key)}
3429
>
3530
<span title={item.title}>{item.name}</span>

0 commit comments

Comments
 (0)