-
Notifications
You must be signed in to change notification settings - Fork 251
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
Conversation
tony056
commented
Jul 10, 2018
- Changes:
- Added remove button to PropertyGroup.
- Added RemoveComponentCommand.
- Pushed the remove button to the right in PropertyGroup.scss
There was a problem hiding this 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") { |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Remove button for components