Skip to content

Commit

Permalink
fix issues 1,2,4
Browse files Browse the repository at this point in the history
  • Loading branch information
Parveshdhull committed Apr 24, 2024
1 parent 0273311 commit c53ce23
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 38 deletions.
20 changes: 11 additions & 9 deletions src/status_im/common/floating_button_page/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
[react-native.safe-area :as safe-area]
[reagent.core :as reagent]
[status-im.common.floating-button-page.floating-container.view :as floating-container]
[status-im.common.floating-button-page.style :as style]))
[status-im.common.floating-button-page.style :as style]
[utils.re-frame :as rf]))

(defn- show-background
[{:keys [window-height keyboard-height footer-container-height content-scroll-y
Expand Down Expand Up @@ -82,14 +83,15 @@
set-content-y-scroll (fn [event]
(reset! content-scroll-y
(oops/oget event "nativeEvent.contentOffset.y")))]
(let [keyboard-shown? (if platform/ios? @keyboard-will-show? @keyboard-did-show?)
show-background? (show-background {:window-height window-height
:footer-container-height @footer-container-height
:keyboard-height @keyboard-height
:content-scroll-y @content-scroll-y
:content-container-height @content-container-height
:header-height @header-height
:keyboard-shown? keyboard-shown?})]
(let [keyboard-shown? (if platform/ios? @keyboard-will-show? @keyboard-did-show?)
footer-container-padding (+ footer-container-padding (rf/sub [:alert-banners/top-margin]))
show-background? (show-background {:window-height window-height
:footer-container-height @footer-container-height
:keyboard-height @keyboard-height
:content-scroll-y @content-scroll-y
:content-container-height @content-container-height
:header-height @header-height
:keyboard-shown? keyboard-shown?})]
[:<>
(when gradient-cover?
[quo/gradient-cover {:customization-color customization-color}])
Expand Down
16 changes: 9 additions & 7 deletions src/status_im/contexts/chat/messenger/messages/view.cljs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(ns status-im.contexts.chat.messenger.messages.view
(:require
[react-native.core :as rn]
[react-native.platform :as platform]
[react-native.reanimated :as reanimated]
[react-native.safe-area :as safe-area]
[status-im.contexts.chat.messenger.composer.view :as composer.view]
Expand All @@ -15,15 +16,16 @@
;; fixes related to the composer, please skip them. And ping me, so I can address them while refactoring
(defn- chat-screen
[chat-screen-layout-calculations-complete?]
(let [insets (safe-area/get-insets)
content-height (atom 0)
layout-height (atom 0)
distance-atom (atom 0)
distance-from-list-top (reanimated/use-shared-value 0)
chat-list-scroll-y (reanimated/use-shared-value 0)]
(let [insets (safe-area/get-insets)
content-height (atom 0)
layout-height (atom 0)
distance-atom (atom 0)
distance-from-list-top (reanimated/use-shared-value 0)
chat-list-scroll-y (reanimated/use-shared-value 0)
alert-banners-top-margin (rf/sub [:alert-banners/top-margin])]
[rn/keyboard-avoiding-view
{:style style/keyboard-avoiding-container
:keyboard-vertical-offset (- (:bottom insets))}
:keyboard-vertical-offset (- (if platform/ios? alert-banners-top-margin 0) (:bottom insets))}
[list.view/messages-list-content
{:insets insets
:layout-height layout-height
Expand Down
39 changes: 21 additions & 18 deletions src/status_im/contexts/profile/edit/name/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
(:require [clojure.string :as string]
[quo.core :as quo]
[react-native.core :as rn]
[react-native.platform :as platform]
[react-native.safe-area :as safe-area]
[reagent.core :as reagent]
[status-im.common.validation.profile :as profile-validator]
Expand All @@ -14,22 +15,23 @@

(defn view
[]
(let [insets (safe-area/get-insets)
profile (rf/sub [:profile/profile-with-image])
customization-color (rf/sub [:profile/customization-color])
display-name (profile.utils/displayed-name profile)
full-name (reagent/atom display-name)
error-msg (reagent/atom nil)
typing? (reagent/atom false)
validate-name (debounce/debounce (fn [name]
(reset! error-msg
(profile-validator/validation-name name))
(reset! typing? false))
300)
on-change-text (fn [s]
(reset! typing? true)
(reset! full-name s)
(validate-name s))]
(let [insets (safe-area/get-insets)
profile (rf/sub [:profile/profile-with-image])
customization-color (rf/sub [:profile/customization-color])
display-name (profile.utils/displayed-name profile)
alert-banners-top-margin (rf/sub [:alert-banners/top-margin])
full-name (reagent/atom display-name)
error-msg (reagent/atom nil)
typing? (reagent/atom false)
validate-name (debounce/debounce (fn [name]
(reset! error-msg
(profile-validator/validation-name name))
(reset! typing? false))
300)
on-change-text (fn [s]
(reset! typing? true)
(reset! full-name s)
(validate-name s))]
(fn []
[quo/overlay
{:type :shell
Expand All @@ -40,8 +42,9 @@
:icon-name :i/arrow-left
:on-press #(rf/dispatch [:navigate-back])}]
[rn/keyboard-avoiding-view
{:key :content
:style style/screen-container}
{:key :content
:keyboard-vertical-offset (if platform/ios? alert-banners-top-margin 0)
:style style/screen-container}
[rn/view {:style {:gap 22}}
[quo/text-combinations {:title (i18n/label :t/name)}]
[quo/input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
keypairs (rf/sub [:wallet/keypairs])
selected-keypair-uid (rf/sub [:wallet/selected-keypair-uid])
placeholder (i18n/label :t/default-account-placeholder)
alert-banners-top-margin (rf/sub [:alert-banners/top-margin])
derivation-path (utils/get-derivation-path
number-of-accounts)
keypair (some #(when (= (:key-uid %) selected-keypair-uid)
Expand Down Expand Up @@ -110,7 +109,7 @@
(rn/use-unmount #(rf/dispatch [:wallet/clear-new-keypair]))
[floating-button-page/view
{:gradient-cover? true
:footer-container-padding alert-banners-top-margin
:footer-container-padding 0
:header-container-style {:padding-top top}
:customization-color @account-color
:header [quo/page-nav
Expand Down
5 changes: 3 additions & 2 deletions src/status_im/subs/alert_banner.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
:<- [:alert-banners]
(fn [banners]
(let [banners-count (count banners)]
(when (pos? banners-count)
(+ (* constants/alert-banner-height banners-count) 8)))))
(if (pos? banners-count)
(+ (* constants/alert-banner-height banners-count) 8)
0))))

0 comments on commit c53ce23

Please sign in to comment.