the big refactor 2: ObjID

This commit is contained in:
2021-09-28 16:07:00 +02:00
parent dc4133a705
commit 3e8fbb01bb
22 changed files with 1096 additions and 952 deletions

View File

@@ -1,6 +1,6 @@
import React from "react"
import { Item, ItemParams, Menu, Separator } from "react-contexify"
import ObjID from "../types/ObjID"
export const CONTEXT_MENU_FILE = "CONTEXT_MENU_FILE"
export const CONTEXT_MENU_DIR = "CONTEXT_MENU_DIR"
@@ -16,12 +16,12 @@ export enum Action {
}
interface Props {
onSelect?: (action: Action, id: string)=>void
onSelect?: (action: Action, id: ObjID)=>void
pasteActive?: boolean
}
const FileBrowserContextMenu: React.FC<Props> = (props) => {
function onClick({ props: itemProps, data }: ItemParams<{id:string}, Action>) {
function onClick({ props: itemProps, data }: ItemParams<{id:ObjID}, Action>) {
if (itemProps?.id && data != null){
props.onSelect?.(data,itemProps.id)
}