From d941029661973a3029f250c73509fd943cda8d8f Mon Sep 17 00:00:00 2001 From: Lungu Cristian Date: Tue, 3 Dec 2024 11:49:15 +0200 Subject: [PATCH] Fix swaps received value UI bug (#21724) * fix: use text instead of input for received value * fix: using input-disabled? instead of pay? --- .../components/wallet/swap_input/view.cljs | 47 ++++++++++--------- src/quo/foundations/colors.cljs | 1 + 2 files changed, 27 insertions(+), 21 deletions(-) diff --git a/src/quo/components/wallet/swap_input/view.cljs b/src/quo/components/wallet/swap_input/view.cljs index 8cc879ecb1..6dd87f2ccc 100644 --- a/src/quo/components/wallet/swap_input/view.cljs +++ b/src/quo/components/wallet/swap_input/view.cljs @@ -121,33 +121,38 @@ [linear-gradient/linear-gradient {:start {:x 0 :y 0} :end {:x 1 :y 0} - :colors [(colors/theme-colors colors/white colors/neutral-100 theme) - (colors/theme-colors colors/white-opa-10 colors/neutral-100-opa-10 theme)] + :colors [(colors/theme-colors colors/white colors/neutral-95 theme) + (colors/theme-colors colors/white-opa-10 colors/neutral-95-opa-10 theme)] :style style/gradient-start}]) (when (and overflow? disabled?) [linear-gradient/linear-gradient {:start {:x 0 :y 0} :end {:x 1 :y 0} - :colors [(colors/theme-colors colors/white-opa-10 colors/neutral-100-opa-10 theme) - (colors/theme-colors colors/white colors/neutral-100 theme)] + :colors [(colors/theme-colors colors/white-opa-10 colors/neutral-95-opa-10 theme) + (colors/theme-colors colors/white colors/neutral-95 theme)] :style style/gradient-end}]) - [rn/text-input - (cond-> {:ref set-input-ref - :style (style/input disabled? error? theme) - :placeholder-text-color (colors/theme-colors colors/neutral-40 - colors/neutral-50 - theme) - :keyboard-type :numeric - :editable (not input-disabled?) - :auto-focus auto-focus? - :on-focus on-input-focus - :on-change-text on-change-text - :on-layout on-layout-text-input - :on-selection-change on-selection-change - :show-soft-input-on-focus show-keyboard? - :default-value default-value - :placeholder "0"} - controlled-input? (assoc :value value))]] + (if-not input-disabled? + [rn/text-input + (cond-> {:ref set-input-ref + :style (style/input disabled? error? theme) + :placeholder-text-color (colors/theme-colors colors/neutral-40 + colors/neutral-50 + theme) + :keyboard-type :numeric + :editable (not input-disabled?) + :auto-focus auto-focus? + :on-focus on-input-focus + :on-change-text on-change-text + :on-layout on-layout-text-input + :on-selection-change on-selection-change + :show-soft-input-on-focus show-keyboard? + :default-value default-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 {:size :paragraph-2 :weight :semi-bold diff --git a/src/quo/foundations/colors.cljs b/src/quo/foundations/colors.cljs index cc7b14450c..d2831b0c9c 100644 --- a/src/quo/foundations/colors.cljs +++ b/src/quo/foundations/colors.cljs @@ -91,6 +91,7 @@ ;;95 with transparency (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-70 (alpha neutral-95 0.7)) (def neutral-95-opa-80 (alpha neutral-95 0.8))