|
130 | 130 | :on-press #(hide-sheet-and-dispatch [:contact/block-contact |
131 | 131 | public-key])}])}])) |
132 | 132 |
|
| 133 | +(defn mark-as-untrusted-action |
| 134 | + [{:keys [public-key] :as item}] |
| 135 | + (hide-sheet-and-dispatch |
| 136 | + [:show-bottom-sheet |
| 137 | + {:content (fn [] |
| 138 | + [confirmation-drawer/confirmation-drawer |
| 139 | + {:title (i18n/label :t/mark-as-untrusted) |
| 140 | + :description (i18n/label :t/mark-as-untrusted-description |
| 141 | + {:username (:primary-name item)}) |
| 142 | + :context item |
| 143 | + :accessibility-label :block-user |
| 144 | + :button-text (i18n/label :t/mark-as-untrusted-button) |
| 145 | + :on-press #(print "Not implemented")}])}])) |
| 146 | + |
133 | 147 | (defn mute-chat-entry |
134 | 148 | [chat-id chat-type muted-till] |
135 | 149 | (let [muted? (rf/sub [:chats/muted chat-id])] |
|
260 | 274 | (entry {:icon :i/remove-user |
261 | 275 | :label (i18n/label :t/remove-from-contacts) |
262 | 276 | :on-press #(hide-sheet-and-dispatch [:contact.ui/remove-contact-pressed contact]) |
263 | | - :danger? false |
| 277 | + :danger? true |
264 | 278 | :accessibility-label :remove-from-contacts |
265 | 279 | :sub-label nil |
266 | 280 | :chevron? false})) |
|
300 | 314 | :sub-label nil |
301 | 315 | :chevron? false})) |
302 | 316 |
|
303 | | -;; TODO(OmarBasem): Requires status-go impl. |
304 | 317 | (defn mark-untrustworthy-entry |
305 | | - [] |
306 | | - (entry {:icon :i/alert |
307 | | - :label (i18n/label :t/mark-untrustworthy) |
308 | | - :on-press #(js/alert "TODO: to be implemented, requires status-go impl.") |
| 318 | + [item] |
| 319 | + (entry {:icon :i/untrustworthy |
| 320 | + :label (i18n/label :t/mark-as-untrusted) |
| 321 | + ;; :on-press #(js/alert "TODO: to be implemented, requires status-go impl.") |
| 322 | + :on-press #(mark-as-untrusted-action item) |
309 | 323 | :danger? true |
310 | | - :accessibility-label :mark-untrustworthy |
| 324 | + :accessibility-label :mark-as-untrusted |
311 | 325 | :sub-label nil |
312 | 326 | :chevron? false |
313 | 327 | :add-divider? true})) |
|
437 | 451 |
|
438 | 452 | (defn contact-actions |
439 | 453 | [{:keys [public-key added?] :as contact} {:keys [chat-id admin?] :as extra-data}] |
| 454 | + (tap> contact) |
440 | 455 | (let [current-pub-key (rf/sub [:multiaccount/public-key])] |
441 | 456 | [quo/action-drawer |
442 | 457 | [[(view-profile-entry public-key) |
|
445 | 460 | (show-qr-entry public-key) |
446 | 461 | (share-profile-entry public-key)] |
447 | 462 | [(when-not (= current-pub-key public-key) |
448 | | - (when config/show-not-implemented-features? |
449 | | - (mark-untrustworthy-entry))) |
| 463 | + (mark-untrustworthy-entry contact)) |
450 | 464 | (when added? (remove-from-contacts-entry contact)) |
451 | 465 | (when-not (= current-pub-key public-key) (block-user-entry contact))] |
452 | 466 | (when (and admin? chat-id) |
|
0 commit comments