diff --git a/frontend/resources/styles/main/partials/modal.scss b/frontend/resources/styles/main/partials/modal.scss index 8d3911bba..b5635bc5b 100644 --- a/frontend/resources/styles/main/partials/modal.scss +++ b/frontend/resources/styles/main/partials/modal.scss @@ -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; diff --git a/frontend/src/app/main/ui/workspace/libraries.cljs b/frontend/src/app/main/ui/workspace/libraries.cljs index 0fac97658..dc8708fe5 100644 --- a/frontend/src/app/main/ui/workspace/libraries.cljs +++ b/frontend/src/app/main/ui/workspace/libraries.cljs @@ -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)] diff --git a/frontend/translations/en.po b/frontend/translations/en.po index 57f87e162..7351f312c 100644 --- a/frontend/translations/en.po +++ b/frontend/translations/en.po @@ -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" diff --git a/frontend/translations/es.po b/frontend/translations/es.po index 89dddd273..0263c5e3d 100644 --- a/frontend/translations/es.po +++ b/frontend/translations/es.po @@ -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"