restored the previously removed switch user ie logout action

This commit is contained in:
Goran Jovic 2018-01-13 15:35:09 +01:00 committed by Goran Jović
parent 0eb4fb0a42
commit 9f9d788e2c
3 changed files with 33 additions and 2 deletions

View File

@ -27,6 +27,7 @@
;;drawer
:switch-users "Switch users"
:logout "Logout"
:current-network "Current network"
;;home

View File

@ -119,6 +119,13 @@
:android {:font-size 16
:color color-black}})
(defstyle logout-text
{:padding-left 16
:color styles/color-red
:ios {:font-size 17
:letter-spacing -0.2}
:android {:font-size 16}})
(defstyle profile-setting-spacing
{:ios {:height 10}
:android {:height 7}})

View File

@ -19,7 +19,10 @@
[status-im.ui.screens.profile.styles :as styles]
[status-im.utils.datetime :as time]
[status-im.utils.utils :refer [hash-tag?]]
[status-im.utils.config :as config])
[status-im.utils.config :as config]
[status-im.utils.platform :as platform]
[status-im.protocol.core :as protocol]
[re-frame.core :as re-frame])
(:require-macros [status-im.utils.views :refer [defview letsubs]]))
(defn my-profile-toolbar []
@ -181,6 +184,25 @@
[info-item-separator]
[profile-info-phone-item phone]])
(defn save-profile! []
(when-let [save-event @(re-frame/subscribe [:my-profile.drawer/save-event])]
(re-frame/dispatch [save-event])))
(defn navigate-to-accounts []
(save-profile!)
;; TODO(rasom): probably not the best place for this call
(protocol/stop-whisper!)
(re-frame/dispatch [:navigate-to :accounts]))
(defn logout []
[react/view {}
[react/touchable-highlight
{:on-press navigate-to-accounts}
[react/view
[react/text {:style styles/logout-text
:font (if platform/android? :medium :default)}
(label :t/logout)]]]])
(defn my-profile-info [{:keys [public-key status phone] :as contact}]
[react/view
[profile-info-address-item contact]
@ -196,7 +218,8 @@
(when config/offline-inbox-enabled?
[info-item-separator])
(when config/offline-inbox-enabled?
[offline-messaging-settings])])
[offline-messaging-settings])
[logout]])
(defn profile-status [status & [edit?]]
[react/view styles/profile-status-container