mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 15:48:32 -06:00
working pages and app router
This commit is contained in:
21
nextjs-pages/src/components/contexts/draggingContext.tsx
Normal file
21
nextjs-pages/src/components/contexts/draggingContext.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
"use client";
|
||||
import { IModuleItem } from "@/models/local/IModuleItem";
|
||||
import { createContext, useContext, DragEvent } from "react";
|
||||
|
||||
export interface DraggableItem {
|
||||
item: IModuleItem;
|
||||
sourceModuleName: string;
|
||||
type: "quiz" | "assignment" | "page";
|
||||
}
|
||||
|
||||
export interface DraggingContextInterface {
|
||||
itemDrop: (e: DragEvent<HTMLDivElement>,droppedOnDay?: string) => void;
|
||||
}
|
||||
const defaultDraggingValue: DraggingContextInterface = {
|
||||
itemDrop: () => { },
|
||||
};
|
||||
export const DraggingContext = createContext<DraggingContextInterface>(defaultDraggingValue);
|
||||
|
||||
export function useDraggingContext() {
|
||||
return useContext(DraggingContext);
|
||||
}
|
||||
Reference in New Issue
Block a user