From 9fc8760dc590b0ee3b0c8af15bb77fea4ef100c9 Mon Sep 17 00:00:00 2001
From: Pablo Alba <pablo.alba@kaleidos.net>
Date: Mon, 21 Oct 2024 17:37:00 +0200
Subject: [PATCH] :tada: Add test A/B for add a link to the libraries page

---
 frontend/src/app/main/ui/workspace/libraries.cljs | 10 +++++++++-
 frontend/src/app/main/ui/workspace/libraries.scss | 10 ++++++++++
 frontend/translations/en.po                       |  8 ++++++++
 frontend/translations/es.po                       |  8 ++++++++
 4 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/frontend/src/app/main/ui/workspace/libraries.cljs b/frontend/src/app/main/ui/workspace/libraries.cljs
index 0eaca99b4..26ae8ca01 100644
--- a/frontend/src/app/main/ui/workspace/libraries.cljs
+++ b/frontend/src/app/main/ui/workspace/libraries.cljs
@@ -14,6 +14,7 @@
    [app.common.types.file :as ctf]
    [app.common.types.typographies-list :as ctyl]
    [app.common.uuid :as uuid]
+   [app.config :as cf]
    [app.main.data.modal :as modal]
    [app.main.data.users :as du]
    [app.main.data.workspace.colors :as mdc]
@@ -293,7 +294,14 @@
              [:*
               [:span {:class (stl/css :empty-state-icon)}
                library-icon]
-              (tr "workspace.libraries.no-shared-libraries-available")]
+              (tr "workspace.libraries.no-shared-libraries-available")
+              (when (cf/external-feature-flag "templates-01" "test")
+                [:div {:class (stl/css :templates-info)}
+                 (tr "workspace.libraries.more-templates")
+                 [:a {:target "_blank"
+                      :class (stl/css :templates-info-link)
+                      :href "https://penpot.app/libraries-templates"}
+                  (tr "workspace.libraries.more-templates-link")]])]
 
              :else
              (tr "workspace.libraries.no-matches-for" search-term))]))]]))
diff --git a/frontend/src/app/main/ui/workspace/libraries.scss b/frontend/src/app/main/ui/workspace/libraries.scss
index dd97685cb..7c04d7b30 100644
--- a/frontend/src/app/main/ui/workspace/libraries.scss
+++ b/frontend/src/app/main/ui/workspace/libraries.scss
@@ -323,3 +323,13 @@
   @include headlineSmallTypography;
   padding: $s-0 $s-16;
 }
+
+.templates-info {
+  color: var(--color-accent-primary);
+}
+
+.templates-info-link {
+  color: var(--color-accent-primary);
+  text-decoration: underline;
+  font-weight: $fw400;
+}
diff --git a/frontend/translations/en.po b/frontend/translations/en.po
index 07a6ba7d3..5292f4297 100644
--- a/frontend/translations/en.po
+++ b/frontend/translations/en.po
@@ -4496,6 +4496,14 @@ msgstr "No matches found for “%s“"
 msgid "workspace.libraries.no-shared-libraries-available"
 msgstr "There are no Shared Libraries available"
 
+#: src/app/main/ui/workspace/libraries.cljs:297
+msgid "workspace.libraries.more-templates"
+msgstr "You can look for "
+
+#: src/app/main/ui/workspace/libraries.cljs:297
+msgid "workspace.libraries.more-templates-link"
+msgstr "more templates in here"
+
 #: src/app/main/ui/workspace/libraries.cljs:260
 msgid "workspace.libraries.search-shared-libraries"
 msgstr "Search shared libraries"
diff --git a/frontend/translations/es.po b/frontend/translations/es.po
index ef9a8e754..f52994e74 100644
--- a/frontend/translations/es.po
+++ b/frontend/translations/es.po
@@ -4472,6 +4472,14 @@ msgstr "No se encuentra “%s“"
 msgid "workspace.libraries.no-shared-libraries-available"
 msgstr "No hay bibliotecas compartidas disponibles"
 
+#: src/app/main/ui/workspace/libraries.cljs:297
+msgid "workspace.libraries.more-templates"
+msgstr "Puedes buscar "
+
+#: src/app/main/ui/workspace/libraries.cljs:297
+msgid "workspace.libraries.more-templates-link"
+msgstr "más plantillas aquí"
+
 #: src/app/main/ui/workspace/libraries.cljs:260
 msgid "workspace.libraries.search-shared-libraries"
 msgstr "Buscar bibliotecas compartidas"