-
Notifications
You must be signed in to change notification settings - Fork 985
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: wallet select address screen UI in empty state
Signed-off-by: Brian Sztamfater <brian@status.im>
- Loading branch information
1 parent
e2f837f
commit cda6d93
Showing
9 changed files
with
144 additions
and
21 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
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
29 changes: 29 additions & 0 deletions
29
src/status_im2/contexts/wallet/send/select_address/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,29 @@ | ||
(ns status-im2.contexts.wallet.send.select-address.style | ||
(:require [quo2.foundations.colors :as colors])) | ||
|
||
(defn container | ||
[margin-top] | ||
{:flex 1 | ||
:margin-top margin-top}) | ||
|
||
(def title-container | ||
{:margin-horizontal 20 | ||
:margin-vertical 12}) | ||
|
||
(defn divider | ||
[theme] | ||
{:border-top-width 1 | ||
:border-top-color (colors/theme-colors colors/neutral-10 colors/neutral-90 theme)}) | ||
|
||
(def tabs | ||
{:padding-top 20 | ||
:padding-bottom 12}) | ||
|
||
(def tabs-content | ||
{:padding-left 20 | ||
:padding-right 8}) | ||
|
||
(def empty-container-style | ||
{:justify-content :center | ||
:flex 1 | ||
:margin-bottom 44}) |
86 changes: 86 additions & 0 deletions
86
src/status_im2/contexts/wallet/send/select_address/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,86 @@ | ||
(ns status-im2.contexts.wallet.send.select-address.view | ||
(:require [quo2.theme :as quo.theme] | ||
[react-native.core :as rn] | ||
[status-im2.contexts.wallet.send.select-address.style :as style] | ||
[react-native.safe-area :as safe-area] | ||
[quo2.core :as quo] | ||
[utils.re-frame :as rf] | ||
[utils.i18n :as i18n] | ||
[status-im2.constants :as constants] | ||
[reagent.core :as reagent])) | ||
|
||
(def tabs-data | ||
[{:id :recent :label (i18n/label :t/recent) :accessibility-label :recent-tab} | ||
{:id :saved :label (i18n/label :t/saved) :accessibility-label :saved-tab} | ||
{:id :contacts :label (i18n/label :t/contacts) :accessibility-label :contacts-tab} | ||
{:id :my-accounts :label (i18n/label :t/my-accounts) :accessibility-label :my-accounts-tab}]) | ||
|
||
(defn- tab-view | ||
[selected-tab] | ||
(case selected-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 | ||
:container-style style/empty-container-style}] | ||
:saved [quo/empty-state | ||
{:title (i18n/label :t/no-saved-addresses) | ||
:description (i18n/label :t/you-like-to-type-43-characters) | ||
:placeholder? true | ||
:container-style style/empty-container-style}] | ||
:contacts [quo/empty-state | ||
{:title (i18n/label :t/no-contacts) | ||
:description (i18n/label :t/no-contacts-description) | ||
:placeholder? true | ||
:container-style style/empty-container-style}] | ||
:my-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 | ||
:container-style style/empty-container-style}])) | ||
|
||
(defn- view-internal | ||
[] | ||
(let [margin-top (safe-area/get-top) | ||
timer (atom nil) | ||
valid-ens? (reagent/atom false) | ||
input-value (atom "") | ||
selected-tab (reagent/atom (:id (first tabs-data)))] | ||
(fn [{:keys [theme]}] | ||
[rn/scroll-view | ||
{:content-container-style (style/container margin-top) | ||
:keyboard-should-persist-taps :never | ||
:scroll-enabled false} | ||
[quo/page-nav | ||
{:icon-name :i/close | ||
:on-press #(rf/dispatch [:navigate-back]) | ||
:accessibility-label :top-bar | ||
:right-side :account-switcher}] | ||
[quo/text-combinations | ||
{:title (i18n/label :t/send-to) | ||
:container-style style/title-container | ||
:title-accessibility-label :title-label}] | ||
[quo/address-input | ||
{:on-scan #(js/alert "Not implemented yet") | ||
:ens-regex constants/regx-ens | ||
:on-detect-ens (fn [_] | ||
(reset! valid-ens? false) | ||
(when @timer | ||
(js/clearTimeout @timer)) | ||
(reset! timer (js/setTimeout #(reset! valid-ens? true) | ||
2000))) | ||
:on-change-text #(reset! input-value %) | ||
:valid-ens? @valid-ens?}] | ||
[rn/view {:style (style/divider theme)}] | ||
[quo/tabs | ||
{:style style/tabs | ||
:content-style style/tabs-content | ||
:size 32 | ||
:default-active @selected-tab | ||
:data tabs-data | ||
:scrollable? true | ||
:scroll-on-press? true | ||
:on-change #(reset! selected-tab %)}] | ||
[tab-view @selected-tab]]))) | ||
|
||
(def view (quo.theme/with-theme view-internal)) |
This file was deleted.
Oops, something went wrong.
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