From db1ce45cd2618f4be133da92343fca203db3c814 Mon Sep 17 00:00:00 2001 From: Shusui MOYATANI Date: Tue, 30 Jan 2024 12:36:38 +0900 Subject: [PATCH] feat: draggable column --- src/components/SideBar.tsx | 64 +++++++++++++++++++++++++++++++++++--- src/core/useConfig.ts | 7 +++++ 2 files changed, 66 insertions(+), 5 deletions(-) diff --git a/src/components/SideBar.tsx b/src/components/SideBar.tsx index a2d0f44..94cfa23 100644 --- a/src/components/SideBar.tsx +++ b/src/components/SideBar.tsx @@ -10,6 +10,16 @@ import { createMemo, } from 'solid-js'; +import { + DragDropProvider, + DragDropSensors, + DragEventHandler, + SortableProvider, + createSortable, + closestCenter, + useDragDropContext, + type Transformer, +} from '@thisbeyond/solid-dnd'; import Bell from 'heroicons/24/outline/bell.svg'; import BookmarkIcon from 'heroicons/24/outline/bookmark.svg'; import ChatBubbleLeftRight from 'heroicons/24/outline/chat-bubble-left-right.svg'; @@ -149,6 +159,8 @@ const columns: Readonly = (props) => { const i18n = useTranslation(); + const sortable = createSortable(props.column.id); + const request = useRequestCommand(); const jumpToColumn = () => { request({ @@ -162,7 +174,12 @@ const ColumnButton: Component<{ column: ColumnType; index: number }> = (props) = return (