File tree 6 files changed +22
-22
lines changed
status_im2/contexts/profile/settings
6 files changed +22
-22
lines changed Original file line number Diff line number Diff line change 9
9
:bottom 0
10
10
:background-color background-color})
11
11
12
- (def container-style
12
+ (def container
13
13
{:flex 1 })
14
14
15
- (def blur-style
15
+ (def blur-container
16
16
{:flex 1
17
17
:background-color :transparent })
Original file line number Diff line number Diff line change 9
9
[{:keys [type]} child]
10
10
(let [background-color (case type
11
11
: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)}
15
15
(if (= type :shell )
16
16
[blur/view
17
17
{:blur-amount 20
18
18
:blur-radius 25
19
19
:blur-type :transparent
20
20
: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 }
23
23
child]]
24
- [rn/view
25
- {:style style/container-style}
24
+ [rn/view {:style style/container}
26
25
child])]))
Original file line number Diff line number Diff line change 4
4
[react-native.reanimated :as reanimated]
5
5
[status-im2.contexts.profile.settings.header.style :as style]))
6
6
7
- (defonce ^:const scroll-animation-input-range [0 50 ])
8
-
7
+ (def scroll-animation-input-range [0 50 ])
9
8
(def header-extrapolation-option
10
9
{:extrapolateLeft " clamp"
11
10
:extrapolateRight " clamp" })
Original file line number Diff line number Diff line change 5
5
[react-native.svg :as svg]
6
6
[status-im2.contexts.profile.settings.header.style :as style]))
7
7
8
- (defonce ^:const scroll-animation-input-range [0 45 50 ])
9
-
10
8
(defn left-radius
11
9
[background-color]
12
10
[svg/svg {:width " 20" :height " 20" :viewBox " 0 0 20 20" :fill " none" }
21
19
{:d " M20 20V0H0C11 0 20 9 20 20Z"
22
20
:fill background-color}]])
23
21
24
-
25
22
(defn f-view
26
23
[{:keys [scroll-y customization-color theme]}]
27
24
(let [background-color (colors/resolve-color customization-color theme 40 )
28
25
opacity-animation (reanimated/interpolate scroll-y
29
- scroll-animation-input-range
26
+ [ 0 45 50 ]
30
27
[1 1 0 ])]
31
- [rn/view
28
+ [:<>
32
29
[rn/view {:style (style/header-middle-shape background-color)}]
33
30
[reanimated/view {:style (style/radius-container opacity-animation)}
34
31
[left-radius background-color]
Original file line number Diff line number Diff line change 19
19
full-name (profile.utils/displayed-name profile)
20
20
profile-picture (profile.utils/photo profile)
21
21
emoji-string (string/join emoji-hash)]
22
- [rn/view
22
+ [:<>
23
23
[header.shape/view
24
24
{:scroll-y scroll-y
25
25
:customization-color customization-color
Original file line number Diff line number Diff line change 25
25
(let [current-y (oops/oget event " nativeEvent.contentOffset.y" )]
26
26
(reanimated/set-shared-value scroll-y current-y)))
27
27
28
- (def footer
28
+ (defn- f-footer
29
+ [logout-press]
29
30
[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 }
31
35
(i18n/label :t/logout )]])
32
36
33
37
(defn- settings-view
34
38
[theme]
35
39
(let [insets (safe-area/get-insets )
36
40
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 ])]
38
43
[quo/overlay {:type :shell }
39
44
[rn/view {:style {:flex 1 }}
40
45
[rn/view
52
57
[rn/flat-list
53
58
{:header [settings.header/view {:scroll-y scroll-y}]
54
59
:data settings.constants/settings-items
55
- :key-fn str
60
+ :key-fn :title
56
61
:shows-vertical-scroll-indicator false
57
62
:render-fn f-settings-item-view
58
- :footer footer
63
+ :footer [f- footer logout-press]
59
64
:scroll-event-throttle 16
60
65
:on-scroll #(scroll-handler % scroll-y)
61
66
:bounces false }]]]))
You can’t perform that action at this time.
0 commit comments