mirror of
https://github.com/penpot/penpot.git
synced 2025-05-23 04:56:20 +02:00
✨ Allows drag-drop files into dashboard
This commit is contained in:
parent
1894fc7cfa
commit
60009476d6
10 changed files with 169 additions and 52 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
(ns app.main.ui.dashboard.file-menu
|
||||
(:require
|
||||
[app.common.data :as d]
|
||||
[app.main.data.dashboard :as dd]
|
||||
[app.main.data.messages :as dm]
|
||||
[app.main.data.modal :as modal]
|
||||
|
@ -155,12 +156,22 @@
|
|||
:on-accept del-shared})))
|
||||
|
||||
on-export-files
|
||||
(fn [_]
|
||||
(st/emit!
|
||||
(modal/show
|
||||
{:type :export
|
||||
:team-id current-team-id
|
||||
:files (->> files (mapv :id))})))]
|
||||
(mf/use-callback
|
||||
(mf/deps files current-team-id)
|
||||
(fn [_]
|
||||
(->> (rx/from files)
|
||||
(rx/flat-map
|
||||
(fn [file]
|
||||
(->> (rp/query :file-libraries {:file-id (:id file)})
|
||||
(rx/map #(assoc file :has-libraries? (d/not-empty? %))))))
|
||||
(rx/reduce conj [])
|
||||
(rx/subs
|
||||
(fn [files]
|
||||
(st/emit!
|
||||
(modal/show
|
||||
{:type :export
|
||||
:team-id current-team-id
|
||||
:files (->> files (mapv :id))})))))))]
|
||||
|
||||
(mf/use-effect
|
||||
(fn []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue