Skip to content

Commit ece95ca

Browse files
authored
fix: safe areas all over the app for iOS & Android
* Fix safe areas * Refactor rf/defn -> rf/reg-event-fx for :reload-status-nav-color & :system-theme-mode-changed * Fix status-bar mode when the theme is changed for Android
1 parent e847a58 commit ece95ca

File tree

124 files changed

+356
-345
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+356
-345
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,16 @@
5959
"react-native-linear-gradient": "3.0.0-alpha.1",
6060
"react-native-lottie-splash-screen": "^1.0.1",
6161
"react-native-mmkv": "2.12.2",
62-
"react-native-navigation": "7.39.0",
62+
"react-native-navigation": "7.43.0",
6363
"react-native-orientation-locker": "^1.5.0",
6464
"react-native-pdf": "^6.7.5",
6565
"react-native-permissions": "4.1.5",
6666
"react-native-reanimated": "3.6.1",
6767
"react-native-redash": "18.1.0",
68+
"react-native-safe-area-context": "4.14.1",
6869
"react-native-shadow-2": "^7.0.8",
6970
"react-native-shake": "^3.3.1",
7071
"react-native-share": "10.0.2",
71-
"react-native-static-safe-area-insets": "^2.2.0",
7272
"react-native-status-keycard": "git+https://github.com/status-im/react-native-status-keycard.git#refs/tags/v2.6.6",
7373
"react-native-svg": "13.10.0",
7474
"react-native-webview": "13.6.3",

src/js/worklets/communities.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ export function onPanEnd({
271271
endAnimation();
272272
} else {
273273
const maxValue = maxScroll.value + expandHeaderLimit;
274-
const decelerationRate = isIOS ? { deceleration: 0.9997 } : { deceleration: 0.999 };
274+
const decelerationRate = isIOS ? { deceleration: 0.998 } : { deceleration: 0.996 };
275275

276276
scrollStart.value = withDecay({
277277
...{

src/legacy/status_im/events.cljs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@
8383
[{:keys [db]} path gfycat]
8484
{:db (assoc-in db path gfycat)})
8585

86-
(rf/defn system-theme-mode-changed
87-
{:events [:system-theme-mode-changed]}
88-
[{:keys [db] :as cofx} _]
89-
(let [appearance-type (get-in cofx [:db :profile/profile :appearance])]
90-
(when (and (multiaccounts.model/logged-in? db)
91-
(= appearance-type status-im.constants/appearance-type-system))
92-
{:dispatch [:theme/switch]})))
86+
(rf/reg-event-fx
87+
:system-theme-mode-changed
88+
(fn [{:keys [db]}]
89+
(let [appearance-type (-> db :profile/profile :appearance)]
90+
(when (and (multiaccounts.model/logged-in? db)
91+
(= appearance-type status-im.constants/appearance-type-system))
92+
{:fx [[:dispatch [:theme/switch]]]}))))
9393

9494
(defn- on-biometric-auth-fail
9595
[{:keys [code]}]
@@ -217,5 +217,3 @@
217217
:params []
218218
:on-success (fn [on-ramps]
219219
(re-frame/dispatch [::crypto-loaded on-ramps]))}]})
220-
221-

src/legacy/status_im/ui/components/topbar.cljs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
[quo/header
4141
(merge {:left-accessories navigation
4242
:title-component content
43-
:insets (when use-insets (safe-area/get-insets))
43+
:insets (when use-insets safe-area/insets)
4444
:left-width (when navigation
4545
default-button-width)
4646
:border-bottom border-bottom?}

src/legacy/status_im/ui/screens/browser/stack.cljs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
(defn browser-stack
1111
[]
1212
(let [screen-id (rf/sub [:browser/screen-id])]
13-
[rn/view {:padding-top (safe-area/get-top) :flex 1}
13+
[rn/view {:padding-top safe-area/top :flex 1}
1414
(case screen-id
1515
:empty-tab [empty-tab/empty-tab]
1616
:browser [browser/browser]

src/legacy/status_im/ui/screens/wakuv2_settings/edit_node/views.cljs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
[react/keyboard-avoiding-view
3535
{:style {:flex 1}
3636
:ignore-offset true}
37-
[react/view {:flex 1 :padding-bottom (safe-area/get-bottom)}
37+
[react/view {:flex 1 :padding-bottom safe-area/bottom}
3838
[topbar/topbar {:title (i18n/label (if name :t/node-details :t/add-node))}]
3939
[react/scroll-view {:keyboard-should-persist-taps :handled}
4040
[react/view styles/edit-node-view

src/legacy/status_im/ui/screens/wakuv2_settings/views.cljs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
(views/defview wakuv2-settings
2929
[]
3030
(views/letsubs [nodes [:wakuv2-nodes/list]]
31-
[react/view {:flex 1 :padding-bottom (safe-area/get-bottom)}
31+
[react/view {:flex 1 :padding-bottom safe-area/bottom}
3232
[topbar/topbar
3333
{:title (i18n/label :t/wakuv2-settings)
3434
:navigation :none

src/mocks/js_dependencies.cljs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,9 @@
173173

174174
(def net-info #js {:addEventListener identity})
175175
(def react-native-biometrics #js {:default {}})
176-
(def react-native-static-safe-area-insets #js {:default {}})
176+
(def react-native-safe-area-context
177+
#js {:initialWindowMetrics #js {}
178+
:SafeAreaProvider #js {}})
177179

178180
(def back-handler
179181
#js
@@ -402,7 +404,7 @@
402404
"react-native-background-timer" background-timer
403405
"react-native-image-crop-picker" image-crop-picker
404406
"react-native-gesture-handler" react-native-gesture-handler
405-
"react-native-static-safe-area-insets" react-native-static-safe-area-insets
407+
"react-native-safe-area-context" react-native-safe-area-context
406408
"react-native-config" config
407409
"react-native-mmkv" react-native-mmkv
408410
"react-native-iphone-x-helper" (clj->js {:getStatusBarHeight (fn [])

src/quo/components/animated_header_flatlist/view.cljs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
[{:keys [header-comp main-comp back-button-on-press] :as params}]
5757
(let [theme (quo.context/use-theme)
5858
window-height (:height (rn/get-window))
59-
{:keys [top bottom]} (safe-area/get-insets)
59+
{:keys [top bottom]} safe-area/insets
6060
;; view height calculation is different because window height is different on iOS and
6161
;; Android:
6262
view-height (if platform/ios?

src/quo/components/drawers/documentation_drawers/style.cljs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55

66
(def outer-container
77
;; Margin negative to fill the bottom-sheet container where this component is used
8-
{:margin-bottom (- (+ (safe-area/get-bottom) 8))})
8+
{:margin-bottom (- (+ safe-area/bottom 8))})
99

1010
(def container
1111
{:align-items :flex-start
1212
:padding-horizontal 20})
1313

1414
(def content
1515
{:align-items :flex-start
16-
:margin-bottom (+ (safe-area/get-bottom) 12)})
16+
:margin-bottom (+ safe-area/bottom 12)})
1717

1818
(defn title
1919
[theme]

0 commit comments

Comments
 (0)