feat: Integrate forum layout support across various components and enhance room handling logic

This commit is contained in:
2026-07-06 01:06:20 +10:00
parent d1626e3585
commit c57797ffe4
62 changed files with 6876 additions and 385 deletions

View File

@@ -11,14 +11,15 @@ export const useFileDropHandler = (onDrop: (file: File[]) => void): DragEventHan
);
export const useFileDropZone = (
zoneRef: RefObject<HTMLElement>,
zoneRef: RefObject<HTMLElement> | undefined,
onDrop: (file: File[]) => void
): boolean => {
const dragStateRef = useRef<'start' | 'leave' | 'over'>();
const [active, setActive] = useState(false);
useEffect(() => {
const target = zoneRef.current;
const target = zoneRef?.current;
if (!target) return undefined;
const handleDrop = (evt: DragEvent) => {
evt.preventDefault();
dragStateRef.current = undefined;
@@ -35,7 +36,9 @@ export const useFileDropZone = (
}, [zoneRef, onDrop]);
useEffect(() => {
const target = zoneRef.current;
const target = zoneRef?.current;
if (!target) return undefined;
const handleDragEnter = (evt: DragEvent) => {
if (evt.dataTransfer?.types.includes('Files')) {
dragStateRef.current = 'start';