Background shown for [Continue] button on iOS when it shouldn't overlap the color picker (#17044)

* Background shown for [Continue] button on iOS when it shouldn't overlap the color picker

* kebab-case
This commit is contained in:
Alexander 2023-08-18 22:22:48 +02:00 committed by GitHub
parent e186f513ed
commit 95ec35343c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 4 deletions

View File

@ -51,7 +51,7 @@
(defn show-button-background (defn show-button-background
[keyboard-height keyboard-shown] [keyboard-height keyboard-shown content-scroll-y]
(let [button-container-height 64 (let [button-container-height 64
keyboard-view-height (+ keyboard-height button-container-height)] keyboard-view-height (+ keyboard-height button-container-height)]
(when keyboard-shown (when keyboard-shown
@ -60,7 +60,7 @@
(< (- @scroll-view-height button-container-height) @content-container-height) (< (- @scroll-view-height button-container-height) @content-container-height)
platform/ios? platform/ios?
(< (- @scroll-view-height keyboard-view-height) @content-container-height) (< (- @scroll-view-height keyboard-view-height) (- @content-container-height content-scroll-y))
:else :else
false)))) false))))
@ -93,6 +93,7 @@
(defn- f-page (defn- f-page
[{:keys [onboarding-profile-data navigation-bar-top]}] [{:keys [onboarding-profile-data navigation-bar-top]}]
(reagent/with-let [show-keyboard? (reagent/atom false) (reagent/with-let [show-keyboard? (reagent/atom false)
content-scroll-y (reagent/atom 0)
show-listener (oops/ocall rn/keyboard show-listener (oops/ocall rn/keyboard
"addListener" "addListener"
(if platform/android? (if platform/android?
@ -129,7 +130,8 @@
:else :success) :else :success)
{:keys [keyboard-shown keyboard-height]} (hooks/use-keyboard) {:keys [keyboard-shown keyboard-height]} (hooks/use-keyboard)
show-background? (show-button-background keyboard-height show-background? (show-button-background keyboard-height
keyboard-shown)] keyboard-shown
@content-scroll-y)]
[rn/view {:style style/page-container} [rn/view {:style style/page-container}
[navigation-bar/navigation-bar [navigation-bar/navigation-bar
{:stack-id :new-to-status {:stack-id :new-to-status
@ -137,7 +139,12 @@
[rn/scroll-view [rn/scroll-view
{:on-layout (fn [event] {:on-layout (fn [event]
(let [height (oops/oget event "nativeEvent.layout.height")] (let [height (oops/oget event "nativeEvent.layout.height")]
(reset! scroll-view-height height))) (reset! scroll-view-height height)
(reset! content-scroll-y 0)))
:on-scroll (fn [event]
(let [y (oops/oget event "nativeEvent.contentOffset.y")]
(reset! content-scroll-y y)))
:scroll-event-throttle 64
:content-container-style {:flexGrow 1}} :content-container-style {:flexGrow 1}}
[rn/view [rn/view
{:on-layout (fn [event] {:on-layout (fn [event]