fix: missing/empty user-avatar in component previews (#17430)

This commit is contained in:
yqrashawn 2023-09-29 15:30:04 +08:00 committed by GitHub
parent fe404ab005
commit 1c31127a6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 7 deletions

View File

@ -1,7 +1,8 @@
(ns status-im2.contexts.quo-preview.list-items.user-list (ns status-im2.contexts.quo-preview.list-items.user-list
(:require [reagent.core :as reagent] (:require [quo2.core :as quo]
[reagent.core :as reagent]
[status-im2.common.resources :as resources]
[status-im2.contexts.quo-preview.preview :as preview] [status-im2.contexts.quo-preview.preview :as preview]
[quo2.core :as quo]
[utils.address :as address])) [utils.address :as address]))
(def descriptor (def descriptor
@ -27,6 +28,7 @@
(let [state (reagent/atom {:primary-name "Alisher Yakupov" (let [state (reagent/atom {:primary-name "Alisher Yakupov"
:short-chat-key (address/get-shortened-compressed-key :short-chat-key (address/get-shortened-compressed-key
"zQ3ssgRy5TtB47MMiMKMKaGyaawkCgMqqbrnAUYrZJ1sgt5N") "zQ3ssgRy5TtB47MMiMKMKaGyaawkCgMqqbrnAUYrZJ1sgt5N")
:photo-path (resources/mock-images :user-picture-female2)
:ens-verified true :ens-verified true
:contact? false :contact? false
:verified? false :verified? false

View File

@ -2,6 +2,7 @@
(:require [quo2.core :as quo] (:require [quo2.core :as quo]
[react-native.core :as rn] [react-native.core :as rn]
[reagent.core :as reagent] [reagent.core :as reagent]
[status-im2.common.resources :as resources]
[status-im2.contexts.quo-preview.preview :as preview])) [status-im2.contexts.quo-preview.preview :as preview]))
(def descriptor (def descriptor
@ -28,7 +29,8 @@
[state] [state]
(merge @state (merge @state
{:child (when (= (:type @state) :pinned) [rn/text (:content @state)]) {:child (when (= (:type @state) :pinned) [rn/text (:content @state)])
:display-name (:pinned-by @state)})) :display-name (:pinned-by @state)
:photo-path (resources/mock-images :user-picture-female2)}))
(defn view (defn view
[] []

View File

@ -1,7 +1,8 @@
(ns status-im2.contexts.quo-preview.navigation.top-nav (ns status-im2.contexts.quo-preview.navigation.top-nav
(:require [quo2.foundations.colors :as colors] (:require [quo2.core :as quo]
[quo2.foundations.colors :as colors]
[reagent.core :as reagent] [reagent.core :as reagent]
[quo2.core :as quo] [status-im2.common.resources :as resources]
[status-im2.contexts.quo-preview.preview :as preview])) [status-im2.contexts.quo-preview.preview :as preview]))
(def descriptor (def descriptor
@ -44,8 +45,9 @@
:customization-color customization-color :customization-color customization-color
:notification-count notification-count :notification-count notification-count
:jump-to? jump-to? :jump-to? jump-to?
:avatar-props {:online? true :avatar-props {:online? true
:full-name "Test User"} :full-name "Test User"
:profile-picture (resources/mock-images :user-picture-female2)}
:avatar-on-press #(js/alert "avatar pressed") :avatar-on-press #(js/alert "avatar pressed")
:scan-on-press #(js/alert "scan pressed") :scan-on-press #(js/alert "scan pressed")
:activity-center-on-press #(js/alert "activity-center pressed") :activity-center-on-press #(js/alert "activity-center pressed")

View File

@ -3,6 +3,7 @@
[quo2.foundations.colors :as colors] [quo2.foundations.colors :as colors]
[react-native.core :as rn] [react-native.core :as rn]
[reagent.core :as reagent] [reagent.core :as reagent]
[status-im2.common.resources :as resources]
[status-im2.contexts.quo-preview.preview :as preview] [status-im2.contexts.quo-preview.preview :as preview]
[utils.re-frame :as rf])) [utils.re-frame :as rf]))
@ -67,6 +68,14 @@
:text "This is an example toast" :text "This is an example toast"
:duration 30000}]) :duration 30000}])
(defn toast-button-with-user-avatar
[]
[toast-button
"Toast: with user-avatar"
{:text "This is an example toast"
:user {:profile-picture (resources/mock-images :user-picture-female2)
:size :small}}])
(defn update-toast-button (defn update-toast-button
[] []
(let [suffix (reagent/atom 0)] (let [suffix (reagent/atom 0)]
@ -98,5 +107,6 @@
[toast-button-with-undo-action] [toast-button-with-undo-action]
[toast-button-multiline] [toast-button-multiline]
[toast-button-30s-duration] [toast-button-30s-duration]
[toast-button-with-user-avatar]
[update-toast-button] [update-toast-button]
[update-toast-button]]]]) [update-toast-button]]]])