0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-24 07:29:08 -05:00

🎉 Publish file library from libraries popup

This commit is contained in:
Pablo Alba 2022-08-24 12:53:04 +02:00
parent 3c492f03d1
commit d1550ebb2a
4 changed files with 38 additions and 5 deletions

View file

@ -687,6 +687,8 @@
padding: $size-4 0;
border-bottom: 1px solid $color-gray-20;
position: relative;
display: flex;
justify-content: space-between;
.item-name {
color: $color-gray-60;
@ -707,7 +709,7 @@
right: 0;
border: 1px solid $color-primary;
border-radius: 2px;
width: 4.5rem;
min-width: 4.5rem;
background: $color-primary;
color: $color-black;
padding: $size-2;

View file

@ -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)]

View file

@ -224,6 +224,12 @@ msgstr "Share prototypes"
msgid "common.share-link.view-all"
msgstr "Select All"
msgid "common.publish"
msgstr "Publish"
msgid "common.unpublish"
msgstr "Unpublish"
#: src/app/main/ui/workspace/header.cljs, src/app/main/ui/dashboard/file_menu.cljs
msgid "dashboard.add-shared"
msgstr "Add as Shared Library"

View file

@ -229,6 +229,12 @@ msgstr "Compartir prototipos"
msgid "common.share-link.view-all"
msgstr "Selecctionar todas"
msgid "common.publish"
msgstr "Publicar"
msgid "common.unpublish"
msgstr "Despublicar"
#: src/app/main/ui/workspace/header.cljs,
#: src/app/main/ui/dashboard/file_menu.cljs
msgid "dashboard.add-shared"