mirror of
https://github.com/penpot/penpot.git
synced 2025-05-17 14:26:10 +02:00
🎉 Consolidate suggested libraries and add library button (#5828)
This commit is contained in:
parent
d836cc66da
commit
af93325fd9
6 changed files with 4 additions and 57 deletions
|
@ -14,7 +14,6 @@
|
|||
[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.dashboard :as dd]
|
||||
[app.main.data.modal :as modal]
|
||||
[app.main.data.notifications :as ntf]
|
||||
|
@ -354,7 +353,7 @@
|
|||
(nil? shared-libraries)
|
||||
(tr "workspace.libraries.loading")
|
||||
|
||||
(and (str/empty? search-term) (cf/external-feature-flag "templates-03" "test"))
|
||||
(str/empty? search-term)
|
||||
[:*
|
||||
[:div {:class (stl/css :sample-libraries-info)}
|
||||
(tr "workspace.libraries.empty.no-libraries")
|
||||
|
@ -369,19 +368,6 @@
|
|||
{:library library
|
||||
:importing importing*}])]]
|
||||
|
||||
(str/empty? search-term)
|
||||
[:*
|
||||
[:span {:class (stl/css :empty-state-icon)}
|
||||
library-icon]
|
||||
(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))]))]]))
|
||||
|
||||
|
|
|
@ -326,16 +326,6 @@
|
|||
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;
|
||||
}
|
||||
|
||||
.sample-libraries-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
(: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]
|
||||
|
@ -92,12 +91,6 @@
|
|||
reverse-sort? (= :desc ordering)
|
||||
num-libs (count (mf/deref refs/libraries))
|
||||
|
||||
show-templates-04-test1?
|
||||
(and (cf/external-feature-flag "templates-04" "test1") (zero? num-libs))
|
||||
|
||||
show-templates-04-test2?
|
||||
(and (cf/external-feature-flag "templates-04" "test2") (zero? num-libs))
|
||||
|
||||
toggle-ordering
|
||||
(mf/use-fn
|
||||
(mf/deps ordering)
|
||||
|
@ -166,18 +159,12 @@
|
|||
[:article {:class (stl/css :assets-bar)}
|
||||
[:div {:class (stl/css :assets-header)}
|
||||
(when-not ^boolean read-only?
|
||||
(cond
|
||||
show-templates-04-test1?
|
||||
[:button {:class (stl/css :libraries-button)
|
||||
:on-click show-libraries-dialog
|
||||
:data-testid "libraries"}
|
||||
(tr "workspace.assets.add-library")]
|
||||
show-templates-04-test2?
|
||||
(if (= num-libs 1)
|
||||
[:button {:class (stl/css :add-library-button)
|
||||
:on-click show-libraries-dialog
|
||||
:data-testid "libraries"}
|
||||
(tr "workspace.assets.add-library")]
|
||||
:else
|
||||
|
||||
[:button {:class (stl/css :libraries-button)
|
||||
:on-click show-libraries-dialog
|
||||
:data-testid "libraries"}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue