Support right click to use file context menu

This commit is contained in:
Dane Everitt 2020-07-11 11:12:59 -07:00
parent 6188b9287c
commit 117c1b1778
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
4 changed files with 94 additions and 49 deletions

View file

@ -37,7 +37,13 @@ const FileObjectRow = ({ file }: { file: FileObject }) => {
};
return (
<Row key={file.name}>
<Row
key={file.name}
onContextMenu={e => {
e.preventDefault();
window.dispatchEvent(new CustomEvent(`pterodactyl:files:ctx:${file.uuid}`, { detail: e.clientX }));
}}
>
<NavLink
to={`${match.url}/${file.isFile ? 'edit/' : ''}#${cleanDirectoryPath(`${directory}/${file.name}`)}`}
css={tw`flex flex-1 text-neutral-300 no-underline p-3`}