Navigation in drawer (#1261)

* navigation in drawer

* fix indentation
This commit is contained in:
Roman Volosovskyi 2017-06-02 17:35:59 +03:00 committed by GitHub
parent ec469f59b1
commit 6921587e13
2 changed files with 38 additions and 14 deletions

View File

@ -82,8 +82,7 @@
{:margin-left 48})
(def empty-transactions-title-container
{:margin-bottom 32
:align-items :center})
{:align-items :center})
(defstyle transactions-title-container
{:margin-left 16
@ -164,3 +163,13 @@
{:color common/color-light-blue
:android {:font-size 14}
:ios {:font-size 17}})
(def switch-account-container
{:align-items :center
:margin-bottom 10
:margin-top 10})
(defstyle switch-account-text
{:color common/color-light-blue
:android {:font-size 14}
:ios {:font-size 17}})

View File

@ -146,13 +146,26 @@
[text {:style st/network-title} "Ropsten"]])
(defn options-btn []
(let [options [{:value (fn []
[view {:style st/options-button}
[touchable-highlight
{:on-press (fn []
(close-drawer)
(rf/dispatch [:set-in [:profile-edit :name] nil])
(rf/dispatch [:navigate-to :accounts]))
:text (i18n/label :t/switch-users)}]]
[view {:style st/options-button}
[context-menu/context-menu [icon :options_gray] options]]))
(rf/dispatch [:navigate-to :my-profile]))}
[view [icon :options_gray]]]])
(defn switch-account []
[view st/switch-account-container
[touchable-highlight
{:on-press (fn []
(close-drawer)
(rf/dispatch [:set-in [:profile-edit :name] nil])
(rf/dispatch [:navigate-to :accounts]))}
[view
[text {:style st/switch-account-text
:font (if platform/android? :medium :default)
:uppercase? platform/android?}
(i18n/label :t/switch-users)]]]])
(defn drawer []
(let [placeholder (gfycat/generate-gfy)]
@ -166,7 +179,9 @@
[status-input]
[options-btn]]
[current-network]]
[unsigned-transactions]]])))
[view
[unsigned-transactions]
[switch-account]]]])))
(defn drawer-view [items]
[drawer-layout {:drawerWidth 300