0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-08 16:18:11 -05:00

🐛 Fix problem with plugins icons

This commit is contained in:
alonso.torres 2024-10-17 14:51:01 +02:00
parent 02611029fb
commit ef3b4a5895

View file

@ -29,6 +29,15 @@
(def ^:private close-icon
(i/icon-xref :close (stl/css :close-icon)))
(defn icon-url
"Creates an sanitizes de icon URL to display"
[host icon]
(dm/str host
(if (and (not (str/ends-with? host "/"))
(not (str/starts-with? icon "/")))
"/" "")
icon))
(mf/defc plugin-entry
[{:keys [index manifest on-open-plugin on-remove-plugin]}]
@ -49,7 +58,7 @@
[:div {:class (stl/css :plugins-list-element)}
[:div {:class (stl/css :plugin-icon)}
[:img {:src (if (some? icon)
(dm/str host icon)
(icon-url host icon)
(avatars/generate {:name name}))}]]
[:div {:class (stl/css :plugin-description)}
[:div {:class (stl/css :plugin-title)} name]
@ -389,7 +398,7 @@
[:div {:class (stl/css :modal-title)}
[:div {:class (stl/css :plugin-icon)}
[:img {:src (if (some? icon)
(dm/str host icon)
(icon-url host icon)
(avatars/generate {:name name}))}]]
(tr "workspace.plugins.try-out.title" (str/upper (:name plugin)))]