Skip to content

Commit 71886f5

Browse files
[#17986] fix: resolve review feedbacks
1 parent 852ec9e commit 71886f5

File tree

6 files changed

+22
-22
lines changed

6 files changed

+22
-22
lines changed

src/quo/components/overlay/style.cljs

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
:bottom 0
1010
:background-color background-color})
1111

12-
(def container-style
12+
(def container
1313
{:flex 1})
1414

15-
(def blur-style
15+
(def blur-container
1616
{:flex 1
1717
:background-color :transparent})

src/quo/components/overlay/view.cljs

+6-7
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,17 @@
99
[{:keys [type]} child]
1010
(let [background-color (case type
1111
:shell colors/neutral-80-opa-80-blur
12-
:drawer colors/neutral-100-opa-70-blur)]
13-
[rn/view
14-
{:style (style/overlay-background background-color)}
12+
:drawer colors/neutral-100-opa-70-blur
13+
:else nil)]
14+
[rn/view {:style (style/overlay-background background-color)}
1515
(if (= type :shell)
1616
[blur/view
1717
{:blur-amount 20
1818
:blur-radius 25
1919
:blur-type :transparent
2020
:overlay-color :transparent
21-
:style style/container-style}
22-
[rn/view {:style style/blur-style}
21+
:style style/container}
22+
[rn/view {:style style/blur-container}
2323
child]]
24-
[rn/view
25-
{:style style/container-style}
24+
[rn/view {:style style/container}
2625
child])]))

src/status_im2/contexts/profile/settings/header/avatar.cljs

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
[react-native.reanimated :as reanimated]
55
[status-im2.contexts.profile.settings.header.style :as style]))
66

7-
(defonce ^:const scroll-animation-input-range [0 50])
8-
7+
(def scroll-animation-input-range [0 50])
98
(def header-extrapolation-option
109
{:extrapolateLeft "clamp"
1110
:extrapolateRight "clamp"})

src/status_im2/contexts/profile/settings/header/header_shape.cljs

+2-5
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
[react-native.svg :as svg]
66
[status-im2.contexts.profile.settings.header.style :as style]))
77

8-
(defonce ^:const scroll-animation-input-range [0 45 50])
9-
108
(defn left-radius
119
[background-color]
1210
[svg/svg {:width "20" :height "20" :viewBox "0 0 20 20" :fill "none"}
@@ -21,14 +19,13 @@
2119
{:d "M20 20V0H0C11 0 20 9 20 20Z"
2220
:fill background-color}]])
2321

24-
2522
(defn f-view
2623
[{:keys [scroll-y customization-color theme]}]
2724
(let [background-color (colors/resolve-color customization-color theme 40)
2825
opacity-animation (reanimated/interpolate scroll-y
29-
scroll-animation-input-range
26+
[0 45 50]
3027
[1 1 0])]
31-
[rn/view
28+
[:<>
3229
[rn/view {:style (style/header-middle-shape background-color)}]
3330
[reanimated/view {:style (style/radius-container opacity-animation)}
3431
[left-radius background-color]

src/status_im2/contexts/profile/settings/header/view.cljs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
full-name (profile.utils/displayed-name profile)
2020
profile-picture (profile.utils/photo profile)
2121
emoji-string (string/join emoji-hash)]
22-
[rn/view
22+
[:<>
2323
[header.shape/view
2424
{:scroll-y scroll-y
2525
:customization-color customization-color

src/status_im2/contexts/profile/settings/view.cljs

+10-5
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,21 @@
2525
(let [current-y (oops/oget event "nativeEvent.contentOffset.y")]
2626
(reanimated/set-shared-value scroll-y current-y)))
2727

28-
(def footer
28+
(defn- f-footer
29+
[logout-press]
2930
[rn/view {:style style/footer-container}
30-
[quo/button {:type :danger :icon-left :i/log-out}
31+
[quo/button
32+
{:on-press logout-press
33+
:type :danger
34+
:icon-left :i/log-out}
3135
(i18n/label :t/logout)]])
3236

3337
(defn- settings-view
3438
[theme]
3539
(let [insets (safe-area/get-insets)
3640
customization-color (rf/sub [:profile/customization-color])
37-
scroll-y (reanimated/use-shared-value 0)]
41+
scroll-y (reanimated/use-shared-value 0)
42+
logout-press #(rf/dispatch [:multiaccounts.logout.ui/logout-pressed])]
3843
[quo/overlay {:type :shell}
3944
[rn/view {:style {:flex 1}}
4045
[rn/view
@@ -52,10 +57,10 @@
5257
[rn/flat-list
5358
{:header [settings.header/view {:scroll-y scroll-y}]
5459
:data settings.constants/settings-items
55-
:key-fn str
60+
:key-fn :title
5661
:shows-vertical-scroll-indicator false
5762
:render-fn f-settings-item-view
58-
:footer footer
63+
:footer [f-footer logout-press]
5964
:scroll-event-throttle 16
6065
:on-scroll #(scroll-handler % scroll-y)
6166
:bounces false}]]]))

0 commit comments

Comments
 (0)