Use dnd-kit instead of beautiful-dnd

This commit is contained in:
Tienson Qin
2023-10-04 09:35:05 +08:00
parent 8541f85389
commit b44e4d7d1f
7 changed files with 157 additions and 229 deletions

View File

@@ -122,16 +122,13 @@
(let [name (:block/name e)
icon (get-page-icon e)]
{:id (str (:db/id e))
:content (page-name name icon false)}))
:value name
:content [:li.favorite-item (page-name name icon false)]}))
favorite-entities)]
(dnd-component/items favorites
{:droppable-id "favorites-droppable"
:on-drag-end (fn [{:keys [source destination]}]
(page-handler/reorder-favorites!
{:target (:index source)
:to (:index destination)}))
:parent-node :ul.favorites.text-sm
:child-node :li.favorite-item}))))))
{:on-drag-end (fn [favorites]
(page-handler/reorder-favorites! favorites))
:parent-node :ul.favorites.text-sm}))))))
(rum/defc recent-pages < rum/reactive db-mixins/query
[t]