mirror of
https://github.com/penpot/penpot.git
synced 2025-07-08 05:47:15 +02:00
🐛 Fix component icons
This commit is contained in:
parent
8e456d393f
commit
3dc45104db
4 changed files with 5 additions and 55 deletions
|
@ -1,50 +0,0 @@
|
|||
;; This Source Code Form is subject to the terms of the Mozilla Public
|
||||
;; License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
;;
|
||||
;; Copyright (c) KALEIDOS INC
|
||||
|
||||
(ns app.main.ui.components.shape-icon
|
||||
(:require
|
||||
[app.common.types.component :as ctk]
|
||||
[app.common.types.shape :as cts]
|
||||
[app.common.types.shape.layout :as ctl]
|
||||
[app.main.ui.icons :as i]
|
||||
[rumext.v2 :as mf]))
|
||||
|
||||
|
||||
(mf/defc element-icon
|
||||
[{:keys [shape main-instance?] :as props}]
|
||||
(if (ctk/instance-head? shape)
|
||||
(if main-instance?
|
||||
i/component
|
||||
i/component-copy)
|
||||
(case (:type shape)
|
||||
:frame (cond
|
||||
(and (ctl/flex-layout? shape) (ctl/col? shape))
|
||||
i/layout-columns
|
||||
|
||||
(and (ctl/flex-layout? shape) (ctl/row? shape))
|
||||
i/layout-rows
|
||||
|
||||
(ctl/grid-layout? shape)
|
||||
i/grid-layout-mode
|
||||
|
||||
:else
|
||||
i/artboard)
|
||||
:image i/image
|
||||
:line (if (cts/has-images? shape) i/image i/line)
|
||||
:circle (if (cts/has-images? shape) i/image i/circle)
|
||||
:path (if (cts/has-images? shape) i/image i/curve)
|
||||
:rect (if (cts/has-images? shape) i/image i/box)
|
||||
:text i/text
|
||||
:group (if (:masked-group shape)
|
||||
i/mask
|
||||
i/folder)
|
||||
:bool (case (:bool-type shape)
|
||||
:difference i/bool-difference
|
||||
:exclude i/bool-exclude
|
||||
:intersection i/bool-intersection
|
||||
#_:default i/bool-union)
|
||||
:svg-raw i/file-svg
|
||||
nil)))
|
Loading…
Add table
Add a link
Reference in a new issue