From bb20c5848ff8d0c015d2f3948e77bf757fc9c62f Mon Sep 17 00:00:00 2001 From: Ibrahem Khalil Date: Fri, 7 Apr 2023 17:49:56 +0200 Subject: [PATCH] [15383] Add the album count attribute to message body (#15487) --- src/status_im/data_store/messages.cljs | 3 ++- .../ui2/screens/chat/components/reply/view.cljs | 12 ++++++++---- translations/en.json | 1 + 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/status_im/data_store/messages.cljs b/src/status_im/data_store/messages.cljs index 3bfae20841..175358240f 100644 --- a/src/status_im/data_store/messages.cljs +++ b/src/status_im/data_store/messages.cljs @@ -41,7 +41,8 @@ :albumId :album-id :imageWidth :image-width :imageHeight :image-height - :new :new?}) + :new :new? + :albumImagesCount :album-images-count}) (update :quoted-message set/rename-keys diff --git a/src/status_im/ui2/screens/chat/components/reply/view.cljs b/src/status_im/ui2/screens/chat/components/reply/view.cljs index 69a5b2f45f..93f86d97a3 100644 --- a/src/status_im/ui2/screens/chat/components/reply/view.cljs +++ b/src/status_im/ui2/screens/chat/components/reply/view.cljs @@ -76,7 +76,8 @@ (format-reply-author from contact-name current-public-key)]]) (defn reply-message - [{:keys [from identicon content-type contentType parsed-text content deleted? deleted-for-me?]} + [{:keys [from identicon content-type contentType parsed-text content deleted? deleted-for-me? + album-images-count]} in-chat-input? pin? recording-audio?] (let [contact-name (rf/sub [:contacts/contact-name-by-identity from]) current-public-key (rf/sub [:multiaccount/public-key]) @@ -113,9 +114,12 @@ (= constants/content-type-audio content-type)) {:color (colors/theme-colors colors/neutral-50 colors/neutral-40)}))} (case (or content-type contentType) - constants/content-type-image "Image" - constants/content-type-sticker "Sticker" - constants/content-type-audio "Audio" + constants/content-type-image (if album-images-count + (i18n/label :t/images-albums-count + {:album-images-count album-images-count}) + (i18n/label :t/image)) + constants/content-type-sticker (i18n/label :t/sticker) + constants/content-type-audio (i18n/label :t/audio) (get-quoted-text-with-mentions (or parsed-text (:parsed-text content))))]])] (when (and in-chat-input? (not recording-audio?)) [quo2.button/button diff --git a/translations/en.json b/translations/en.json index 727a215be4..5097121aa3 100644 --- a/translations/en.json +++ b/translations/en.json @@ -2018,6 +2018,7 @@ "you-have-no-contacts": "You have no contacts", "my-albums": "My albums", "images": "images", + "images-albums-count": "{{album-images-count}} images", "only-6-images": "You can only add 6 images to your message", "delivered": "Delivered", "mark-all-notifications-as-read": "Mark all notifications as read",