react-sortable-tree icon indicating copy to clipboard operation
react-sortable-tree copied to clipboard

Add icon in node renderer

Open BBE78 opened this issue 4 years ago • 9 comments

Requesting a Feature?

Provide a way to add an icon in a node

BBE78 avatar Jan 22 '21 18:01 BBE78

Implementation available in pull request https://github.com/frontend-collective/react-sortable-tree/pull/861 image

BBE78 avatar Jan 23 '21 17:01 BBE78

Did you try to use generateNodeProps for that? Maybe just emit subtitle and use title (ReactNode is type) as your icon + some other parts...

oglisa-dev avatar Mar 19 '21 00:03 oglisa-dev

Nop, do you have a capture of the result of this solution?

BBE78 avatar Mar 19 '21 18:03 BBE78

I don't know how you got this project to work, but I'd love to see a code dump/pen/sandbox !!!

ajoslin103 avatar Mar 23 '21 22:03 ajoslin103

I don't know how you got this project to work, but I'd love to see a code dump/pen/sandbox !!!

Hi @ajoslin103, this is available in the Pull Request #861.

BBE78 avatar Mar 25 '21 20:03 BBE78

Apologies for being unclear - I cannot get this library to even start in my ElectronJS+React+Typescript project (built on this boilerplate: https://github.com/Robinfr/electron-react-typescript) I was hoping that someone had something running with react 16.8

ajoslin103 avatar Mar 25 '21 23:03 ajoslin103

Apologies for being unclear - I cannot get this library to even start in my ElectronJS+React+Typescript project (built on this boilerplate: https://github.com/Robinfr/electron-react-typescript) I was hoping that someone had something running with react 16.8

I am currently using this library in my project that is using React ^16.8.0 as dependency.
Maybe there is problem with new versions and features of typescript , currently I am using ^4.1.2 and also: "@types/react-sortable-tree": "^0.3.12", "@types/react-sortable-tree-theme-file-explorer": "^0.0.0"

Everything is working fine for me. Just I am not using suggesting (theirs) function for recursive updates of tree, make yourself good ones.

oglisa-dev avatar Mar 28 '21 18:03 oglisa-dev

Nop, do you have a capture of the result of this solution?

You can do it in many ways, choice is left to you for implementation details. Here is a quick ss to take a look: image

oglisa-dev avatar Mar 28 '21 18:03 oglisa-dev

@glisA99 Can you show code for this example?

55Cancri avatar Nov 25 '21 01:11 55Cancri