refactor: remove images placeholder text (#15830)

* refactor: remove placeholder images text
This commit is contained in:
Omar Basem 2023-05-08 15:03:51 +04:00 committed by GitHub
parent 521765e312
commit 6c5350573d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 14 deletions

View File

@ -164,10 +164,7 @@
:image-path (utils/safe-replace resized-uri #"file://" "")
:image-width width
:image-height height
;; TODO: message not received if text field is
;; nil or empty, issue:
;; https://github.com/status-im/status-mobile/issues/14754
:text (or input-text "placeholder")
:text input-text
:response-to message-id})
images)))

View File

@ -56,8 +56,7 @@
:start {:x 0 :y 1}
:end {:x 0 :y 0}
:style (style/gradient-container insets animations derived)}
(when (not= text "placeholder")
[rn/text {:style style/text-style} text])
[rn/text {:style style/text-style} text]
[rn/flat-list
{:ref #(reset! (:small-list-ref atoms) %)
:key-fn :message-id

View File

@ -29,12 +29,10 @@
images-count (count (:album message))
;; album images are always square, except when we have 3 images, then they must be rectangular
;; (portrait or landscape)
portrait? (and (= images-count rectangular-style-count) (= album-style :portrait))
text (:text (:content first-image))]
portrait? (and (= images-count rectangular-style-count) (= album-style :portrait))]
(if (and albumize? (> images-count 1))
[:<>
(when (not= text "placeholder")
[rn/view {:style {:margin-bottom 10}} [text/text-content first-image context]])
[rn/view {:style {:margin-bottom 10}} [text/text-content first-image context]]
[rn/view
{:style (style/album-container portrait?)}
(map-indexed

View File

@ -16,8 +16,7 @@
(defn image-message
[index {:keys [content image-width image-height message-id] :as message} context on-long-press]
(let [insets (safe-area/get-insets)
dimensions (calculate-dimensions (or image-width 1000) (or image-height 1000))
text (:text content)]
dimensions (calculate-dimensions (or image-width 1000) (or image-height 1000))]
(fn []
(let [shared-element-id (rf/sub [:shared-element-id])]
[rn/touchable-opacity
@ -30,7 +29,7 @@
{:messages [message]
:index 0
:insets insets}])}
(when (and (not= text "placeholder") (= index 0))
(when (= index 0)
[rn/view {:style {:margin-bottom 10}} [text/text-content message context]])
[fast-image/fast-image
{:source {:uri (:image content)}

View File

@ -44,7 +44,6 @@
:icon :i/reply
:id :reply}])
(when (and (not (or deleted? deleted-for-me?))
(not= (get content :text) "placeholder")
(not= content-type constants/content-type-audio))
[{:type :main
:on-press #(react/copy-to-clipboard