Skip to content
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

Show toolbar only in clicked folders #100

Open
KangSeungKu opened this issue Nov 23, 2023 · 1 comment
Open

Show toolbar only in clicked folders #100

KangSeungKu opened this issue Nov 23, 2023 · 1 comment

Comments

@KangSeungKu
Copy link

I want to display the toolbar only in the clicked folder, is there a way?

Thank you.

@jzarei1996
Copy link

jzarei1996 commented Dec 13, 2023

Hi @KangSeungKu .
Yes. The solution for your needs is to customize the default wherever you don't want it and disable the defaultOnClick() function. I think you should do these two things:

`
const onNameClick = ({ defaultOnClick, nodeData }) => {
// defaultOnClick();
.....
};

const FileIcon = ({ onClick: defaultOnClick, nodeData }) => {
const { path, name, checked, isOpen, ...restData } = nodeData;

// custom event handler
const handleClick = () => {
// defaultOnClick();
};

// custom Style
return <FaBitcoin onClick={ handleClick } />;
};

<FolderTree
data={}
onChange={onTreeStateChange}
iconComponents={{
FileIcon,
}}
onNameClick={onNameClick}
/>
`

I hope this solution helps you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants