0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-13 02:28:18 -05:00

🐛 Remove copy all button in fills and strokes

This commit is contained in:
Eva 2023-01-27 12:54:18 +01:00 committed by Alejandro Alonso
parent e7ddd6055f
commit 15e62ff649
3 changed files with 25 additions and 24 deletions

View file

@ -314,11 +314,15 @@
}
}
.attributes-shadow-block {
.attributes-shadow-block,
.attributes-stroke-block,
.attributes-fill-block {
border-top: 1px solid $color-gray-60;
}
.attributes-shadow-blocks :first-child {
.attributes-shadow-blocks :first-child,
.attributes-stroke-blocks :first-child,
.attributes-fill-blocks :first-child {
border-top: none;
}
}

View file

@ -6,7 +6,6 @@
(ns app.main.ui.viewer.inspect.attributes.fill
(:require
[app.main.ui.components.copy-button :refer [copy-button]]
[app.main.ui.viewer.inspect.attributes.common :refer [color-row]]
[app.util.code-gen :as cg]
[app.util.color :as uc]
@ -40,10 +39,11 @@
(let [color-format (mf/use-state :hex)
color (shape->color shape)]
[:& color-row {:color color
:format @color-format
:on-change-format #(reset! color-format %)
:copy-data (copy-data shape)}]))
[:div.attributes-fill-block
[:& color-row {:color color
:format @color-format
:on-change-format #(reset! color-format %)
:copy-data (copy-data shape)}]]))
(mf/defc fill-panel
[{:keys [shapes]}]
@ -51,14 +51,13 @@
(when (seq shapes)
[:div.attributes-block
[:div.attributes-block-title
[:div.attributes-block-title-text (tr "inspect.attributes.fill")]
(when (= (count shapes) 1)
[:& copy-button {:data (copy-data (first shapes))}])]
[:div.attributes-block-title-text (tr "inspect.attributes.fill")]]
(for [shape shapes]
[:div.attributes-fill-blocks
(for [shape shapes]
(if (seq (:fills shape))
(for [value (:fills shape [])]
[:& fill-block {:key (str "fill-block-" (:id shape) value)
:shape value}])
[:& fill-block {:key (str "fill-block-only" (:id shape))
:shape shape}]))])))
:shape shape}]))]])))

View file

@ -55,12 +55,7 @@
[{:keys [shape]}]
(let [color-format (mf/use-state :hex)
color (shape->color shape)]
[:*
[:& color-row {:color color
:format @color-format
:copy-data (copy-color-data shape)
:on-change-format #(reset! color-format %)}]
[:div.attributes-stroke-block
(let [{:keys [stroke-style stroke-alignment]} shape
stroke-style (if (= stroke-style :svg) :solid stroke-style)
stroke-alignment (or stroke-alignment :center)]
@ -78,7 +73,11 @@
;; inspect.attributes.stroke.alignment.inner
;; inspect.attributes.stroke.alignment.outer
[:div.attributes-label (->> stroke-alignment d/name (str "inspect.attributes.stroke.alignment.") (tr))]
[:& copy-button {:data (copy-stroke-data shape)}]])]))
[:& copy-button {:data (copy-stroke-data shape)}]])
[:& color-row {:color color
:format @color-format
:copy-data (copy-color-data shape)
:on-change-format #(reset! color-format %)}]]))
(mf/defc stroke-panel
[{:keys [shapes]}]
@ -86,14 +85,13 @@
(when (seq shapes)
[:div.attributes-block
[:div.attributes-block-title
[:div.attributes-block-title-text (tr "inspect.attributes.stroke")]
(when (= (count shapes) 1)
[:& copy-button {:data (copy-stroke-data (first shapes))}])]
[:div.attributes-block-title-text (tr "inspect.attributes.stroke")]]
(for [shape shapes]
[:div.attributes-stroke-blocks
(for [shape shapes]
(if (seq (:strokes shape))
(for [value (:strokes shape [])]
[:& stroke-block {:key (str "stroke-color-" (:id shape) value)
:shape value}])
[:& stroke-block {:key (str "stroke-color-only" (:id shape))
:shape shape}]))])))
:shape shape}]))]])))