mirror of
https://git.rezel.net/LudoTech/traque.git
synced 2026-02-09 10:20:16 +01:00
Ajout zones en pavage + fix dockefiles
This commit is contained in:
@@ -1,14 +1,12 @@
|
||||
"use client";
|
||||
import useAdmin from '@/hook/useAdmin';
|
||||
import { DragDropContext, Draggable, Droppable } from '@hello-pangea/dnd';
|
||||
import React from 'react'
|
||||
|
||||
const reorder = (list, startIndex, endIndex) => {
|
||||
const result = Array.from(list);
|
||||
const [removed] = result.splice(startIndex, 1);
|
||||
result.splice(endIndex, 0, removed);
|
||||
|
||||
return result;
|
||||
function reorder(list, startIndex, endIndex) {
|
||||
const result = Array.from(list);
|
||||
const [removed] = result.splice(startIndex, 1);
|
||||
result.splice(endIndex, 0, removed);
|
||||
return result;
|
||||
};
|
||||
|
||||
function TeamListItem({ team, index, onSelected, itemSelected }) {
|
||||
@@ -24,11 +22,12 @@ function TeamListItem({ team, index, onSelected, itemSelected }) {
|
||||
|
||||
)}
|
||||
</Draggable>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
export default function TeamList({selectedTeamId, onSelected}) {
|
||||
const {teams, reorderTeams} = useAdmin();
|
||||
|
||||
function onDragEnd(result) {
|
||||
if (!result.destination) {
|
||||
return;
|
||||
@@ -46,6 +45,7 @@ export default function TeamList({selectedTeamId, onSelected}) {
|
||||
|
||||
reorderTeams(newTeams);
|
||||
}
|
||||
|
||||
return (
|
||||
<DragDropContext onDragEnd={onDragEnd} >
|
||||
<Droppable droppableId='team-list'>
|
||||
@@ -61,5 +61,5 @@ export default function TeamList({selectedTeamId, onSelected}) {
|
||||
)}
|
||||
</Droppable>
|
||||
</DragDropContext>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user