diff --git a/frontend/src/app/main/ui/workspace/sidebar/assets.cljs b/frontend/src/app/main/ui/workspace/sidebar/assets.cljs index 6c4d03a07..4ec585f2d 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/assets.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/assets.cljs @@ -8,6 +8,7 @@ (:require-macros [app.main.style :as stl]) (:require [app.common.data.macros :as dm] + [app.config :as cf] [app.main.data.modal :as modal] [app.main.data.workspace :as dw] [app.main.data.workspace.assets :as dwa] @@ -86,6 +87,7 @@ section (:section filters) ordering (:ordering filters) reverse-sort? (= :desc ordering) + num-libs (count (mf/deref refs/workspace-libraries)) toggle-ordering (mf/use-fn @@ -155,12 +157,18 @@ [:article {:class (stl/css :assets-bar)} [:div {:class (stl/css :assets-header)} (when-not ^boolean read-only? - [:button {:class (stl/css :libraries-button) - :on-click show-libraries-dialog - :data-testid "libraries"} - [:span {:class (stl/css :libraries-icon)} - i/library] - (tr "workspace.assets.libraries")]) + (if (and (cf/external-feature-flag "templates-02" "test") + (zero? num-libs)) + [:button {:class (stl/css :add-library-button) + :on-click show-libraries-dialog + :data-testid "libraries"} + (tr "workspace.assets.add-library")] + [:button {:class (stl/css :libraries-button) + :on-click show-libraries-dialog + :data-testid "libraries"} + [:span {:class (stl/css :libraries-icon)} + i/library] + (tr "workspace.assets.libraries")])) [:div {:class (stl/css :search-wrapper)} [:& search-bar {:on-change on-search-term-change diff --git a/frontend/src/app/main/ui/workspace/sidebar/assets.scss b/frontend/src/app/main/ui/workspace/sidebar/assets.scss index acb9f3431..21f7af9d5 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/assets.scss +++ b/frontend/src/app/main/ui/workspace/sidebar/assets.scss @@ -25,34 +25,50 @@ width: 100%; margin-bottom: $s-4; border-radius: $s-8; + .libraries-icon { @include flexCenter; width: $s-24; height: 100%; + svg { @include flexCenter; @extend .button-icon; stroke: var(--icon-foreground); } } + &:hover { background-color: var(--button-secondary-background-color-hover); color: var(--button-secondary-foreground-color-hover); border: $s-1 solid var(--button-secondary-border-color-hover); + svg { stroke: var(--button-secondary-foreground-color-hover); } } + &:focus { background-color: var(--button-secondary-background-color-focus); color: var(--button-secondary-foreground-color-focus); border: $s-1 solid var(--button-secondary-border-color-focus); + svg { stroke: var(--button-secondary-foreground-color-focus); } } } +.add-library-button { + @extend .button-primary; + text-transform: uppercase; + gap: $s-2; + height: $s-32; + width: 100%; + margin-bottom: $s-4; + border-radius: $s-8; +} + .section-button { @include flexCenter; @include buttonStyle; @@ -62,32 +78,39 @@ border: $s-1 solid var(--input-border-color-rest); border-radius: $br-8 $br-2 $br-2 $br-8; background-color: var(--input-background-color-rest); + svg { height: $s-16; width: $s-16; stroke: var(--icon-foreground); } + &:focus { border: $s-1 solid var(--input-border-color-focus); outline: 0; background-color: var(--input-background-color-focus); color: var(--input-foreground-color-focus); + svg { background-color: var(--input-background-color-focus); } } + &:hover { border: $s-1 solid var(--input-border-color-hover); background-color: var(--input-background-color-hover); + svg { background-color: var(--input-background-color-hover); stroke: var(--button-foreground-hover); } + &:focus { border: $s-1 solid var(--input-border-color-focus); outline: 0; background-color: var(--input-background-color-focus); color: var(--input-foreground-color-focus); + svg { background-color: var(--input-background-color-focus); } diff --git a/frontend/translations/en.po b/frontend/translations/en.po index e001ffb0e..a7a4bc79c 100644 --- a/frontend/translations/en.po +++ b/frontend/translations/en.po @@ -4058,6 +4058,9 @@ msgstr "Group name" msgid "workspace.assets.libraries" msgstr "Libraries" +msgid "workspace.assets.add-library" +msgstr "Add library" + #: src/app/main/ui/workspace/sidebar/assets/components.cljs:523 msgid "workspace.assets.list-view" msgstr "List view" diff --git a/frontend/translations/es.po b/frontend/translations/es.po index 1c904b1b1..817abd93b 100644 --- a/frontend/translations/es.po +++ b/frontend/translations/es.po @@ -4058,6 +4058,9 @@ msgstr "Nombre del grupo" msgid "workspace.assets.libraries" msgstr "Bibliotecas" +msgid "workspace.assets.add-library" +msgstr "AƱadir biblioteca" + #: src/app/main/ui/workspace/sidebar/assets/components.cljs:523 msgid "workspace.assets.list-view" msgstr "Ver como lista"