mirror of
https://github.com/penpot/penpot.git
synced 2026-04-25 11:18:36 +00:00
♻️ Derive v-sizing from values instead of passing as prop
Signed-off-by: Andrey Antukh <niwi@niwi.nz>
This commit is contained in:
parent
3c542a1abc
commit
ba42cc04b7
@ -539,16 +539,18 @@
|
|||||||
[:map
|
[:map
|
||||||
[:values schema:layout-item-props-schema]
|
[:values schema:layout-item-props-schema]
|
||||||
[:applied-tokens [:maybe [:map-of :keyword :string]]]
|
[:applied-tokens [:maybe [:map-of :keyword :string]]]
|
||||||
[:ids [::sm/vec ::sm/uuid]]
|
[:ids [::sm/vec ::sm/uuid]]])
|
||||||
[:v-sizing {:optional true} [:maybe [:= :fill]]]])
|
|
||||||
|
|
||||||
(mf/defc layout-size-constraints*
|
(mf/defc layout-size-constraints*
|
||||||
{::mf/private true
|
{::mf/private true
|
||||||
::mf/schema (sm/schema schema:layout-size-constraints)}
|
::mf/schema (sm/schema schema:layout-size-constraints)}
|
||||||
[{:keys [values v-sizing ids applied-tokens] :as props}]
|
[{:keys [values ids applied-tokens] :as props}]
|
||||||
(let [token-numeric-inputs
|
(let [token-numeric-inputs
|
||||||
(features/use-feature "tokens/numeric-input")
|
(features/use-feature "tokens/numeric-input")
|
||||||
|
|
||||||
|
v-sizing
|
||||||
|
(:layout-item-v-sizing values)
|
||||||
|
|
||||||
min-w (get values :layout-item-min-w)
|
min-w (get values :layout-item-min-w)
|
||||||
|
|
||||||
max-w (get values :layout-item-max-w)
|
max-w (get values :layout-item-max-w)
|
||||||
@ -914,5 +916,4 @@
|
|||||||
(= v-sizing :fill))
|
(= v-sizing :fill))
|
||||||
[:> layout-size-constraints* {:ids ids
|
[:> layout-size-constraints* {:ids ids
|
||||||
:values values
|
:values values
|
||||||
:applied-tokens applied-tokens
|
:applied-tokens applied-tokens}])])]))
|
||||||
:v-sizing v-sizing}])])]))
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user