Skip to content

Commit

Permalink
yum yum drag? WIP
Browse files Browse the repository at this point in the history
cuz it doesnt work yet
  • Loading branch information
ThatXliner committed Feb 22, 2024
1 parent 6b3b97e commit db8990b
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 356 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ next-env.d.ts
# expo
.expo/
dist/
expo-env.d.ts
apps/expo/.gitignore

# production
Expand Down
19 changes: 18 additions & 1 deletion apps/nextjs/src/app/dashboard/Assignments.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use client";

import { useState } from "react";
import { Metadata } from "next";
import Image from "next/image";
import { Button } from "@/components/ui/button";
Expand Down Expand Up @@ -34,8 +35,24 @@ const tags = Array.from({ length: 50 }).map(
);

export default function Assignments() {
const [activeId, setActiveId] = useState(null);
// const [parent, setParent] = useState(null);
return (
<DndContext>
<DndContext
onDragStart={function handleDragStart(event) {
const { active } = event;
console.log("start", active);
setActiveId(active?.id);
}}
onDragEnd={function handleDragEnd(event) {
const { over } = event;
console.log("end", activeId, over);
setActiveId(null);
// If the item is dropped over a container, set it as the parent
// otherwise reset the parent to `null`
// setParent(over ? over.id : null);
}}
>
<ResizablePanelGroup
direction="horizontal"
className="max-w-screen h-rounded-lg h-full border"
Expand Down
8 changes: 4 additions & 4 deletions apps/nextjs/src/app/dashboard/components/cards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ import { DragOverlay, useDraggable, useDroppable } from "@dnd-kit/core";

// XXX: Properly conform to database types
export function MemberCard({ user }: { user: string }) {
// const { isOver, setNodeRef } = useDroppable({
// id: user,
// });
const { isOver, setNodeRef } = useDroppable({
id: user,
});
return (
// <DragOverlay>
<Card className="h-fit w-fit">
<Card className="h-fit w-fit" ref={setNodeRef}>
<CardHeader>
<CardTitle>
<Avatar className="h-8 w-8">
Expand Down
Loading

0 comments on commit db8990b

Please sign in to comment.