Skip to content

Commit 4286163

Browse files
authored
[#16066] bottom sheet height (#16285)
1 parent 2b465cb commit 4286163

File tree

5 files changed

+32
-26
lines changed

5 files changed

+32
-26
lines changed

src/quo2/components/drawers/documentation_drawers/view.cljs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,17 @@
2626
:style {:color (colors/theme-colors colors/neutral-100
2727
colors/white
2828
(when shell? :dark))}
29-
:weight :semi-bold} title]
29+
:weight :semi-bold}
30+
title]
3031
[rn/view {:style style/content :accessibility-label :documentation-drawer-content}
3132
content]
3233
(when show-button?
3334
[button/button
34-
(merge {:size 24
35-
:type (if shell? :blur-bg-outline :outline)
36-
:on-press on-press-button
37-
:accessibility-label :documentation-drawer-button
38-
:after button-icon}
39-
(when shell? {:override-theme :dark})) button-label])]])
35+
(cond-> {:size 24
36+
:type (if shell? :blur-bg-outline :outline)
37+
:on-press on-press-button
38+
:accessibility-label :documentation-drawer-button
39+
:after button-icon}
40+
shell? (assoc :override-theme :dark))
41+
button-label])]])
4042

src/status_im2/common/bottom_sheet/style.cljs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
(defn sheet
1717
[{:keys [top bottom]} window-height override-theme padding-bottom-override shell?]
1818
{:position :absolute
19-
:max-height (- window-height top 20)
19+
:max-height (cond-> window-height
20+
platform/ios? (- top))
2021
:z-index 1
2122
:bottom 0
2223
:left 0

src/status_im2/common/bottom_sheet/view.cljs

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
(ns status-im2.common.bottom-sheet.view
2-
(:require [utils.re-frame :as rf]
3-
[react-native.core :as rn]
2+
(:require [oops.core :as oops]
43
[quo2.foundations.colors :as colors]
5-
[react-native.reanimated :as reanimated]
6-
[status-im2.common.bottom-sheet.style :as style]
4+
[react-native.blur :as blur]
5+
[react-native.core :as rn]
76
[react-native.gesture :as gesture]
8-
[oops.core :as oops]
97
[react-native.hooks :as hooks]
10-
[react-native.blur :as blur]
11-
[reagent.core :as reagent]))
8+
[react-native.reanimated :as reanimated]
9+
[reagent.core :as reagent]
10+
[status-im2.common.bottom-sheet.style :as style]
11+
[utils.re-frame :as rf]))
1212

1313
(def duration 450)
1414
(def timing-options #js {:duration duration})
@@ -62,12 +62,15 @@
6262
translate-y (reanimated/use-shared-value window-height)
6363
sheet-gesture (get-sheet-gesture translate-y bg-opacity window-height on-close)]
6464
(rn/use-effect
65-
#(if hide? (hide translate-y bg-opacity window-height on-close) (show translate-y bg-opacity))
65+
#(if hide?
66+
(hide translate-y bg-opacity window-height on-close)
67+
(show translate-y bg-opacity))
6668
[hide?])
67-
(hooks/use-back-handler #(do (when (fn? on-close)
68-
(on-close))
69-
(rf/dispatch [:hide-bottom-sheet])
70-
true))
69+
(hooks/use-back-handler (fn []
70+
(when (fn? on-close)
71+
(on-close))
72+
(rf/dispatch [:hide-bottom-sheet])
73+
true))
7174
[rn/view {:style {:flex 1}}
7275
;; backdrop
7376
[rn/touchable-without-feedback {:on-press #(rf/dispatch [:hide-bottom-sheet])}
@@ -86,8 +89,8 @@
8689
padding-bottom-override
8790
shell?))
8891
:on-layout #(reset! sheet-height (oops/oget % "nativeEvent" "layout" "height"))}
89-
(when shell? [blur/ios-view {:style style/shell-bg}])
90-
92+
(when shell?
93+
[blur/ios-view {:style style/shell-bg}])
9194
(when selected-item
9295
[rn/view
9396
[rn/view {:style (style/selected-item override-theme window-height @sheet-height insets)}

src/status_im2/contexts/onboarding/profiles/view.cljs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@
3333

3434
(defn show-new-account-options
3535
[]
36-
(rf/dispatch [:show-bottom-sheet {:content new-account-options}]))
36+
(rf/dispatch [:show-bottom-sheet
37+
{:content new-account-options
38+
:shell? true}]))
3739

3840
(defn delete-profile-confirmation
3941
[key-uid context]

src/status_im2/navigation/view.cljs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,7 @@
8282
{:style {:position :relative :flex 1}
8383
:keyboard-vertical-offset (- (max 20 (:bottom insets)))}
8484
(when sheet
85-
[:f>
86-
bottom-sheet/f-view
87-
{:insets insets :hide? hide?}
85+
[:f> bottom-sheet/f-view {:insets insets :hide? hide?}
8886
sheet])]]))))
8987

9088
(def toasts (reagent/reactify-component toasts/toasts))

0 commit comments

Comments
 (0)