Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove button for components #37

Merged
merged 4 commits into from
Jul 10, 2018
Merged

Conversation

tony056
Copy link
Contributor

@tony056 tony056 commented Jul 10, 2018

  • Changes:
    • Added remove button to PropertyGroup.
    • Added RemoveComponentCommand.
    • Pushed the remove button to the right in PropertyGroup.scss

Copy link
Contributor

@brianpeiris brianpeiris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of comments. LGTM otherwise!

export default function PropertyGroup({ name, children }) {
export default function PropertyGroup({ name, removeHandler, children }) {
const displayRemoveButton = (name, removeHandler) => {
if (name === "Node") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add a removable property instead of basing this on name.

undo() {
this.editor.addComponent(this.object, this.componentName);
this.object.traverse(child => {
this.editor.addHelper(child);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addHelper needs a selectionRoot parameter. this.object should work.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, actually, it looks like addComponent already takes care of adding helpers.

Copy link
Contributor

@brianpeiris brianpeiris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@tony056 tony056 merged commit 3c49033 into master Jul 10, 2018
@tony056 tony056 deleted the features/remove-component-btn branch July 10, 2018 22:13
@tony056 tony056 mentioned this pull request Jul 10, 2018
robertlong pushed a commit that referenced this pull request Aug 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants