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

Add Custom new file icon and new folder icon

Open NicolaLovo opened this issue 2 years ago • 3 comments

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?

NicolaLovo avatar Jun 18 '22 10:06 NicolaLovo

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 } />;
  };

shunjizhan avatar Jun 19 '22 07:06 shunjizhan

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

shunjizhan avatar Jun 19 '22 07:06 shunjizhan

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: image Is it possible?

NicolaLovo avatar Jun 19 '22 09:06 NicolaLovo