0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-08 07:50:43 -05:00

Merge pull request #103 from tokens-studio/simple-context-menu

fix delimiter mismatch and add missing data/tokens package
This commit is contained in:
Akshay Gupta 2024-05-15 18:56:42 +05:30 committed by GitHub
commit f8972efea0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8,6 +8,7 @@
(:require-macros [app.main.style :as stl]) (:require-macros [app.main.style :as stl])
(:require (:require
[app.main.data.modal :as modal] [app.main.data.modal :as modal]
[app.main.data.tokens :as dt]
[app.main.refs :as refs] [app.main.refs :as refs]
[app.main.store :as st] [app.main.store :as st]
[app.main.ui.icons :as i] [app.main.ui.icons :as i]
@ -20,12 +21,12 @@
(mf/defc token-pill (mf/defc token-pill
{::mf/wrap-props false} {::mf/wrap-props false}
[{:keys [on-click token highlighted? on-context-menu]}] [{:keys [on-click token highlighted? on-context-menu]}]
(let [{:keys [name value]} token] (let [{:keys [name value]} token
resolved-value (try resolved-value (try
(wtc/resolve-token-value token) (wtc/resolve-token-value token)
(catch js/Error _ nil))] (catch js/Error _ nil))]
[:div {:class (stl/css-case :token-pill true [:div {:class (stl/css-case :token-pill true
:token-pill-highlighted highlighted?) :token-pill-highlighted highlighted?
:token-pill-invalid (not resolved-value)) :token-pill-invalid (not resolved-value))
:title (str (if resolved-value "Token value: " "Invalid token value: ") value) :title (str (if resolved-value "Token value: " "Invalid token value: ") value)
:on-click on-click :on-click on-click