mirror of
https://github.com/spacedriveapp/spacedrive.git
synced 2026-04-21 15:07:54 -04:00
* locations dnd * fix icon * reduce navigate timeout * fix types * another * fix drag overlay count * Update pnpm-lock.yaml * merge * ephemeral support and other improvements * merge * Tag dnd * merge * type * merge * remove offset * update dnd logic to not depend on drag source * handle allowed types if parent isn't available * saved searches dnd navigation * well * rendering * Update pnpm-lock.yaml * types * remove width * Temporary solution * merge * @dnd-kit/utilities * Update pnpm-lock.yaml * explorer path dnd * remove unused drag hook * fix dnd on LayeredFileIcon --------- Co-authored-by: Brendan Allan <brendonovich@outlook.com>
23 lines
545 B
TypeScript
23 lines
545 B
TypeScript
import { createContext, useContext, type ReactNode, type RefObject } from 'react';
|
|
|
|
export interface ExplorerViewContext {
|
|
ref: RefObject<HTMLDivElement>;
|
|
top?: number;
|
|
bottom?: number;
|
|
contextMenu?: ReactNode;
|
|
selectable: boolean;
|
|
listViewOptions?: {
|
|
hideHeaderBorder?: boolean;
|
|
};
|
|
}
|
|
|
|
export const ViewContext = createContext<ExplorerViewContext | null>(null);
|
|
|
|
export const useExplorerViewContext = () => {
|
|
const ctx = useContext(ViewContext);
|
|
|
|
if (ctx === null) throw new Error('ViewContext.Provider not found!');
|
|
|
|
return ctx;
|
|
};
|