Skip to content

Commit

Permalink
removed pointer sensor
Browse files Browse the repository at this point in the history
  • Loading branch information
MacielG1 committed Nov 29, 2023
1 parent e94f17e commit fd83367
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,15 @@ import SidebarItem from "./SidebarItem";
export default function Sidebar() {
const [savedWorkouts, setSavedWorkouts] = useStore((state) => [state.savedWorkouts, state.setSavedWorkouts]);

const pointerSensor = useSensor(PointerSensor, {
activationConstraint: {
distance: 8,
},
});
// const pointerSensor = useSensor(PointerSensor);
const touchSensor = useSensor(TouchSensor, {
activationConstraint: {
delay: 250,
tolerance: 5,
},
});

const sensors = useSensors(pointerSensor, touchSensor);
const sensors = useSensors(touchSensor);

function handleDragEnd(e: DragEndEvent) {
const { active, over } = e;
Expand All @@ -41,7 +37,7 @@ export default function Sidebar() {
<aside className="mx-auto mt-5 flex max-w-fit justify-center xl:mt-4 min-[1360px]:fixed 2xl:mt-9 2xl:pl-1 ">
<section className="2xl-px-4 flex flex-col gap-6 py-1 2xl:px-2">
<div className="max-h-[95vh] pr-1 xl:overflow-y-auto 2xl:pr-2">
<SortableContext items={savedWorkouts}>
<SortableContext items={savedWorkouts} id="items">
{savedWorkouts.map((i) => (
<SidebarItem key={i.id} item={i} />
))}
Expand Down

0 comments on commit fd83367

Please sign in to comment.