Skip to content

Commit

Permalink
🔨 Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
timmo001 committed Feb 23, 2019
1 parent 9ee3de6 commit 16926e8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Components/EditConfig/EditGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class EditGroup extends React.PureComponent {
</DialogActions>
{confirm &&
<ConfirmDialog
text="Do you want to delete this card?"
text="Do you want to delete this group?"
handleClose={this.handleDeleteConfirmClose}
handleConfirm={this.handleDelete} />
}
Expand Down
2 changes: 1 addition & 1 deletion src/Components/EditConfig/EditPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class EditPage extends React.PureComponent {
</DialogActions>
{confirm &&
<ConfirmDialog
text="Do you want to delete this card?"
text="Do you want to delete this page?"
handleClose={this.handleDeleteConfirmClose}
handleConfirm={this.handleDelete} />
}
Expand Down
12 changes: 10 additions & 2 deletions src/Components/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class Main extends React.PureComponent {
handleEditingComplete = () => this.setState({ editing: false });

handleConfigChange = (path, value) => {
console.log(clone(path), clone(value));
console.log('handleConfigChange', clone(path), clone(value));
let config = clone(this.props.config);
// Set the new value
const lastItem = path.pop();
Expand All @@ -122,10 +122,12 @@ class Main extends React.PureComponent {
this.props.handleConfigChange(config);
};

handleCardAdd = (groupId, cardId) =>
handleCardAdd = (groupId, cardId) => {
console.log('defaultConfig', clone(defaultConfig));
this.setState({
addingCard: { groupId, cardId, card: clone(defaultConfig).items[0].cards[0] }
});
};

handleCardEdit = (groupId, cardId, card) =>
this.setState({ editingCard: { groupId, cardId, card: clone(card) } });
Expand All @@ -144,31 +146,37 @@ class Main extends React.PureComponent {
this.setState({ editingGroup: { groupId, group: clone(group) } });

handleCardAddDone = (path, card) => {
console.log('handleCardAddDone', path, card);
path && this.handleConfigChange(path, clone(card));
this.setState({ addingCard: undefined });
};

handleCardEditDone = (path, card) => {
console.log('handleCardEditDone', path, card);
path && this.handleConfigChange(path, clone(card));
this.setState({ editingCard: undefined });
};

handlePageAddDone = (id, page) => {
console.log('handlePageAddDone', id, page);
id && this.handleConfigChange(['pages', id], clone(page));
this.setState({ addingPage: undefined });
};

handlePageEditDone = (id, page) => {
console.log('handlePageEditDone', id, page);
id && this.handleConfigChange(['pages', id], clone(page));
this.setState({ editingPage: undefined });
};

handleGroupAddDone = (id, group) => {
console.log('handleGroupAddDone', id, group);
id && this.handleConfigChange(['items', id], clone(group));
this.setState({ addingGroup: undefined });
};

handleGroupEditDone = (id, group) => {
console.log('handleGroupEditDone', id, group);
id && this.handleConfigChange(['items', id], clone(group));
this.setState({ editingGroup: undefined });
};
Expand Down

0 comments on commit 16926e8

Please sign in to comment.