-
Notifications
You must be signed in to change notification settings - Fork 991
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
⛵ Add menu to reach saved addresses and show empty state (#19771)
* 💚 Enable wallet on header navigation - Add settings screen - Add save address settings screen - Need to add empty state next * 🥡 Added empty state for saved-addresses - Fixed the standard title quo component - It's flex behaviour was buggy, and it's not being used anywhere * 🧂PR fixes and lint - Use callback everywhere * 🗞️ Move wallet settings to wallet namespace
- Loading branch information
1 parent
3a5122a
commit ce5ae1d
Showing
9 changed files
with
130 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/status_im/contexts/settings/wallet/saved_addresses/style.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
(ns status-im.contexts.settings.wallet.saved-addresses.style) | ||
|
||
(def title-container | ||
{:padding-horizontal 20 | ||
:margin-top 12}) | ||
|
||
(defn page-wrapper | ||
[inset-top] | ||
{:padding-top inset-top | ||
:flex 1}) | ||
|
||
(def empty-container-style | ||
{:justify-content :center | ||
:flex 1}) |
42 changes: 42 additions & 0 deletions
42
src/status_im/contexts/settings/wallet/saved_addresses/view.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
(ns status-im.contexts.settings.wallet.saved-addresses.view | ||
(:require [quo.core :as quo] | ||
[quo.theme :as quo.theme] | ||
[react-native.core :as rn] | ||
[react-native.safe-area :as safe-area] | ||
[status-im.common.resources :as resources] | ||
[status-im.contexts.settings.wallet.saved-addresses.style :as style] | ||
[utils.i18n :as i18n] | ||
[utils.re-frame :as rf])) | ||
|
||
(defn empty-state | ||
[] | ||
(let [theme (quo.theme/use-theme)] | ||
[quo/empty-state | ||
{:title (i18n/label :t/no-saved-addresses) | ||
:description (i18n/label :t/you-like-to-type-43-characters) | ||
:image (resources/get-themed-image :sweating-man theme) | ||
:container-style style/empty-container-style}])) | ||
|
||
(defn view | ||
[] | ||
(let [inset-top (safe-area/get-top) | ||
customization-color (rf/sub [:profile/customization-color]) | ||
saved-addresses [] | ||
navigate-back (rn/use-callback #(rf/dispatch [:navigate-back]))] | ||
[quo/overlay | ||
{:type :shell | ||
:container-style (style/page-wrapper inset-top)} | ||
[quo/page-nav | ||
{:key :header | ||
:background :blur | ||
:icon-name :i/arrow-left | ||
:on-press navigate-back}] | ||
[rn/view {:style style/title-container} | ||
[quo/standard-title | ||
{:title (i18n/label :t/saved-addresses) | ||
:accessibility-label :saved-addresses-header | ||
:right :action | ||
:customization-color customization-color | ||
:icon :i/add}]] | ||
(when-not (seq saved-addresses) | ||
[empty-state])])) |
5 changes: 5 additions & 0 deletions
5
src/status_im/contexts/settings/wallet/wallet_options/style.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
(ns status-im.contexts.settings.wallet.wallet-options.style) | ||
|
||
(defn page-wrapper | ||
[inset-top] | ||
{:padding-top inset-top}) |
45 changes: 45 additions & 0 deletions
45
src/status_im/contexts/settings/wallet/wallet_options/view.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
(ns status-im.contexts.settings.wallet.wallet-options.view | ||
(:require [quo.core :as quo] | ||
[react-native.core :as rn] | ||
[react-native.safe-area :as safe-area] | ||
[status-im.contexts.settings.wallet.wallet-options.style :as style] | ||
[utils.i18n :as i18n] | ||
[utils.re-frame :as rf])) | ||
|
||
(defn open-saved-addresses-settings-modal | ||
[] | ||
(rf/dispatch [:open-modal :screen/settings.saved-addresses])) | ||
|
||
(defn gen-basic-settings-options | ||
[] | ||
[{:title (i18n/label :t/saved-addresses) | ||
:blur? true | ||
:on-press open-saved-addresses-settings-modal | ||
:action :arrow}]) | ||
|
||
(defn basic-settings | ||
[] | ||
[quo/category | ||
{:key :basic-wallet-settings | ||
:label (i18n/label :t/keypairs-accounts-and-addresses) | ||
:data (gen-basic-settings-options) | ||
:blur? true | ||
:list-type :settings}]) | ||
|
||
(defn view | ||
[] | ||
(let [inset-top (safe-area/get-top) | ||
navigate-back (rn/use-callback | ||
#(rf/dispatch [:navigate-back]))] | ||
[quo/overlay | ||
{:type :shell | ||
:container-style (style/page-wrapper inset-top)} | ||
[quo/page-nav | ||
{:key :header | ||
:background :blur | ||
:icon-name :i/arrow-left | ||
:on-press navigate-back}] | ||
[quo/page-top | ||
{:title (i18n/label :t/wallet) | ||
:title-accessibility-label :wallet-settings-header}] | ||
[basic-settings]])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters