Fix swaps received value UI bug (#21724)

* fix: use text instead of input for received value

* fix: using input-disabled? instead of pay?
This commit is contained in:
Lungu Cristian 2024-12-03 11:49:15 +02:00 committed by GitHub
parent f7c930964c
commit d941029661
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 27 additions and 21 deletions

View File

@ -121,33 +121,38 @@
[linear-gradient/linear-gradient [linear-gradient/linear-gradient
{:start {:x 0 :y 0} {:start {:x 0 :y 0}
:end {:x 1 :y 0} :end {:x 1 :y 0}
:colors [(colors/theme-colors colors/white colors/neutral-100 theme) :colors [(colors/theme-colors colors/white colors/neutral-95 theme)
(colors/theme-colors colors/white-opa-10 colors/neutral-100-opa-10 theme)] (colors/theme-colors colors/white-opa-10 colors/neutral-95-opa-10 theme)]
:style style/gradient-start}]) :style style/gradient-start}])
(when (and overflow? disabled?) (when (and overflow? disabled?)
[linear-gradient/linear-gradient [linear-gradient/linear-gradient
{:start {:x 0 :y 0} {:start {:x 0 :y 0}
:end {:x 1 :y 0} :end {:x 1 :y 0}
:colors [(colors/theme-colors colors/white-opa-10 colors/neutral-100-opa-10 theme) :colors [(colors/theme-colors colors/white-opa-10 colors/neutral-95-opa-10 theme)
(colors/theme-colors colors/white colors/neutral-100 theme)] (colors/theme-colors colors/white colors/neutral-95 theme)]
:style style/gradient-end}]) :style style/gradient-end}])
[rn/text-input (if-not input-disabled?
(cond-> {:ref set-input-ref [rn/text-input
:style (style/input disabled? error? theme) (cond-> {:ref set-input-ref
:placeholder-text-color (colors/theme-colors colors/neutral-40 :style (style/input disabled? error? theme)
colors/neutral-50 :placeholder-text-color (colors/theme-colors colors/neutral-40
theme) colors/neutral-50
:keyboard-type :numeric theme)
:editable (not input-disabled?) :keyboard-type :numeric
:auto-focus auto-focus? :editable (not input-disabled?)
:on-focus on-input-focus :auto-focus auto-focus?
:on-change-text on-change-text :on-focus on-input-focus
:on-layout on-layout-text-input :on-change-text on-change-text
:on-selection-change on-selection-change :on-layout on-layout-text-input
:show-soft-input-on-focus show-keyboard? :on-selection-change on-selection-change
:default-value default-value :show-soft-input-on-focus show-keyboard?
:placeholder "0"} :default-value default-value
controlled-input? (assoc :value value))]] :placeholder "0"}
controlled-input? (assoc :value value))]
[rn/text
{:style (style/input disabled? error? theme)
:on-layout on-layout-text-input}
(or value "0")])]
[text/text [text/text
{:size :paragraph-2 {:size :paragraph-2
:weight :semi-bold :weight :semi-bold

View File

@ -91,6 +91,7 @@
;;95 with transparency ;;95 with transparency
(def neutral-95-opa-0 (alpha neutral-95 0)) (def neutral-95-opa-0 (alpha neutral-95 0))
(def neutral-95-opa-10 (alpha neutral-95 0.1))
(def neutral-95-opa-60 (alpha neutral-95 0.6)) (def neutral-95-opa-60 (alpha neutral-95 0.6))
(def neutral-95-opa-70 (alpha neutral-95 0.7)) (def neutral-95-opa-70 (alpha neutral-95 0.7))
(def neutral-95-opa-80 (alpha neutral-95 0.8)) (def neutral-95-opa-80 (alpha neutral-95 0.8))