mirror of
https://github.com/penpot/penpot.git
synced 2026-01-20 04:10:41 -05:00
Compare commits
1 Commits
develop
...
eva-fix-sh
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3330449e31 |
@@ -52,7 +52,8 @@
|
|||||||
(let [form (mf/use-ctx context)
|
(let [form (mf/use-ctx context)
|
||||||
disabled? (or (and (some? form)
|
disabled? (or (and (some? form)
|
||||||
(or (not (:valid @form))
|
(or (not (:valid @form))
|
||||||
(seq (:external-errors @form))))
|
(seq (:reference-errors @form))
|
||||||
|
(seq (:extra-errors @form))))
|
||||||
(true? disabled))
|
(true? disabled))
|
||||||
handle-key-down-save
|
handle-key-down-save
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
|
|||||||
@@ -332,6 +332,7 @@
|
|||||||
message (tr "workspace.tokens.resolved-value" (or resolved-value value))]
|
message (tr "workspace.tokens.resolved-value" (or resolved-value value))]
|
||||||
(swap! form update :errors dissoc :value)
|
(swap! form update :errors dissoc :value)
|
||||||
(swap! form update :extra-errors dissoc :value)
|
(swap! form update :extra-errors dissoc :value)
|
||||||
|
(swap! form update :reference-errors dissoc :reference)
|
||||||
(if (= input-value (str resolved-value))
|
(if (= input-value (str resolved-value))
|
||||||
(reset! hint* {})
|
(reset! hint* {})
|
||||||
(reset! hint* {:message message :type "hint"})))))))]
|
(reset! hint* {:message message :type "hint"})))))))]
|
||||||
|
|||||||
@@ -101,13 +101,6 @@
|
|||||||
active-tab* (mf/use-state #(if (cft/is-reference? token) :reference :composite))
|
active-tab* (mf/use-state #(if (cft/is-reference? token) :reference :composite))
|
||||||
active-tab (deref active-tab*)
|
active-tab (deref active-tab*)
|
||||||
|
|
||||||
on-toggle-tab
|
|
||||||
(mf/use-fn
|
|
||||||
(mf/deps)
|
|
||||||
(fn [new-tab]
|
|
||||||
(let [new-tab (keyword new-tab)]
|
|
||||||
(reset! active-tab* new-tab))))
|
|
||||||
|
|
||||||
token
|
token
|
||||||
(mf/with-memo [token]
|
(mf/with-memo [token]
|
||||||
(or token {:type token-type}))
|
(or token {:type token-type}))
|
||||||
@@ -144,6 +137,17 @@
|
|||||||
(fm/use-form :schema schema
|
(fm/use-form :schema schema
|
||||||
:initial initial)
|
:initial initial)
|
||||||
|
|
||||||
|
on-toggle-tab
|
||||||
|
(mf/use-fn
|
||||||
|
(mf/deps form)
|
||||||
|
(fn [new-tab]
|
||||||
|
(let [new-tab (keyword new-tab)]
|
||||||
|
(if (= new-tab :reference)
|
||||||
|
(swap! form assoc-in [:reference-errors :reference]
|
||||||
|
{:message "Need valid reference"})
|
||||||
|
(swap! form update :reference-errors dissoc :reference))
|
||||||
|
(reset! active-tab* new-tab))))
|
||||||
|
|
||||||
warning-name-change?
|
warning-name-change?
|
||||||
(not= (get-in @form [:data :name])
|
(not= (get-in @form [:data :name])
|
||||||
(:name initial))
|
(:name initial))
|
||||||
|
|||||||
Reference in New Issue
Block a user