Conversation
This is a bummer and I wonder if we want to convert the FileNode first? There’s definitely an open PR for that, though I recall that it had a minor issue with the dropdown. I have adjustments that I would want to make here but I’m on vacation this weekend so I’ll get back to you with more details later. |
| if (this.props.fileType === 'folder') { | ||
| e.target.parentNode.parentNode.style.border = null; | ||
| } else if (this.props.fileType === 'file') { | ||
| e.target.parentNode.parentNode.parentNode.parentNode.parentNode.style.border = null; |
There was a problem hiding this comment.
We want to avoid direct manipulation of styles and instead set some state somewhere which controls the style. I’m also concerned that the number of parent levels that we need to go up by might depend on where this specific file I in the tree, and could be incorrect if it’s a few levels deep.
That is definitely the way to go. This way we can take advantage of all the little developer experience features of react dnd as well. This will also fix the issue you talked about in the commit comment as well, since all the styling will be handled differently in react-dnd. It'll also make it eaiser for everyone if in the future the dnd implementation has to be improved upon or modified. And I'd be down to work on this feature with react-dnd and other modifications after the FileNode has been updated. Till then enjoy your vacation :) |
|
@lindapaiste can i take the issue of converting to functional components(covert to FileNode)
|
|
Since it's been a while since this PR has been last active, I'm going to close this for now. I'm sorry that we couldn't get this in, but please feel free to revisit this issue! |
Fixes #1417
Changes:
Ui Changes:
HTML Drag and Drop APIReact DnDas initially planned because it does not support class components (FileNode.jsx)Redux Changes:
changeParentfile stateSaving the sketch reflects the state changes in the database as well.
p5.js.Web.Editor._.Cheerful.work.-.Personal.-.Microsoft.Edge.2024-02-08.21-04-41.mp4
I have verified that this pull request:
npm run lint)npm run test)developbranch.Fixes #123