mirror of
https://github.com/status-im/status-mobile.git
synced 2025-01-14 18:54:52 +00:00
restored the previously removed switch user ie logout action
This commit is contained in:
parent
0eb4fb0a42
commit
9f9d788e2c
@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
;;drawer
|
;;drawer
|
||||||
:switch-users "Switch users"
|
:switch-users "Switch users"
|
||||||
|
:logout "Logout"
|
||||||
:current-network "Current network"
|
:current-network "Current network"
|
||||||
|
|
||||||
;;home
|
;;home
|
||||||
|
@ -119,6 +119,13 @@
|
|||||||
:android {:font-size 16
|
:android {:font-size 16
|
||||||
:color color-black}})
|
: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
|
(defstyle profile-setting-spacing
|
||||||
{:ios {:height 10}
|
{:ios {:height 10}
|
||||||
:android {:height 7}})
|
:android {:height 7}})
|
||||||
|
@ -19,7 +19,10 @@
|
|||||||
[status-im.ui.screens.profile.styles :as styles]
|
[status-im.ui.screens.profile.styles :as styles]
|
||||||
[status-im.utils.datetime :as time]
|
[status-im.utils.datetime :as time]
|
||||||
[status-im.utils.utils :refer [hash-tag?]]
|
[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]]))
|
(:require-macros [status-im.utils.views :refer [defview letsubs]]))
|
||||||
|
|
||||||
(defn my-profile-toolbar []
|
(defn my-profile-toolbar []
|
||||||
@ -181,6 +184,25 @@
|
|||||||
[info-item-separator]
|
[info-item-separator]
|
||||||
[profile-info-phone-item phone]])
|
[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}]
|
(defn my-profile-info [{:keys [public-key status phone] :as contact}]
|
||||||
[react/view
|
[react/view
|
||||||
[profile-info-address-item contact]
|
[profile-info-address-item contact]
|
||||||
@ -196,7 +218,8 @@
|
|||||||
(when config/offline-inbox-enabled?
|
(when config/offline-inbox-enabled?
|
||||||
[info-item-separator])
|
[info-item-separator])
|
||||||
(when config/offline-inbox-enabled?
|
(when config/offline-inbox-enabled?
|
||||||
[offline-messaging-settings])])
|
[offline-messaging-settings])
|
||||||
|
[logout]])
|
||||||
|
|
||||||
(defn profile-status [status & [edit?]]
|
(defn profile-status [status & [edit?]]
|
||||||
[react/view styles/profile-status-container
|
[react/view styles/profile-status-container
|
||||||
|
Loading…
x
Reference in New Issue
Block a user