diff --git a/CHANGES.md b/CHANGES.md index 7a01888b81..7a46cd0982 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -32,6 +32,7 @@ - Add support for local caching of google fonts (this avoids exposing the final user IP to goolge and reduces the amount of request sent to google) - Set smooth/instant autoscroll depending on distance [GitHub #3377](https://github.com/penpot/penpot/issues/3377) +- New component icon [Taiga #5290](https://tree.taiga.io/project/penpot/us/5290) ### :bug: Bugs fixed diff --git a/frontend/resources/images/icons/component-copy.svg b/frontend/resources/images/icons/component-copy.svg index 29cddebc2f..658e0554d2 100644 --- a/frontend/resources/images/icons/component-copy.svg +++ b/frontend/resources/images/icons/component-copy.svg @@ -1,3 +1,3 @@ - - - \ No newline at end of file + + + diff --git a/frontend/resources/images/icons/component.svg b/frontend/resources/images/icons/component.svg index 2777568a41..b89a10c8d6 100644 --- a/frontend/resources/images/icons/component.svg +++ b/frontend/resources/images/icons/component.svg @@ -1,3 +1,3 @@ - - + + diff --git a/frontend/src/app/main/ui/workspace/viewport/widgets.cljs b/frontend/src/app/main/ui/workspace/viewport/widgets.cljs index 3997788958..6b069c16e6 100644 --- a/frontend/src/app/main/ui/workspace/viewport/widgets.cljs +++ b/frontend/src/app/main/ui/workspace/viewport/widgets.cljs @@ -10,6 +10,7 @@ [app.common.data.macros :as dm] [app.common.geom.point :as gpt] [app.common.pages.helpers :as cph] + [app.common.types.component :as ctk] [app.common.types.container :as ctn] [app.common.types.shape-tree :as ctt] [app.common.types.shape.layout :as ctl] @@ -167,7 +168,9 @@ (mf/deps (:id frame) on-frame-leave) (fn [_] (on-frame-leave (:id frame)))) - text-pos-x (if (or (:use-for-thumbnail? frame) grid-edition?) 15 0)] + + main-instance? (ctk/main-instance? frame) + text-pos-x (if (or (:use-for-thumbnail? frame) grid-edition? main-instance?) 15 0)] (when (not (:hidden frame)) [:g.frame-title {:id (dm/str "frame-title-" (:id frame)) @@ -175,7 +178,7 @@ :transform (vwu/title-transform frame zoom grid-edition?) :pointer-events (when (:blocked frame) "none")} (cond - (or (:use-for-thumbnail? frame) grid-edition?) + (or (:use-for-thumbnail? frame) grid-edition? main-instance?) [:svg {:x 0 :y -9 :width 12 @@ -188,7 +191,10 @@ [:use {:href "#icon-set-thumbnail"}] grid-edition? - [:use {:href "#icon-grid-layout-mode"}])]) + [:use {:href "#icon-grid-layout-mode"}] + + main-instance? + [:use {:href "#icon-component"}])]) [:text {:x text-pos-x :y 0