File tree 28 files changed +66
-157
lines changed
28 files changed +66
-157
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
(ns legacy.status-im.subs.root
2
2
(:require
3
3
legacy.status-im.subs.browser
4
- legacy.status-im.subs.ens
5
4
legacy.status-im.subs.mailservers
6
5
[re-frame.core :as re-frame]))
7
6
Original file line number Diff line number Diff line change 10
10
[quo.core :as quo]
11
11
[re-frame.core :as re-frame.core]
12
12
[react-native.core :as rn]
13
- [status-im.contexts.profile.utils :as profile.utils]
14
- [utils.ens.core :as utils.ens]))
13
+ [status-im.contexts.profile.utils :as profile.utils]))
15
14
16
15
; ;TODO REWORK THIS NAMESPACE
17
16
62
61
:indicator-border 0
63
62
:indicator-color " #000000"
64
63
:color (get text-style :color )
65
- :length 2
66
- :ring? (not (utils.ens/is-valid-eth-name? full-name))
67
- :ring-width 2 })}
64
+ :length 2 })}
68
65
{:size size}]
69
66
[photos/photo photo-path {:size size}])
70
67
(when-not community?
101
98
:chat-icon (styles/custom-size-icon size)
102
99
:default-chat-icon (styles/default-chat-icon-profile colors /default-chat-color size )
103
100
:default-chat-icon-text (styles/default-chat-icon-text size )}])
104
-
105
-
Original file line number Diff line number Diff line change 13
13
[:static? {:optional true } [:maybe boolean?]]
14
14
[:status-indicator? {:optional true } [:maybe boolean?]]
15
15
[:online? {:optional true } [:maybe boolean?]]
16
- [:ring? {:optional true } [:maybe boolean?]]
17
16
[:profile-picture
18
17
{:optional true }
19
18
[:maybe :schema.quo/profile-picture-source ]]]]]
Original file line number Diff line number Diff line change 7
7
:status-indicator 12
8
8
:status-indicator-border 4
9
9
:status-indicator-center-to-edge 12
10
- :font-size :heading-1
11
- :ring-width 4 }
10
+ :font-size :heading-1 }
12
11
:size-64 {:dimensions 64
13
12
:status-indicator 8
14
13
:status-indicator-border 2
15
14
:status-indicator-center-to-edge 6
16
- :font-size :heading-1
17
- :ring-width 2 }
15
+ :font-size :heading-1 }
18
16
:medium {:dimensions 48
19
17
:status-indicator 8
20
18
:status-indicator-border 2
21
19
:status-indicator-center-to-edge 6
22
- :font-size :heading-2
23
- :ring-width 2 }
20
+ :font-size :heading-2 }
24
21
:small {:dimensions 32
25
22
:status-indicator 8
26
23
:status-indicator-border 2
27
24
:status-indicator-center-to-edge 4
28
- :font-size :paragraph-2
29
- :ring-width 2 }
25
+ :font-size :paragraph-2 }
30
26
28 {:dimensions 28
31
27
:status-indicator 0
32
28
:status-indicator-border 0
33
29
:status-indicator-center-to-edge 0
34
- :font-size :paragraph-2
35
- :ring-width 0 }
30
+ :font-size :paragraph-2 }
36
31
:xs {:dimensions 24
37
32
:status-indicator 0
38
33
:status-indicator-border 0
39
34
:status-indicator-center-to-edge 0
40
- :font-size :paragraph-2
41
- :ring-width 2 }
35
+ :font-size :paragraph-2 }
42
36
:xxs {:dimensions 20
43
37
:status-indicator 0
44
38
:status-indicator-border 0
45
39
:status-indicator-center-to-edge 0
46
- :font-size :label
47
- :ring-width 2 }
40
+ :font-size :label }
48
41
:xxxs {:dimensions 16
49
42
:status-indicator 0
50
43
:status-indicator-border 0
51
44
:status-indicator-center-to-edge 0
52
- :font-size :label
53
- :ring-width 2 }})
45
+ :font-size :label }})
54
46
55
47
(defn initials-avatar
56
48
[size customization-color theme]
Original file line number Diff line number Diff line change 27
27
(utils.string/get-initials full-name amount-initials)]]))
28
28
29
29
(defn user-avatar-internal
30
- " Render user avatar with `profile-picture`
31
-
32
- WARNING:
33
- When calling the `profile-picture-fn` and passing the `:ring?` key, be aware that the `profile-picture-fn`
34
- may have an `:override-ring?` value. If it does then the `:ring?` value will not be used.
35
- For reference, refer to the `utils.image-server` namespace for these `profile-picture-fn` are generated."
36
- [{:keys [full-name size profile-picture static? status-indicator? online? ring?]
30
+ " Render user avatar with `profile-picture`."
31
+ [{:keys [full-name size profile-picture static? status-indicator? online?]
37
32
:or {size :big
38
33
status-indicator? true
39
- online? true
40
- ring? true }
34
+ online? true }
41
35
:as props}]
42
36
(let [theme (quo.context/use-theme )
43
37
picture-config (:config profile-picture)
80
74
:indicator-color indicator-color
81
75
:theme theme
82
76
:color (:color style/initials-avatar-text)
83
- :size (:width outer-styles)
84
- :ring? ring?
85
- :ring-width (:ring-width sizes)})}
77
+ :size (:width outer-styles)})}
86
78
(:uri profile-picture)
87
79
profile-picture
88
80
Original file line number Diff line number Diff line change 18
18
(case type
19
19
:user [user-avatar/user-avatar
20
20
(assoc item
21
- :ring? false
22
21
:status-indicator? false
23
22
:size user-avatar-size)]
24
23
Original file line number Diff line number Diff line change 35
35
{:size :xxxs
36
36
:full-name display-name
37
37
:profile-picture photo-path
38
- :ring? false
39
38
:status-indicator? false }]])
40
39
41
40
(defn split-text
Original file line number Diff line number Diff line change 81
81
:accessibility-label :open-profile }
82
82
[user-avatar/user-avatar
83
83
(merge {:status-indicator? true
84
- :ring? true
85
84
:customization-color customization-color
86
85
:size :small }
87
86
avatar-props)]])
136
135
:qr-code-on-press callback
137
136
:notification-count number
138
137
:max-unread-notifications used to specify max number for counter
139
- :right-section-content
138
+ :right-section-content
140
139
"
141
140
[{:keys [avatar-on-press avatar-props customization-color container-style] :as props}]
142
141
[rn/view {:style (merge style/top-nav-container container-style)}
Original file line number Diff line number Diff line change 23
23
(assoc props
24
24
:size :size-64
25
25
:status-indicator? false
26
- :online? false
27
- :ring? false )]
26
+ :online? false )]
28
27
29
28
:wallet-account
30
29
[account-avatar/view (assoc props :size :size-64 :type :default )]
Original file line number Diff line number Diff line change 114
114
:profile-picture profile-picture
115
115
:size (if (= size 24 ) :xxs 28 )
116
116
:status-indicator? false
117
- :ring? false
118
117
:customization-color customization-color}]]
119
118
120
119
:multiuser
Original file line number Diff line number Diff line change 26
26
(case type
27
27
:default-keypair [user-avatar/user-avatar
28
28
{:size :xxs
29
- :ring? false
30
29
:customization-color customization-color
31
30
:profile-picture profile-picture}]
32
31
:recovery-phrase [icons/icon
Original file line number Diff line number Diff line change 27
27
(if (= avatar-type :default-keypair )
28
28
[user-avatar/user-avatar
29
29
{:full-name full-name
30
- :ring? true
31
30
:size :small
32
31
:status-indicator? false
33
32
:customization-color customization-color
Original file line number Diff line number Diff line change 16
16
[:indicator-center-to-edge {:optional true } [:maybe :int ]]
17
17
[:theme :schema.common/theme ]
18
18
[:color :string ]
19
- [:size :int ]
20
- [:ring? :boolean ]
21
- [:ring-width :int ]])
19
+ [:size :int ]])
22
20
23
21
(def ^:private ?account-image-uri-options
24
22
[:map
25
23
[:port :int ]
26
24
[:ratio :double ]
27
25
[:key-uid :string ]
28
26
[:image-name :string ]
29
- [:theme :schema.common/theme ]
30
- [:override-ring? [:maybe :boolean ]]])
27
+ [:theme :schema.common/theme ]])
31
28
32
29
(def ^:private ?initials-image-uri-options
33
30
[:map
38
35
[:theme :schema.common/theme ]
39
36
[:customization-color ?customization-color]
40
37
[:key-uid {:optional true } [:maybe :string ]]
41
- [:public-key {:optional true } [:maybe :string ]]
42
- [:override-ring? {:optional true } [:maybe :boolean ]]])
38
+ [:public-key {:optional true } [:maybe :string ]]])
43
39
44
40
(def ^:private ?contact-image-uri-options
45
41
[:map
48
44
[:ratio :double ]
49
45
[:image-name :string ]
50
46
[:public-key :string ]
51
- [:theme :schema.common/theme ]
52
- [:override-ring? [:maybe :boolean ]]])
47
+ [:theme :schema.common/theme ]])
53
48
54
49
(def ^:private ?image-uri-config
55
50
[:multi {:dispatch :type }
Original file line number Diff line number Diff line change 19
19
{:full-name display-name
20
20
:profile-picture photo-path
21
21
:size :xxs
22
- :ring? false
23
22
:status-indicator? false }]))
24
23
25
24
(defn extra-action-view
Original file line number Diff line number Diff line change 15
15
:online? online?
16
16
:profile-picture profile-picture
17
17
:status-indicator? true
18
- :ring? true
19
18
:customization-color customization-color
20
19
:size :big }]]))
Original file line number Diff line number Diff line change 177
177
preview-text]))
178
178
179
179
(defn avatar-view
180
- [{:keys [contact chat-id full-name color muted? image]}]
180
+ [{:keys [contact chat-id full-name color image]}]
181
181
[rn/view {:style {:justify-content :center }}
182
182
(if contact ; `contact` is passed when it's not a group chat
183
183
(let [online? (rf/sub [:visibility-status-updates/online? chat-id])
184
184
photo-path (rf/sub [:chats/photo-path chat-id])]
185
185
[quo/user-avatar
186
- (cond-> {:full-name full-name
187
- :size :small
188
- :online? online?
189
- :profile-picture photo-path}
190
- muted?
191
- (assoc :ring? false ))])
186
+ {:full-name full-name
187
+ :size :small
188
+ :online? online?
189
+ :profile-picture photo-path}])
192
190
[quo/group-avatar
193
191
{:customization-color color
194
192
:picture (when image {:uri image})
258
256
:chat-id chat-id
259
257
:full-name primary-name
260
258
:color color
261
- :muted? muted
262
259
:image image}]
263
260
[rn/view {:style {:flex-shrink 1 }}
264
261
[rn/view {:style style/chat-data-container}
Original file line number Diff line number Diff line change 87
87
primary-name)
88
88
:profile-picture (or user-avatar photo-path)
89
89
:status-indicator? false
90
- :size :xxxs
91
- :ring? false }]
90
+ :size :xxxs }]
92
91
[quo/text
93
92
{:weight :semi-bold
94
93
:size (if pin? :label :paragraph-2 )
Original file line number Diff line number Diff line change 5
5
[utils.re-frame :as rf]))
6
6
7
7
(defn avatar
8
- [{:keys [public-key size hide-ring? ]}]
8
+ [{:keys [public-key size]}]
9
9
(let [[primary-name _] (rf/sub [:contacts/contact-two-names-by-identity public-key])
10
10
photo-path (rf/sub [:chats/photo-path public-key])
11
11
online? (rf/sub [:visibility-status-updates/online? public-key])]
15
15
:on-press #(rf/dispatch [:chat.ui/show-profile public-key])}
16
16
[quo/user-avatar
17
17
{:full-name primary-name
18
- :ring? (not hide-ring?)
19
18
:profile-picture photo-path
20
19
:online? online?
21
20
:size size}]]]))
Original file line number Diff line number Diff line change 19
19
{:full-name display-name
20
20
:profile-picture profile-picture
21
21
:status-indicator? false
22
- :ring? false
23
22
:size :xxxs }]]
24
23
[quo/text
25
24
{:weight :semi-bold
Original file line number Diff line number Diff line change 44
44
45
45
(defn avatar-container
46
46
[{:keys [content last-in-group? pinned-by quoted-message from bridge-message]}
47
- hide-reactions? in-reaction-or-action-menu? show-user-info? in-pinned-view? ]
47
+ hide-reactions? in-reaction-or-action-menu? show-user-info?]
48
48
(cond
49
49
(:user-avatar bridge-message)
50
50
[fast-image/fast-image
51
51
{:source {:uri (:user-avatar bridge-message)}
52
52
:fallback-content [quo/user-avatar
53
53
{:full-name (bridge-message-user-name (:user-name bridge-message))
54
- :ring? false
55
54
:online? false
56
55
:status-indicator? false
57
56
:size :small }]
69
68
in-reaction-or-action-menu?)
70
69
[avatar/avatar
71
70
{:public-key from
72
- :size :small
73
- :hide-ring? (or in-pinned-view? in-reaction-or-action-menu?)}]
71
+ :size :small }]
74
72
75
73
:else
76
74
[rn/view {:padding-top 4 :width 32 }]))
135
133
{:full-name primary-name
136
134
:profile-picture photo-path
137
135
:status-indicator? false
138
- :size :xxxs
139
- :ring? false }]
136
+ :size :xxxs }]
140
137
[quo/text
141
138
{:weight :semi-bold
142
139
:style {:margin-left 4 }}
143
140
primary-name]]))
144
141
145
-
146
142
(defn resolve-group-system-message
147
143
[{:keys [children]}]
148
144
(reduce (fn [acc {:keys [type literal]}]
285
281
[rn/view
286
282
{:style {:padding-horizontal 4
287
283
:flex-direction :row }}
288
- [avatar-container message-data hide-reactions? in-reaction-or-action-menu? show-user-info?
289
- (:in-pinned-view? context)]
284
+ [avatar-container message-data hide-reactions? in-reaction-or-action-menu? show-user-info?]
290
285
(into
291
286
(if hide-reactions?
292
287
[gesture/scroll-view]
Original file line number Diff line number Diff line change 20
20
:type :boolean }
21
21
{:key :status-indicator?
22
22
:type :boolean }
23
- {:label " Identicon Ring (applies only when there's no profile picture)"
24
- :key :ring?
25
- :type :boolean }
26
23
{:key :full-name
27
24
:type :text }
28
25
{:key :profile-picture
You can’t perform that action at this time.
0 commit comments