Skip to content

Commit

Permalink
design review
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarBasem committed May 13, 2024
1 parent 9d1aa20 commit 614e488
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 32 deletions.
19 changes: 13 additions & 6 deletions src/quo/components/avatars/collection_avatar/style.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,17 @@
:size-20 20
nil))

(defn collection-avatar
(defn collection-avatar-container
[theme size]
{:width (get-dimensions size)
:height (get-dimensions size)
:border-width 1
:border-color (colors/theme-colors colors/neutral-80-opa-10 colors/white-opa-10 theme)
:border-radius 6})
{:width (get-dimensions size)
:height (get-dimensions size)
:border-width 1
:border-color (colors/theme-colors colors/neutral-80-opa-10 colors/white-opa-10 theme)
:border-radius 6
:justify-content :center
:align-items :center})

(defn collection-avatar
[size]
{:width (get-dimensions size)
:height (get-dimensions size)})
16 changes: 9 additions & 7 deletions src/quo/components/avatars/collection_avatar/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@
(:require
[quo.components.avatars.collection-avatar.style :as style]
[quo.theme :as quo.theme]
[react-native.core :as rn]
[react-native.fast-image :as fast-image]))

(defn view
"Opts:
:image - collection image
:theme - keyword -> :light/:dark"
[{:keys [image size on-load-end on-error] :or {size :size-24}}]
(let [theme (quo.theme/use-theme)]
[fast-image/fast-image
{:accessibility-label :collection-avatar
:source image
:on-load-end on-load-end
:on-error on-error
:style (style/collection-avatar theme size)}]))
[rn/view {:style (style/collection-avatar-container theme size)}
[fast-image/fast-image
{:accessibility-label :collection-avatar
:source image
:on-load-end on-load-end
:on-error on-error
:style (style/collection-avatar size)}]]))
28 changes: 14 additions & 14 deletions src/quo/components/notifications/toast/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -67,27 +67,26 @@

(defn toast
"Options:
:type => :neutral/:negative/:positive
"
[{:keys [type icon title text action undo-duration undo-on-press container-style theme user]
[{:keys [type icon title text action undo-duration undo-on-press container-style user]
:or {type :neutral icon :i/placeholder}}]
(let [context-theme (quo.theme/use-theme)
context-theme (or theme context-theme)
icon-name (case type
:positive (if (= theme :light)
:i/correct
:i/correct-dark)
:negative (if (= theme :light)
:i/incorrect
:i/incorrect-dark)
:neutral icon)]
[quo.theme/provider context-theme
(let [theme (quo.theme/use-theme)
icon-name (case type
:positive (if (= theme :light)
:i/correct
:i/correct-dark)
:negative (if (= theme :light)
:i/incorrect
:i/incorrect-dark)
:neutral icon)]
[quo.theme/provider theme
[toast-container
{:left (cond user
[user-avatar/user-avatar user]
icon-name
[icon/icon icon-name (style/icon type context-theme)])
[icon/icon icon-name (style/icon type theme)])
:title title
:text text
:right (if undo-duration
Expand All @@ -96,3 +95,4 @@
:undo-on-press undo-on-press}]
action)
:container-style container-style}]]))

Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@

(def ^:const default-dimension 1000)

(def ^:const margin 8)
(def ^:const margin 16)
1 change: 1 addition & 0 deletions src/status_im/common/toasts/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
[:user :profile-picture]
profile-picture)
toast-opts)]
(println "typexxx" type toast-opts-with-profile-picture)
(if (= type :notification)
[quo/notification toast-opts-with-profile-picture]
[quo/toast toast-opts-with-profile-picture])))
Expand Down
7 changes: 3 additions & 4 deletions src/status_im/contexts/wallet/collectible/options/view.cljs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
(ns status-im.contexts.wallet.collectible.options.view
(:require
[quo.core :as quo]
[react-native.platform :as platform]
[status-im.contexts.wallet.common.utils.external-links :as external-links]
[utils.i18n :as i18n]
[utils.re-frame :as rf]
Expand All @@ -28,9 +27,9 @@
[:lightbox/save-image-to-gallery
uri
#(rf/dispatch [:toasts/upsert
{:id :random-id
:type :positive
:text (i18n/label :t/photo-saved)}])]))}]
{:id :random-id
:type :positive
:text (i18n/label :t/photo-saved)}])]))}]
[{:icon :i/share
:accessibility-label :share-collectible
:label (i18n/label :t/share-collectible)
Expand Down

0 comments on commit 614e488

Please sign in to comment.