diff --git a/.env b/.env index bbc7cd7bd3..309e3262d2 100644 --- a/.env +++ b/.env @@ -1,2 +1,2 @@ TESTFAIRY_ENABLED=0 -WALLET_TAB_ENABLED=0 \ No newline at end of file +WALLET_WIP_ENABLED=0 \ No newline at end of file diff --git a/.env.jenkins b/.env.jenkins index 367b5f01ca..f175c7fe5a 100644 --- a/.env.jenkins +++ b/.env.jenkins @@ -1,2 +1,2 @@ TESTFAIRY_ENABLED=1 -WALLET_TAB_ENABLED=1 \ No newline at end of file +WALLET_WIP_ENABLED=0 \ No newline at end of file diff --git a/.env.prod b/.env.prod index 992456b9e8..309e3262d2 100644 --- a/.env.prod +++ b/.env.prod @@ -1 +1,2 @@ TESTFAIRY_ENABLED=0 +WALLET_WIP_ENABLED=0 \ No newline at end of file diff --git a/src/status_im/components/main_tabs.cljs b/src/status_im/components/main_tabs.cljs index 3f80ca2a06..7a9edae398 100644 --- a/src/status_im/components/main_tabs.cljs +++ b/src/status_im/components/main_tabs.cljs @@ -11,7 +11,6 @@ [status-im.ui.screens.discover.views :refer [discover]] [status-im.ui.screens.contacts.views :refer [contact-groups-list]] [status-im.ui.screens.wallet.main.views :refer [wallet]] - [status-im.utils.config :as config] [status-im.components.tabs.views :refer [tabs]] [status-im.components.tabs.styles :as st] [status-im.components.styles :as common-st] @@ -19,28 +18,26 @@ [cljs.core.async :as a])) (def tab-list - (concat - (when config/wallet-tab-enabled? - [{:view-id :wallet - :title (label :t/wallet) - :screen wallet - :icon-inactive :icon_wallet_gray - :icon-active :icon_wallet_active}]) - [{:view-id :chat-list - :title (label :t/chats) - :screen chats-list - :icon-inactive :icon_chats - :icon-active :icon_chats_active} - {:view-id :discover - :title (label :t/discover) - :screen discover - :icon-inactive :icon_discover - :icon-active :icon_discover_active} - {:view-id :contact-list - :title (label :t/contacts) - :screen contact-groups-list - :icon-inactive :icon_contacts - :icon-active :icon_contacts_active}])) + [{:view-id :wallet + :title (label :t/wallet) + :screen wallet + :icon-inactive :icon_wallet_gray + :icon-active :icon_wallet_active} + {:view-id :chat-list + :title (label :t/chats) + :screen chats-list + :icon-inactive :icon_chats + :icon-active :icon_chats_active} + {:view-id :discover + :title (label :t/discover) + :screen discover + :icon-inactive :icon_discover + :icon-active :icon_discover_active} + {:view-id :contact-list + :title (label :t/contacts) + :screen contact-groups-list + :icon-inactive :icon_contacts + :icon-active :icon_contacts_active}]) (def tab->index (reduce #(assoc %1 (:view-id %2) (count %1)) {} tab-list)) diff --git a/src/status_im/components/react.cljs b/src/status_im/components/react.cljs index d37b6bbccb..7e62ff31f4 100644 --- a/src/status_im/components/react.cljs +++ b/src/status_im/components/react.cljs @@ -115,6 +115,11 @@ (merge {:underlay-color :transparent} props) content]) +(defn touchable-icon [n style handler] + [touchable-highlight {:on-press handler} + [view + [icon n style]]]) + (def picker-item (when-let [picker (get-react-property "Picker")] (adapt-class (.-Item picker)))) diff --git a/src/status_im/ui/screens/accounts/login/views.cljs b/src/status_im/ui/screens/accounts/login/views.cljs index 8801a0444f..41ed8baf20 100644 --- a/src/status_im/ui/screens/accounts/login/views.cljs +++ b/src/status_im/ui/screens/accounts/login/views.cljs @@ -2,7 +2,7 @@ (:require-macros [status-im.utils.views :refer [defview letsubs]]) (:require [re-frame.core :refer [dispatch dispatch-sync]] [status-im.ui.screens.accounts.styles :as ast] - [status-im.ui.screens.accounts.views :refer [account-bage]] + [status-im.ui.screens.accounts.views :refer [account-badge]] [status-im.components.text-input-with-label.view :refer [text-input-with-label]] [status-im.components.status-bar :refer [status-bar]] [status-im.components.toolbar-new.view :refer [toolbar]] @@ -35,7 +35,7 @@ [login-toolbar] [view st/login-view [view st/login-badge-container - [account-bage address photo-path name] + [account-badge address photo-path name] [view {:height 8}] [text-input-with-label {:ref #(reset! password-text-input %) :label (i18n/label :t/password) diff --git a/src/status_im/ui/screens/accounts/styles.cljs b/src/status_im/ui/screens/accounts/styles.cljs index bf534f04f5..feda81139b 100644 --- a/src/status_im/ui/screens/accounts/styles.cljs +++ b/src/status_im/ui/screens/accounts/styles.cljs @@ -52,16 +52,16 @@ :ios {:border-radius 8} :android {:border-radius 4}}) -(def account-bage +(def account-badge {:flex-direction :row :align-items :center :padding-horizontal 16}) -(def account-bage-text-view +(def account-badge-text-view {:margin-left 16 :flex-shrink 1}) -(defstyle account-bage-text +(defstyle account-badge-text {:ios {:font-size 17 :letter-spacing -0.2} :android {:font-size 16 diff --git a/src/status_im/ui/screens/accounts/views.cljs b/src/status_im/ui/screens/accounts/views.cljs index 45bc54f13b..0dfe510ada 100644 --- a/src/status_im/ui/screens/accounts/views.cljs +++ b/src/status_im/ui/screens/accounts/views.cljs @@ -18,12 +18,12 @@ [status-im.i18n :as i18n] [clojure.string :as str])) -(defn account-bage [address photo-path name] - [view st/account-bage +(defn account-badge [address photo-path name] + [view st/account-badge [image {:source {:uri (if (str/blank? photo-path) :avatar photo-path)} :style st/photo-image}] - [view st/account-bage-text-view - [text {:style st/account-bage-text + [view st/account-badge-text-view + [text {:style st/account-badge-text :numberOfLines 1} (or name address)]]]) @@ -31,7 +31,7 @@ [view [touchable-highlight {:on-press #(dispatch [:open-login address photo-path name])} [view st/account-view - [account-bage address photo-path name]]]]) + [account-badge address photo-path name]]]]) (defview accounts [] [accounts [:get-accounts]] diff --git a/src/status_im/ui/screens/wallet/main/views.cljs b/src/status_im/ui/screens/wallet/main/views.cljs index 7b91a5abb2..061d88c34f 100644 --- a/src/status_im/ui/screens/wallet/main/views.cljs +++ b/src/status_im/ui/screens/wallet/main/views.cljs @@ -9,26 +9,36 @@ [status-im.components.toolbar-new.view :as toolbar] [status-im.components.toolbar-new.actions :as act] [status-im.i18n :as i18n] + [status-im.utils.config :as config] [status-im.utils.listview :as lw] [status-im.utils.platform :as platform] + [status-im.utils.utils :as utils] [status-im.ui.screens.wallet.main.styles :as st] [status-im.utils.money :as money])) +(defn- show-not-implemented! [] + (utils/show-popup "TODO" "Not implemented yet!")) + (defn toolbar-title [] [rn/view {:style st/toolbar-title-container} [rn/text {:style st/toolbar-title-text :font :toolbar-title} "Main Wallet"] - [rn/icon :dropdown_white st/toolbar-title-icon]]) + [rn/touchable-icon :dropdown_white st/toolbar-title-icon show-not-implemented!]]) (defn toolbar-buttons [] [rn/view {:style st/toolbar-buttons-container} - [rn/icon :dots_vertical_white st/toolbar-icon] - [rn/icon :qr_white st/toolbar-icon]]) + [rn/touchable-icon :dots_vertical_white st/toolbar-icon show-not-implemented!] + [rn/touchable-icon :qr_white st/toolbar-icon show-not-implemented!]]) + +(defn- show-wallet-transactions [] + (if config/wallet-wip-enabled? + (rf/dispatch [:navigate-to-modal :wallet-transactions]) + (show-not-implemented!))) (defn toolbar-view [] [toolbar/toolbar {:style st/toolbar - :nav-action (act/list-white #(rf/dispatch [:navigate-to-modal :wallet-transactions])) + :nav-action (act/list-white show-wallet-transactions) :custom-content [toolbar-title] :custom-action [toolbar-buttons]}]) @@ -45,9 +55,11 @@ [rn/text {:style st/today-variation} change]]] [btn/buttons st/buttons [{:text "Send" - :on-press #(rf/dispatch [:navigate-to :wallet-send-transaction])} + :on-press #(rf/dispatch [:navigate-to :wallet-send-transaction]) + :disabled? (not config/wallet-wip-enabled?)} {:text "Request" - :on-press #(rf/dispatch [:navigate-to :wallet-request-transaction])} + :on-press #(rf/dispatch [:navigate-to :wallet-request-transaction]) + :disabled? (not config/wallet-wip-enabled?)} {:text "Exchange" :disabled? true}]]]]) @@ -60,7 +72,7 @@ [rn/text {:style st/asset-item-currency :uppercase? true} id]] - [rn/icon :forward_gray st/asset-item-details-icon]]) + [rn/touchable-icon :forward_gray st/asset-item-details-icon show-not-implemented!]]) (defn render-separator-fn [assets-count] (fn [_ row-id _] diff --git a/src/status_im/utils/config.cljs b/src/status_im/utils/config.cljs index 565b6cdd2a..f0f3498d9f 100644 --- a/src/status_im/utils/config.cljs +++ b/src/status_im/utils/config.cljs @@ -10,4 +10,4 @@ (defn enabled? [v] (= "1" v)) (def testfairy-enabled? (enabled? (get-config :TESTFAIRY_ENABLED))) -(def wallet-tab-enabled? (enabled? (get-config :WALLET_TAB_ENABLED 0))) \ No newline at end of file +(def wallet-wip-enabled? (enabled? (get-config :WALLET_WIP_ENABLED 0))) \ No newline at end of file diff --git a/test/cljs/status_im/test/components/main_tabs.cljs b/test/cljs/status_im/test/components/main_tabs.cljs index 1cdda92f6d..da3ba87623 100644 --- a/test/cljs/status_im/test/components/main_tabs.cljs +++ b/test/cljs/status_im/test/components/main_tabs.cljs @@ -4,5 +4,5 @@ (deftest tab->index (is (contains? tabs/tab->index :chat-list)) - (is (= 1 (:discover tabs/tab->index)))) + (is (= 2 (:discover tabs/tab->index))))