mirror of
https://github.com/penpot/penpot.git
synced 2025-03-12 15:51:37 -05:00
🐛 Fix react warning on isPinned unrecognized prop
This commit is contained in:
parent
3001476dbc
commit
e7a27759e6
1 changed files with 10 additions and 4 deletions
|
@ -12,15 +12,21 @@
|
||||||
(:require
|
(:require
|
||||||
[app.main.ui.icons :as i]
|
[app.main.ui.icons :as i]
|
||||||
[app.util.i18n :as i18n :refer [tr]]
|
[app.util.i18n :as i18n :refer [tr]]
|
||||||
|
[app.util.object :as obj]
|
||||||
[rumext.v2 :as mf]))
|
[rumext.v2 :as mf]))
|
||||||
|
|
||||||
(def pin-icon (icon-xref :pin-refactor (stl/css :icon)))
|
(def ^:private pin-icon
|
||||||
|
(icon-xref :pin-refactor (stl/css :icon)))
|
||||||
|
|
||||||
(mf/defc pin-button*
|
(mf/defc pin-button*
|
||||||
{::mf/props :obj}
|
{::mf/props :obj}
|
||||||
[{:keys [aria-label is-pinned class] :as props}]
|
[{:keys [aria-label is-pinned class] :as props}]
|
||||||
(let [aria-label (or aria-label (tr "dashboard.pin-unpin"))
|
(let [aria-label (or aria-label (tr "dashboard.pin-unpin"))
|
||||||
class (dm/str (or class "") " " (stl/css-case :button true :button-active is-pinned))
|
class (dm/str (or class "") " " (stl/css-case :button true :button-active is-pinned))
|
||||||
props (mf/spread-props props {:class class
|
|
||||||
:aria-label aria-label})]
|
props (-> (obj/clone props)
|
||||||
[:> "button" props pin-icon]))
|
(obj/unset! "isPinned")
|
||||||
|
(obj/set! "className" class)
|
||||||
|
(obj/set! "aria-label" aria-label))]
|
||||||
|
|
||||||
|
[:> "button" props pin-icon]))
|
||||||
|
|
Loading…
Add table
Reference in a new issue