react-folder-tree
react-folder-tree copied to clipboard
Add Custom new file icon and new folder icon
I would like to customize the new file icon and the folder icon, so that when I press them I can show my dialog window, instead than creating the default file named "new file" and the default folder. Also, it would be great if the event state contains the path of the new file/folder created. Is that possible?
I would like to customize the new file icon and the folder icon
I think something like this should work?
const FileIcon = ({ onClick: defaultOnClick, nodeData }) => {
const handleClick = () => {
showDialogWindow(); // depends on how the dialog window is implemented
};
return <FaBitcoin onClick={ handleClick } />;
};
Also, it would be great if the event state contains the path of the new file/folder created.
Thanks for the suggestion, will add it as a enhancement in later versions
I would like to customize the new file icon and the folder icon
I think something like this should work?
const FileIcon = ({ onClick: defaultOnClick, nodeData }) => { const handleClick = () => { showDialogWindow(); // depends on how the dialog window is implemented }; return <FaBitcoin onClick={ handleClick } />; };
I explained myself badly here, I want to customize the "New file" and "New folder" icon that appears when you click on a folder:
Is it possible?