diff --git a/src/status_im/ui/screens/activity_center/notification/contact_request/style.cljs b/src/status_im/ui/screens/activity_center/notification/contact_request/style.cljs deleted file mode 100644 index 90a6ad4c80..0000000000 --- a/src/status_im/ui/screens/activity_center/notification/contact_request/style.cljs +++ /dev/null @@ -1,11 +0,0 @@ -(ns status-im.ui.screens.activity-center.notification.contact-request.style - (:require [quo2.foundations.colors :as colors])) - -(def context-tag-text - {:color colors/white}) - -(def user-avatar-tag-text - {:color colors/white}) - -(def user-avatar-tag - {:background-color colors/white-opa-10}) diff --git a/src/status_im/ui/screens/activity_center/notification/contact_request/view.cljs b/src/status_im/ui/screens/activity_center/notification/contact_request/view.cljs index d153335625..b48b55e0e1 100644 --- a/src/status_im/ui/screens/activity_center/notification/contact_request/view.cljs +++ b/src/status_im/ui/screens/activity_center/notification/contact_request/view.cljs @@ -3,16 +3,13 @@ [quo2.core :as quo2] [status-im.constants :as constants] [status-im.i18n.i18n :as i18n] - [status-im.multiaccounts.core :as multiaccounts] - [status-im.ui.screens.activity-center.notification.contact-request.style :as style] - [status-im.ui.screens.activity-center.utils :as activity-center.utils] + [status-im.ui.screens.activity-center.notification.common.view :as common] [status-im.utils.datetime :as datetime] [utils.re-frame :as rf])) (defn view [{:keys [id author message last-message] :as notification}] (let [message (or message last-message) - contact (rf/sub [:contacts/contact-by-identity author]) pressable (case (:contact-request-state message) constants/contact-request-message-state-accepted ;; NOTE(2022-09-21): We need to dispatch to @@ -30,14 +27,7 @@ :icon :main-icons2/add-user :timestamp (datetime/timestamp->relative (:timestamp notification)) :unread? (not (:read notification)) - :context [[quo2/user-avatar-tag - {:color :purple - :override-theme :dark - :size :small - :style style/user-avatar-tag - :text-style style/user-avatar-tag-text} - (activity-center.utils/contact-name contact) - (multiaccounts/displayed-photo contact)] + :context [[common/user-avatar-tag author] (i18n/label :t/contact-request-sent)] :message {:body (get-in message [:content :text])} :status (case (:contact-request-state message) diff --git a/src/status_im/ui/screens/activity_center/notification/contact_verification/style.cljs b/src/status_im/ui/screens/activity_center/notification/contact_verification/style.cljs deleted file mode 100644 index bc1ffb8781..0000000000 --- a/src/status_im/ui/screens/activity_center/notification/contact_verification/style.cljs +++ /dev/null @@ -1,11 +0,0 @@ -(ns status-im.ui.screens.activity-center.notification.contact-verification.style - (:require [quo2.foundations.colors :as colors])) - -(def context-tag-text - {:color colors/white}) - -(def user-avatar-tag-text - {:color colors/white}) - -(def user-avatar-tag - {:background-color colors/white-opa-10}) diff --git a/src/status_im/ui/screens/activity_center/notification/contact_verification/view.cljs b/src/status_im/ui/screens/activity_center/notification/contact_verification/view.cljs index 38df5a9e5d..f11bb16dd0 100644 --- a/src/status_im/ui/screens/activity_center/notification/contact_verification/view.cljs +++ b/src/status_im/ui/screens/activity_center/notification/contact_verification/view.cljs @@ -3,9 +3,7 @@ [quo2.core :as quo2] [status-im.constants :as constants] [status-im.i18n.i18n :as i18n] - [status-im.multiaccounts.core :as multiaccounts] - [status-im.ui.screens.activity-center.notification.contact-verification.style :as style] - [status-im.ui.screens.activity-center.utils :as activity-center.utils] + [status-im.ui.screens.activity-center.notification.common.view :as common] [status-im.utils.datetime :as datetime] [utils.re-frame :as rf])) @@ -17,24 +15,16 @@ (defn- context-tags [challenger? {:keys [author contact-verification-status]}] - (let [contact (rf/sub [:contacts/contact-by-identity author])] - [[quo2/user-avatar-tag - {:color :purple - :override-theme :dark - :size :small - :style style/user-avatar-tag - :text-style style/user-avatar-tag-text} - (activity-center.utils/contact-name contact) - (multiaccounts/displayed-photo contact)] - (if challenger? - (when (or (= contact-verification-status constants/contact-verification-status-accepted) - (= contact-verification-status constants/contact-verification-status-trusted) - (= contact-verification-status constants/contact-verification-status-untrustworthy)) - (str (str/lower-case (i18n/label :t/replied)) ":")) - (when (or (= contact-verification-status constants/contact-verification-status-accepted) - (= contact-verification-status constants/contact-verification-status-pending) - (= contact-verification-status constants/contact-verification-status-declined)) - (str (i18n/label :t/identity-verification-request-sent) ":")))])) + [[common/user-avatar-tag author] + (if challenger? + (when (or (= contact-verification-status constants/contact-verification-status-accepted) + (= contact-verification-status constants/contact-verification-status-trusted) + (= contact-verification-status constants/contact-verification-status-untrustworthy)) + (str (str/lower-case (i18n/label :t/replied)) ":")) + (when (or (= contact-verification-status constants/contact-verification-status-accepted) + (= contact-verification-status constants/contact-verification-status-pending) + (= contact-verification-status constants/contact-verification-status-declined)) + (str (i18n/label :t/identity-verification-request-sent) ":")))]) (defn- activity-message [challenger? {:keys [contact-verification-status message reply-message]}] diff --git a/src/status_im/ui/screens/activity_center/notification/mentions/view.cljs b/src/status_im/ui/screens/activity_center/notification/mentions/view.cljs index 5dd9b0cbf4..ce11d9206d 100644 --- a/src/status_im/ui/screens/activity_center/notification/mentions/view.cljs +++ b/src/status_im/ui/screens/activity_center/notification/mentions/view.cljs @@ -37,9 +37,9 @@ :unread? (not (:read notification)) :context [[common/user-avatar-tag author] [quo2/text {:style style/tag-text} (str/lower-case (i18n/label :t/on))] - ;; TODO (@smohamedjavid): The `group-avatar-tag` component - ;; does NOT support displaying channel name along with community/chat name. - ;; Need to update the component to support it. + ;; TODO (@smohamedjavid): The `group-avatar-tag` component + ;; does NOT support displaying channel name along with community/chat name. + ;; Need to update the component to support it. [quo2/group-avatar-tag chat-name {:size :small :override-theme :dark :color colors/primary-50