Skip to content

Commit

Permalink
add resize-mode to image-with-loader
Browse files Browse the repository at this point in the history
  • Loading branch information
msuess committed Mar 18, 2022
1 parent 3c818b4 commit e9e64af
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/status_im/ui/components/image_with_loader.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
[quo.design-system.colors :as colors]
[status-im.ui.components.react :as react]
[status-im.ui.components.icons.icons :as icons]
[status-im.utils.contenthash :as contenthash]))
[status-im.utils.contenthash :as contenthash]
[taoensso.timbre :as log]))

(defn- placeholder [props child]
(let [{:keys [accessibility-label style]} props]
Expand Down Expand Up @@ -32,14 +33,17 @@
:style style}
[react/activity-indicator {:animating true}]])
(when (not @error?)
(log/info "loaded" @loaded?)
(log/info "style" style)
[react/fast-image {:accessibility-label (:success accessibility-labels)
:onError #(if (empty? (rest @current-source))
(reset! error? true)
(reset! current-source
(rest @current-source)))
:onLoad #(reset! loaded? true)
:style (if @loaded? style {})
:source (first @current-source)}])])))
:source (first @current-source)
:resize-mode :contain}])])))

(defn ipfs [props]
(let [{:keys [hash]} props]
Expand Down

0 comments on commit e9e64af

Please sign in to comment.