mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 23:58:31 -06:00
moving v2 to top level
This commit is contained in:
24
src/app/course/[courseName]/context/drag/draggingContext.tsx
Normal file
24
src/app/course/[courseName]/context/drag/draggingContext.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
"use client";
|
||||
import { IModuleItem } from "@/models/local/IModuleItem";
|
||||
import { createContext, useContext, DragEvent } from "react";
|
||||
|
||||
export interface DraggableItem {
|
||||
item: IModuleItem;
|
||||
sourceModuleName: string | undefined; // undefined for lectures
|
||||
type: "quiz" | "assignment" | "page" | "lecture";
|
||||
}
|
||||
|
||||
export interface DraggingContextInterface {
|
||||
itemDropOnDay: (e: DragEvent, droppedOnDay: string) => void;
|
||||
itemDropOnModule: (e: DragEvent, moduleName: string) => void;
|
||||
}
|
||||
const defaultDraggingValue: DraggingContextInterface = {
|
||||
itemDropOnDay: () => {},
|
||||
itemDropOnModule: () => {},
|
||||
};
|
||||
export const DraggingContext =
|
||||
createContext<DraggingContextInterface>(defaultDraggingValue);
|
||||
|
||||
export function useDraggingContext() {
|
||||
return useContext(DraggingContext);
|
||||
}
|
||||
Reference in New Issue
Block a user