Skip to content

Commit f9767e8

Browse files
committed
trust mark in profile page
1 parent 9aac94d commit f9767e8

File tree

3 files changed

+25
-16
lines changed

3 files changed

+25
-16
lines changed

src/quo/components/text_combinations/username/view.cljs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,17 @@
4040
:color (colors/resolve-color color theme)}]))
4141

4242
(defn status-icon
43-
[{:keys [theme name-type status]
43+
[{:keys [name-type status]
4444
:or {name-type :default}}]
4545
[rn/view {:style (style/status-icon-container name-type status)}
4646
(case status
47-
:verified [icon-20 :i/verified theme :success]
48-
:contact [icon-20 :i/contact theme :blue]
49-
:untrustworthy [icon-20 :i/untrustworthy theme :danger]
50-
:blocked [icon-20 :i/block theme :danger]
47+
:verified [icon-20 :i/verified :success]
48+
:contact [icon-20 :i/contact :blue]
49+
:untrustworthy [icon-20 :i/untrustworthy :danger]
50+
:blocked [icon-20 :i/block :danger]
5151
:untrustworthy-contact [:<>
52-
[icon-20 :i/untrustworthy theme :danger]
53-
[icon-20 :i/contact theme :blue]]
52+
[icon-20 :i/untrustworthy :danger]
53+
[icon-20 :i/contact :blue]]
5454
nil)])
5555

5656
(defn view

src/status_im/contexts/profile/contact/actions/view.cljs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
(defn view
2626
[]
27-
(let [{:keys [nickname public-key contact-request-state blocked?]
27+
(let [{:keys [nickname public-key contact-request-state blocked? trust-status]
2828
:as contact} (rf/sub [:contacts/current-contact])
2929
full-name (profile.utils/displayed-name contact)
3030
on-remove-nickname (rn/use-callback
@@ -87,7 +87,10 @@
8787
:accessibility-label :remove-nickname
8888
:danger? true})
8989
{:icon :i/untrustworthy
90-
:label (i18n/label :t/mark-as-untrusted)
90+
:label (i18n/label (if (= trust-status
91+
constants/contact-trust-status-untrustworthy)
92+
:t/remove-untrusted-mark
93+
:t/mark-as-untrusted))
9194
:on-press not-implemented/alert
9295
:accessibility-label :mark-as-untrusted
9396
:add-divider? (when-not has-nickname? true)

src/status_im/contexts/profile/contact/header/view.cljs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
(defn view
2727
[{:keys [scroll-y]}]
2828
(let [{:keys [public-key customization-color ens-name nickname secondary-name
29-
emoji-hash bio blocked? contact-request-state]
29+
emoji-hash bio blocked? contact-request-state trust-status]
3030
:as contact} (rf/sub [:contacts/current-contact])
3131
customization-color (or customization-color constants/profile-default-color)
3232
full-name (profile.utils/displayed-name contact)
@@ -35,12 +35,18 @@
3535
theme (quo.context/use-theme)
3636
contact-status (rn/use-memo
3737
(fn []
38-
(cond
39-
(= contact-request-state
40-
constants/contact-request-state-mutual) :contact
41-
blocked? :blocked
42-
:else nil))
43-
[blocked? contact-request-state])
38+
(let [is-contact? (= contact-request-state
39+
constants/contact-request-state-mutual)
40+
is-untrustworthy? (= trust-status
41+
constants/contact-trust-status-untrustworthy)]
42+
(cond
43+
(and is-contact?
44+
is-untrustworthy?) :untrustworthy-contact
45+
blocked? :blocked
46+
is-contact? :contact
47+
is-untrustworthy? :untrustworthy
48+
:else nil)))
49+
[blocked? contact-request-state trust-status])
4450
on-start-chat (rn/use-callback
4551
#(rf/dispatch [:chat.ui/start-chat public-key ens-name])
4652
[ens-name public-key])

0 commit comments

Comments
 (0)