Skip to content

Commit 7fcd2e1

Browse files
fix(FileItem): disable "info" when the item is a folder
1 parent dc3ba86 commit 7fcd2e1

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "next-gdrive-index",
3-
"version": "2.4.2",
3+
"version": "0.0.1",
44
"private": true,
55
"type": "module",
66
"scripts": {

src/components/explorer/FileItem.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ const FileItemActions = ({
304304
<Icon name="Link" className="mr-2 h-4 w-4" />
305305
<span>Copy Link</span>
306306
</DropdownMenuItem>
307-
<DropdownMenuItem onSelect={onShowInfo}>
307+
<DropdownMenuItem onSelect={onShowInfo} disabled={isFolder}>
308308
<Icon name="Info" className="mr-2 h-4 w-4" />
309309
<span>Info</span>
310310
</DropdownMenuItem>
@@ -525,7 +525,10 @@ export const FileItem = ({ data: file, layout }: Props) => {
525525
<Icon name="Link" className="mr-2 h-4 w-4" />
526526
<span>Copy Link</span>
527527
</ContextMenuItem>
528-
<ContextMenuItem onSelect={actionProps.onShowInfo}>
528+
<ContextMenuItem
529+
onSelect={actionProps.onShowInfo}
530+
disabled={actionProps.isFolder}
531+
>
529532
<Icon name="Info" className="mr-2 h-4 w-4" />
530533
<span>Info</span>
531534
</ContextMenuItem>

0 commit comments

Comments
 (0)