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

Remove not-implemented box from sticker/emoji messages #19255

Merged
merged 11 commits into from
Mar 26, 2024
18 changes: 0 additions & 18 deletions src/legacy/status_im/ui/screens/chat/message/legacy_view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
(:require
[legacy.status-im.react-native.resources :as resources]
[legacy.status-im.ui.components.colors :as quo.colors]
[legacy.status-im.ui.components.fast-image :as fast-image]
[legacy.status-im.ui.screens.chat.message.legacy-style :as style]
[quo.core :as quo]
[quo.foundations.colors :as colors]
Expand Down Expand Up @@ -145,23 +144,6 @@
[rn/text {:style (style/status-text)}]
(-> content :parsed-text peek :children))]])

;; EMOJI
(defn emoji
[]
(fn [{:keys [content] :as message}]
[rn/view (style/message-view message)
[rn/view {:style (style/message-view-content)}
[rn/view {:style (style/style-message-text)}
[rn/text {:style (style/emoji-message message)}
(:text content)]]]]))

;; STICKER
(defn sticker
[{:keys [content]}]
[fast-image/fast-image
{:style {:margin 10 :width 140 :height 140}
:source {:uri (str (-> content :sticker :url) "&download=true")}}])

(defn contact-request-status-pending
[]
[rn/view {:style {:flex-direction :row}}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
(ns status-im.contexts.chat.messenger.messages.content.emoji-message.style)

(defn emoji-container
[margin-top]
{:flex-direction :row
:margin-top margin-top})

(def emoji-text
{:font-size 36
:line-height 42})
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
(ns status-im.contexts.chat.messenger.messages.content.emoji-message.view
(:require [react-native.core :as rn]
[status-im.contexts.chat.messenger.messages.content.emoji-message.style :as style]))

(defn view
[{:keys [content last-in-group? pinned in-pinned-view?]}]
(let [margin-top (if (or last-in-group? in-pinned-view? pinned) 8 0)]
[rn/view {:style (style/emoji-container margin-top)}
[rn/text {:style style/emoji-text}
(:text content)]]))
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
(ns status-im.contexts.chat.messenger.messages.content.sticker-message.view
(:require [react-native.core :as rn]
[react-native.fast-image :as fast-image]))

(defn view
[{:keys [url]}]
[rn/view {:style {:margin-top 6 :margin-bottom 4}}
[fast-image/fast-image
{:style {:width 120 :height 120}
:source {:uri (str url "&download=true")}}]])
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
[status-im.contexts.chat.messenger.messages.content.album.view :as album]
[status-im.contexts.chat.messenger.messages.content.audio.view :as audio]
[status-im.contexts.chat.messenger.messages.content.deleted.view :as content.deleted]
[status-im.contexts.chat.messenger.messages.content.emoji-message.view :as emoji-message]
[status-im.contexts.chat.messenger.messages.content.image.view :as image]
[status-im.contexts.chat.messenger.messages.content.pin.view :as pin]
[status-im.contexts.chat.messenger.messages.content.reactions.view :as reactions]
[status-im.contexts.chat.messenger.messages.content.status.view :as status]
[status-im.contexts.chat.messenger.messages.content.sticker-message.view :as sticker-message]
[status-im.contexts.chat.messenger.messages.content.style :as style]
[status-im.contexts.chat.messenger.messages.content.system.text.view :as system.text]
[status-im.contexts.chat.messenger.messages.content.text.view :as content.text]
Expand Down Expand Up @@ -199,10 +201,13 @@
[content.text/text-content message-data context]

constants/content-type-emoji
[not-implemented/not-implemented [old-message/emoji message-data]]
[emoji-message/view
(-> message-data
(select-keys [:content :last-in-group? :pinned])
(assoc :in-pinned-view? (:in-pinned-view? context)))]

constants/content-type-sticker
[not-implemented/not-implemented [old-message/sticker message-data]]
[sticker-message/view {:url (-> message-data :content :sticker :url)}]

constants/content-type-audio
[audio/audio-message message-data context]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
(ns status-im.contexts.shell.activity-center.notification.reply.view
(:require
[clojure.string :as string]
[legacy.status-im.ui.screens.chat.message.legacy-view :as old-message]
[quo.core :as quo]
[react-native.gesture :as gesture]
[status-im.common.not-implemented :as not-implemented]
[status-im.constants :as constants]
[status-im.contexts.chat.messenger.messages.content.sticker-message.view :as sticker-message]
[status-im.contexts.shell.activity-center.notification.common.view :as common]
[status-im.contexts.shell.activity-center.notification.reply.style :as style]
[utils.datetime :as datetime]
Expand Down Expand Up @@ -34,7 +34,7 @@
:message-text (get-in message [:content :text])}])

constants/content-type-sticker
[old-message/sticker message]
[sticker-message/view {:url (-> message :content :sticker :url)}]

constants/content-type-system-pinned-message
[not-implemented/not-implemented
Expand Down