mirror of
https://github.com/penpot/penpot.git
synced 2025-01-23 23:18:48 -05:00
💄 Add minor cosmetic fixes to link react component
This commit is contained in:
parent
870e4f96b2
commit
0ea07469d2
1 changed files with 7 additions and 4 deletions
|
@ -6,16 +6,19 @@
|
|||
|
||||
(ns app.main.ui.components.link
|
||||
(:require
|
||||
[app.common.data :as d]
|
||||
[app.util.keyboard :as kbd]
|
||||
[rumext.v2 :as mf]))
|
||||
|
||||
(mf/defc link [{:keys [action klass data-test keyboard-action children]}]
|
||||
(let [keyboard-action (or keyboard-action action)]
|
||||
(mf/defc link
|
||||
{::mf/wrap-props false}
|
||||
[{:keys [action klass data-test keyboard-action children]}]
|
||||
(let [keyboard-action (d/nilv keyboard-action action)]
|
||||
[:a {:on-click action
|
||||
:class klass
|
||||
:on-key-down (fn [event]
|
||||
(when (kbd/enter? event)
|
||||
(when ^boolean (kbd/enter? event)
|
||||
(keyboard-action event)))
|
||||
:tab-index "0"
|
||||
:data-test data-test}
|
||||
[:* children]]))
|
||||
children]))
|
||||
|
|
Loading…
Add table
Reference in a new issue