|
1 | 1 | (ns status-im.contexts.profile.settings.header.view
|
2 | 2 | (:require [quo.core :as quo]
|
3 |
| - [quo.foundations.colors :as colors] |
4 | 3 | [quo.theme]
|
5 | 4 | [react-native.core :as rn]
|
6 | 5 | [status-im.common.scalable-avatar.view :as avatar]
|
|
11 | 10 | [status-im.contexts.profile.utils :as profile.utils]
|
12 | 11 | [utils.re-frame :as rf]))
|
13 | 12 |
|
| 13 | +(defn- on-state-dropdown-press |
| 14 | + [] |
| 15 | + (rf/dispatch [:show-bottom-sheet |
| 16 | + {:shell? true |
| 17 | + :theme :dark |
| 18 | + :content visibility-sheet/view}])) |
| 19 | + |
14 | 20 | (defn view
|
15 | 21 | [{:keys [scroll-y]}]
|
16 |
| - (let [theme (quo.theme/use-theme) |
17 |
| - app-theme (rf/sub [:theme]) |
18 |
| - {:keys [public-key emoji-hash bio] :as profile} (rf/sub [:profile/profile-with-image]) |
19 |
| - online? (rf/sub [:visibility-status-updates/online? |
20 |
| - public-key]) |
21 |
| - status (rf/sub |
22 |
| - [:visibility-status-updates/visibility-status-update |
23 |
| - public-key]) |
24 |
| - customization-color (rf/sub [:profile/customization-color]) |
25 |
| - full-name (profile.utils/displayed-name profile) |
26 |
| - profile-picture (profile.utils/photo profile) |
27 |
| - {:keys [status-title status-icon]} (header.utils/visibility-status-type-data status) |
28 |
| - border-theme app-theme] |
| 22 | + (let [app-theme (rf/sub [:theme]) |
| 23 | + {:keys [public-key emoji-hash bio] |
| 24 | + :as profile} (rf/sub [:profile/profile-with-image]) |
| 25 | + online? (rf/sub [:visibility-status-updates/online? public-key]) |
| 26 | + status (rf/sub [:visibility-status-updates/visibility-status-update public-key]) |
| 27 | + customization-color (rf/sub [:profile/customization-color]) |
| 28 | + full-name (profile.utils/displayed-name profile) |
| 29 | + profile-picture (profile.utils/photo profile) |
| 30 | + {:keys [status-title |
| 31 | + status-icon]} (header.utils/visibility-status-type-data status)] |
29 | 32 | [:<>
|
30 | 33 | [header.shape/view
|
31 | 34 | {:scroll-y scroll-y
|
32 |
| - :customization-color customization-color |
33 |
| - :theme theme}] |
| 35 | + :customization-color customization-color}] |
34 | 36 | [rn/view {:style style/avatar-row-wrapper}
|
35 | 37 | [avatar/view
|
36 | 38 | {:scroll-y scroll-y
|
37 | 39 | :full-name full-name
|
38 | 40 | :online? online?
|
39 |
| - :border-color (colors/theme-colors colors/border-avatar-light |
40 |
| - colors/neutral-80-opa-80 |
41 |
| - border-theme) |
| 41 | + :border-color (style/avatar-border-color app-theme) |
42 | 42 | :customization-color customization-color
|
43 | 43 | :profile-picture profile-picture}]
|
44 |
| - [rn/view {:style {:margin-bottom 4}} |
45 |
| - [quo/dropdown |
46 |
| - {:background :blur |
47 |
| - :size :size-32 |
48 |
| - :type :outline |
49 |
| - :icon? true |
50 |
| - :no-icon-color? true |
51 |
| - :icon-name status-icon |
52 |
| - :on-press #(rf/dispatch [:show-bottom-sheet |
53 |
| - {:shell? true |
54 |
| - :theme :dark |
55 |
| - :content (fn [] [visibility-sheet/view])}])} |
56 |
| - status-title]]] |
| 44 | + [quo/dropdown |
| 45 | + {:background :blur |
| 46 | + :size :size-32 |
| 47 | + :type :outline |
| 48 | + :icon? true |
| 49 | + :no-icon-color? true |
| 50 | + :icon-name status-icon |
| 51 | + :on-press on-state-dropdown-press} |
| 52 | + status-title]] |
57 | 53 | [quo/page-top
|
58 | 54 | {:title-accessibility-label :username
|
59 | 55 | :emoji-dash emoji-hash
|
|
0 commit comments