Skip to content

Commit

Permalink
fix issue 6
Browse files Browse the repository at this point in the history
  • Loading branch information
Parveshdhull committed Apr 26, 2024
1 parent b777391 commit f8a4647
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/status_im/common/alert_banner/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
colors-map (get-colors-map theme)]
[hole-view/hole-view
;; required for fix flicker issue https://github.com/status-im/status-mobile/issues/19490
{:style {:padding-bottom 1}
{:style {:padding-bottom 0.5}
:holes [{:x 0
:y (+ safe-area-top (* constants/alert-banner-height banners-count))
:width (:width (rn/get-window))
Expand Down
8 changes: 2 additions & 6 deletions src/status_im/contexts/chat/messenger/composer/effects.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@

(defn initialize
[props state animations {:keys [max-height] :as dimensions}
{:keys [chat-input audio input-text images link-previews? reply alert-banners-top-margin] :as subscriptions}]
{:keys [chat-input audio input-text images link-previews? reply] :as subscriptions}]
(rn/use-effect
(fn []
(maximized-effect state animations dimensions chat-input)
Expand All @@ -99,11 +99,7 @@
(background-effect state animations dimensions chat-input)
(link-preview-effect state)
(audio-effect state audio)
(kb/add-kb-listeners props
state
animations
dimensions
alert-banners-top-margin)
(kb/add-kb-listeners props state animations dimensions)
#(component-will-unmount props))
[max-height])
(rn/use-effect
Expand Down
8 changes: 4 additions & 4 deletions src/status_im/contexts/chat/messenger/composer/keyboard.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
curr-height))

(defn store-kb-height
[event {:keys [kb-default-height kb-height]} {:keys [window-height]} alert-banners-top-margin]
(let [height (- (+ window-height alert-banners-top-margin)
[event {:keys [kb-default-height kb-height]}]
(let [height (- (:height (rn/get-window))
(oops/oget event "endCoordinates.screenY"))]
(reset! kb-height height)
(when (zero? @kb-default-height)
Expand Down Expand Up @@ -56,11 +56,11 @@

(defn add-kb-listeners
[{:keys [keyboard-show-listener keyboard-frame-listener keyboard-hide-listener input-ref] :as props}
state animations dimensions alert-banners-top-margin]
state animations dimensions]
(reset! keyboard-show-listener (.addListener
rn/keyboard
"keyboardDidShow"
#(store-kb-height % state dimensions alert-banners-top-margin)))
#(store-kb-height % state)))
(reset! keyboard-frame-listener (.addListener
rn/keyboard
"keyboardWillChangeFrame"
Expand Down
7 changes: 6 additions & 1 deletion src/status_im/contexts/chat/messenger/composer/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@
theme
window-height]} props state shared-values]
(let [subscriptions (utils/init-subs)
window-height (- window-height (:alert-banners-top-margin subscriptions))
top-margin (if (pos? (:alert-banners-top-margin subscriptions))
;; top margin increased to avoid composer overlapping with the
;; alert banner
(+ (:alert-banners-top-margin subscriptions) 12)
0)
window-height (- window-height top-margin)
content-height (reagent/atom (or (:input-content-height ; Actual text height
subscriptions)
constants/input-height))
Expand Down
2 changes: 1 addition & 1 deletion src/status_im/subs/alert_banner.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
(fn [banners]
(let [banners-count (count banners)]
(if (pos? banners-count)
(+ (* constants/alert-banner-height banners-count) 8)
(+ (* constants/alert-banner-height banners-count) 10)
0))))

0 comments on commit f8a4647

Please sign in to comment.