mirror of
https://github.com/penpot/penpot.git
synced 2025-06-10 21:01:38 +02:00
Merge pull request #2189 from penpot/palba-componentsv2-publish-from-popup
🎉 Publish file library from libraries popup
This commit is contained in:
commit
396d35840e
4 changed files with 38 additions and 5 deletions
|
@ -75,17 +75,36 @@
|
|||
|
||||
unlink-library
|
||||
(mf/use-callback
|
||||
(mf/deps file)
|
||||
(fn [library-id]
|
||||
(st/emit! (dwl/unlink-file-from-library (:id file) library-id)
|
||||
(dwl/sync-file (:id file) library-id))))]
|
||||
(mf/deps file)
|
||||
(fn [library-id]
|
||||
(st/emit! (dwl/unlink-file-from-library (:id file) library-id)
|
||||
(dwl/sync-file (:id file) library-id))))
|
||||
add-shared
|
||||
(mf/use-callback
|
||||
(mf/deps file)
|
||||
#(st/emit! (dwl/set-file-shared (:id file) true)))
|
||||
|
||||
del-shared
|
||||
(mf/use-callback
|
||||
(mf/deps file)
|
||||
#(st/emit! (dwl/set-file-shared (:id file) false)))]
|
||||
[:*
|
||||
[:div.section
|
||||
[:div.section-title (tr "workspace.libraries.in-this-file")]
|
||||
[:div.section-list
|
||||
[:div.section-list-item
|
||||
[:div
|
||||
[:div.item-name (tr "workspace.libraries.file-library")]
|
||||
[:div.item-contents (contents-str file)]]
|
||||
[:div
|
||||
(if (:is-shared file)
|
||||
[:input.item-button {:type "button"
|
||||
:value (tr "common.unpublish")
|
||||
:on-click del-shared}]
|
||||
[:input.item-button {:type "button"
|
||||
:value (tr "common.publish")
|
||||
:on-click add-shared}])]]
|
||||
|
||||
(for [library sorted-libraries]
|
||||
[:div.section-list-item {:key (:id library)}
|
||||
[:div.item-name (:name library)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue