Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add status tag for pending contact request to contact profile #19075

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/status_im/contexts/profile/contact/header/style.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,12 @@
{:background-color (colors/theme-colors colors/white colors/neutral-95 theme)
:padding-horizontal 20
:margin-top margin-top}))

(def status-tag-wrapper
{:flex-direction :row
:padding-top 12
:padding-right 12})

(def header-top-wrapper
{:flex-direction :row
:justify-content :space-between})
27 changes: 18 additions & 9 deletions src/status_im/contexts/profile/contact/header/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,38 @@
[quo.theme]
[react-native.core :as rn]
[status-im.common.scalable-avatar.view :as avatar]
[status-im.constants :as constants]
[status-im.contexts.profile.contact.header.style :as style]
[status-im.contexts.profile.utils :as profile.utils]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))

(defn view
[{:keys [scroll-y]}]
(let [{:keys [public-key customization-color
emoji-hash bio]
emoji-hash bio contact-request-state]
:as profile} (rf/sub [:contacts/current-contact])
customization-color (or customization-color :blue)
full-name (profile.utils/displayed-name profile)
profile-picture (profile.utils/photo profile)
online? (rf/sub [:visibility-status-updates/online? public-key])
theme (quo.theme/use-theme-value)]
[rn/view {:style style/header-container}
[rn/view {:style style/avatar-wrapper}
[avatar/view
{:scroll-y scroll-y
:full-name full-name
:online? online?
:profile-picture profile-picture
:border-color (colors/theme-colors colors/white colors/neutral-95 theme)
:customization-color customization-color}]]
[rn/view {:style style/header-top-wrapper}
[rn/view {:style style/avatar-wrapper}
[avatar/view
{:scroll-y scroll-y
:full-name full-name
:online? online?
:profile-picture profile-picture
:border-color (colors/theme-colors colors/white colors/neutral-95 theme)
:customization-color customization-color}]]
(when (= contact-request-state constants/contact-request-state-sent)
[rn/view {:style style/status-tag-wrapper}
[quo/status-tag
{:label (i18n/label :t/contact-profile-request-pending)
:status {:type :pending}
:size :large}]])]
[quo/page-top
{:title full-name
:description :text
Expand Down
1 change: 1 addition & 0 deletions translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2116,6 +2116,7 @@
"selected-count-from-max": "{{selected}}/{{max}}",
"online": "Online",
"contact-request-chat-pending": "Your contact request is pending",
"contact-profile-request-pending": "Contact request pending",
"contact-request-chat-add": "Add {{name}} as contact to send a message",
"join-request": "Join request",
"join-one-user": "Join {{user}}",
Expand Down