Skip to content

Commit

Permalink
chore(wallet): add images to select address page (#18119)
Browse files Browse the repository at this point in the history
  • Loading branch information
J-Son89 authored Dec 18, 2023
1 parent 8d0bb7b commit 8a869be
Show file tree
Hide file tree
Showing 22 changed files with 54 additions and 83 deletions.
Binary file added resources/images/ui2/angry-man-dark@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/ui2/angry-man-dark@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/ui2/angry-man-light@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/ui2/angry-man-light@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/ui2/sweating-man-dark@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/ui2/sweating-man-dark@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/ui2/sweating-man-light@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/ui2/sweating-man-light@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 16 additions & 30 deletions src/status_im2/common/resources.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -22,44 +22,27 @@
:onboarding-illustration (js/require "../resources/images/ui2/onboarding_illustration.png")
:qr-code (js/require "../resources/images/ui2/qr-code.png")
:keycard-logo (js/require "../resources/images/ui2/keycard-logo.png")
:keycard-chip-light (js/require "../resources/images/ui2/keycard-chip-light.png")
:keycard-chip-dark (js/require "../resources/images/ui2/keycard-chip-dark.png")
:keycard-watermark (js/require "../resources/images/ui2/keycard-watermark.png")
:discover (js/require "../resources/images/ui2/discover.png")
:invite-friends (js/require "../resources/images/ui2/invite-friends.png")
:no-messages-light (js/require "../resources/images/ui2/no-messages-light.png")
:no-messages-dark (js/require "../resources/images/ui2/no-messages-dark.png")
:no-group-chats-light (js/require "../resources/images/ui2/no-group-chats-light.png")
:no-group-chats-dark (js/require "../resources/images/ui2/no-group-chats-dark.png")
:no-contacts-light (js/require "../resources/images/ui2/no-contacts-light.png")
:no-contacts-dark (js/require "../resources/images/ui2/no-contacts-dark.png")
:no-sent-requests-light (js/require "../resources/images/ui2/no-sent-requests-light.png")
:no-sent-requests-dark (js/require "../resources/images/ui2/no-sent-requests-dark.png")
:no-received-requests-light (js/require "../resources/images/ui2/no-received-requests-light.png")
:no-received-requests-dark (js/require "../resources/images/ui2/no-received-requests-dark.png")
:no-communities-light (js/require "../resources/images/ui2/no-communities-light.png")
:no-communities-dark (js/require "../resources/images/ui2/no-communities-dark.png")
:no-pending-communities-light (js/require "../resources/images/ui2/no-pending-communities-light.png")
:no-pending-communities-dark (js/require "../resources/images/ui2/no-pending-communities-dark.png")
:no-opened-communities-light (js/require "../resources/images/ui2/no-opened-communities-light.png")
:no-opened-communities-dark (js/require "../resources/images/ui2/no-opened-communities-dark.png")
:no-contacts-to-invite-light (js/require "../resources/images/ui2/no-contacts-to-invite-light.png")
:no-contacts-to-invite-dark (js/require "../resources/images/ui2/no-contacts-to-invite-dark.png")
:no-notifications-light (js/require "../resources/images/ui2/no-notifications-light.png")
:no-notifications-dark (js/require "../resources/images/ui2/no-notifications-dark.png")
:notifications (js/require "../resources/images/ui2/notifications.png")
:welcome-illustration (js/require "../resources/images/ui2/welcome_illustration.png")})

(def ui-themed
{:no-messages
{:light (js/require "../resources/images/ui2/no-messages-light.png")
:dark (js/require "../resources/images/ui2/no-messages-dark.png")}
:no-group-chats
{:light (js/require "../resources/images/ui2/no-group-chats-light.png")
:dark (js/require "../resources/images/ui2/no-group-chats-dark.png")}
{:angry-man
{:light (js/require "../resources/images/ui2/angry-man-light.png")
:dark (js/require "../resources/images/ui2/angry-man-dark.png")}
:cat-in-box
{:light (js/require "../resources/images/ui2/cat-in-box-light.png")
:dark (js/require "../resources/images/ui2/cat-in-box-dark.png")}
:no-contacts
{:light (js/require "../resources/images/ui2/no-contacts-light.png")
:dark (js/require "../resources/images/ui2/no-contacts-dark.png")}
:keycard-chip
{:light (js/require "../resources/images/ui2/keycard-chip-light.png")
:dark (js/require "../resources/images/ui2/keycard-chip-dark.png")}
:no-group-chats
{:light (js/require "../resources/images/ui2/no-group-chats-light.png")
:dark (js/require "../resources/images/ui2/no-group-chats-dark.png")}
:no-sent-requests
{:light (js/require "../resources/images/ui2/no-sent-requests-light.png")
:dark (js/require "../resources/images/ui2/no-sent-requests-dark.png")}
Expand Down Expand Up @@ -92,7 +75,10 @@
:dark (js/require "../resources/images/ui2/no-dapps-dark.png")}
:no-permissions
{:light (js/require "../resources/images/ui2/no-permissions-light.png")
:dark (js/require "../resources/images/ui2/no-permissions-dark.png")}})
:dark (js/require "../resources/images/ui2/no-permissions-dark.png")}
:sweating-man
{:light (js/require "../resources/images/ui2/sweating-man-light.png")
:dark (js/require "../resources/images/ui2/sweating-man-dark.png")}})

(def mock-images
{:bored-ape (js/require "../resources/images/mock2/bored-ape.png")
Expand Down
9 changes: 3 additions & 6 deletions src/status_im2/contexts/chat/home/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,15 @@
#:tab{:contacts
{:title (i18n/label :t/no-contacts)
:description (i18n/label :t/no-contacts-description)
:image (resources/get-image
(quo.theme/theme-value :no-contacts-light :no-contacts-dark theme))}
:image (resources/get-themed-image :no-contacts theme)}
:groups
{:title (i18n/label :t/no-group-chats)
:description (i18n/label :t/no-group-chats-description)
:image (resources/get-image
(quo.theme/theme-value :no-group-chats-light :no-group-chats-dark theme))}
:image (resources/get-themed-image :no-group-chats theme)}
:recent
{:title (i18n/label :t/no-messages)
:description (i18n/label :t/no-messages-description)
:image (resources/get-image
(quo.theme/theme-value :no-messages-light :no-messages-dark theme))}})
:image (resources/get-themed-image :cat-in-box theme)}})

(defn chats
[{:keys [theme selected-tab set-scroll-ref scroll-shared-value]}]
Expand Down
12 changes: 3 additions & 9 deletions src/status_im2/contexts/communities/home/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,15 @@
(i18n/label :t/no-communities-description-strikethrough)]
" "
(i18n/label :t/no-communities-description)]
:image (resources/get-image (quo.theme/theme-value :no-communities-light
:no-communities-dark
theme))}
:image (resources/get-themed-image :no-communities theme)}
:pending
{:title (i18n/label :t/no-pending-communities)
:description (i18n/label :t/no-pending-communities-description)
:image (resources/get-image (quo.theme/theme-value :no-pending-communities-light
:no-pending-communities-dark
theme))}
:image (resources/get-themed-image :no-pending-communities theme)}
:opened
{:title (i18n/label :t/no-opened-communities)
:description (i18n/label :t/no-opened-communities-description)
:image (resources/get-image (quo.theme/theme-value :no-opened-communities-light
:no-opened-communities-dark
theme))}})
:image (resources/get-themed-image :no-opened-communities theme)}})

(def ^:private banner-data
{:title-props
Expand Down
17 changes: 9 additions & 8 deletions src/status_im2/contexts/quo_preview/empty_state/empty_state.cljs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(ns status-im2.contexts.quo-preview.empty-state.empty-state
(:require
[quo.core :as quo]
[quo.theme]
[reagent.core :as reagent]
[status-im2.common.resources :as resources]
[status-im2.contexts.quo-preview.preview :as preview]))
Expand All @@ -12,20 +13,18 @@
:type :text}
{:key :image
:type :select
:options [{:key :no-contacts-light}
{:key :no-contacts-dark}
{:key :no-messages-light}
{:key :no-messages-dark}]}
:options [{:key :cat-in-box}
{:key :no-contacts}]}
{:key :upper-button-text
:type :text}
{:key :lower-button-text
:type :text}
{:key :blur?
:type :boolean}])

(defn view
[]
(let [state (reagent/atom {:image :no-messages-light
(defn view-internal
[{:keys [theme]}]
(let [state (reagent/atom {:image :no-contacts
:title "A big friendly title"
:description "Some cool description will be here"
:blur? false
Expand All @@ -46,4 +45,6 @@
(assoc :lower-button
{:text (:lower-button-text @state)
:on-press #(js/alert "Lower button")})
(update :image resources/get-image))]])))
(assoc :image (resources/get-themed-image (:image @state) theme)))]])))

(def view (quo.theme/with-theme view-internal))
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
(ns status-im2.contexts.shell.activity-center.tabs.empty-tab.view
(:require
[quo.core :as quo]
[quo.theme]
[react-native.core :as rn]
[status-im2.common.resources :as resources]
[status-im2.contexts.shell.activity-center.notification-types :as types]
[status-im2.contexts.shell.activity-center.style :as style]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))

(def empty-tab-description
(def ^:private empty-tab-description
{types/no-type (i18n/label :t/empty-notifications-all-tab)
types/admin (i18n/label :t/empty-notifications-admin-tab)
types/mention (i18n/label :t/empty-notifications-mentions-tab)
Expand All @@ -19,13 +20,15 @@
types/membership (i18n/label :t/empty-notifications-membership-tab)
types/system (i18n/label :t/empty-notifications-system-tab)})

(defn empty-tab
[]
(defn empty-tab-internal
[{:keys [theme]}]
(let [filter-type (rf/sub [:activity-center/filter-type])
description (get empty-tab-description filter-type nil)]
[rn/view {:style style/empty-container}
[quo/empty-state
{:blur? true
:image (resources/get-image :no-notifications-dark)
:image (resources/get-themed-image :no-notifications theme)
:title (i18n/label :t/empty-notifications-title-unread)
:description description}]]))

(def empty-tab (quo.theme/with-theme empty-tab-internal))
8 changes: 0 additions & 8 deletions src/status_im2/contexts/wallet/home/style.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
:padding-top 8
:padding-bottom 12})

(def accounts-container
{:height 112})

(def overview-container
{:height 86})

Expand All @@ -21,11 +18,6 @@
(def accounts-list-container
{:padding-horizontal 20})

(def empty-container-style
{:justify-content :center
:flex 1
:margin-bottom 44})

(def separator
{:width 12})

Expand Down
3 changes: 1 addition & 2 deletions src/status_im2/contexts/wallet/home/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
[quo.core :as quo]
[react-native.core :as rn]
[reagent.core :as reagent]
[status-im.ui.screens.wallet.components.styles :as styles]
[status-im2.common.home.top-nav.view :as common.top-nav]
[status-im2.contexts.wallet.common.activity-tab.view :as activity]
[status-im2.contexts.wallet.common.collectibles-tab.view :as collectibles]
Expand Down Expand Up @@ -55,7 +54,7 @@
:content-container-style style/accounts-list-container
:data cards
:horizontal true
:separator [rn/view {:style styles/separator}]
:separator [rn/view {:style style/separator}]
:render-fn quo/account-card
:shows-horizontal-scroll-indicator false}]
[quo/tabs
Expand Down
26 changes: 12 additions & 14 deletions src/status_im2/contexts/wallet/send/select_address/tabs/view.cljs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
(ns status-im2.contexts.wallet.send.select-address.tabs.view
(:require
[quo.core :as quo]
[quo.theme :as quo.theme]
[react-native.gesture :as gesture]
[status-im2.common.resources :as resources]
[status-im2.contexts.wallet.send.select-address.tabs.style :as style]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))
Expand All @@ -15,43 +17,39 @@
(rf/dispatch [:navigate-to-within-stack
[:wallet-select-asset :wallet-select-address]]))}])

(def data
[{:id :tab/recent :label (i18n/label :t/recent) :accessibility-label :recent-tab}
{:id :tab/saved :label (i18n/label :t/saved) :accessibility-label :saved-tab}
{:id :tab/contacts :label (i18n/label :t/contacts) :accessibility-label :contacts-tab}
{:id :tab/my-accounts :label (i18n/label :t/my-accounts) :accessibility-label :my-accounts-tab}])

(defn my-accounts
[]
[theme]
(let [other-accounts (rf/sub [:wallet/accounts-without-current-viewing-account])]
(if (zero? (count other-accounts))
[quo/empty-state
{:title (i18n/label :t/no-other-accounts)
:description (i18n/label :t/here-is-a-cat-in-a-box-instead)
:placeholder? true
:image (resources/get-themed-image :cat-in-box theme)
:container-style style/empty-container-style}]
[gesture/flat-list
{:data other-accounts
:render-fn render-account-item
:content-container-style style/my-accounts-container
:shows-vertical-scroll-indicator false}])))

(defn view
[selected-tab]
(defn view-internal
[{:keys [selected-tab theme]}]
(case selected-tab
:tab/recent [quo/empty-state
{:title (i18n/label :t/no-recent-transactions)
:description (i18n/label :t/make-one-it-is-easy-we-promise)
:placeholder? true
:image (resources/get-themed-image :angry-man theme)
:container-style style/empty-container-style}]
:tab/saved [quo/empty-state
{:title (i18n/label :t/no-saved-addresses)
:description (i18n/label :t/you-like-to-type-43-characters)
:placeholder? true
:image (resources/get-themed-image :sweating-man theme)
:container-style style/empty-container-style}]
:tab/contacts [quo/empty-state
{:title (i18n/label :t/no-contacts)
:description (i18n/label :t/no-contacts-description)
:placeholder? true
:image (resources/get-themed-image :no-contacts theme)
:container-style style/empty-container-style}]
:tab/my-accounts [my-accounts]))
:tab/my-accounts [my-accounts theme]))

(def view (quo.theme/with-theme view-internal))
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
:scrollable? true
:scroll-on-press? true
:on-change on-change-tab}]
[tabs/view selected-tab]])]))))
[tabs/view {:selected-tab selected-tab}]])]))))

(defn view
[]
Expand Down
3 changes: 2 additions & 1 deletion translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2435,5 +2435,6 @@
"share-opensea-link": "Share OpenSea link",
"save-image-to-photos": "Save image to Photos",
"copy-all-details": "Copy all details",
"share-details": "Share details"
"share-details": "Share details",
"what-are-you-waiting-for": "What are you waiting for?"
}

0 comments on commit 8a869be

Please sign in to comment.