Skip to content

Commit

Permalink
[7947] Feature: Blank out app preview screen when switching apps on m…
Browse files Browse the repository at this point in the history
…obile
  • Loading branch information
bitsikka committed Apr 22, 2019
1 parent 8482ea5 commit 95fc453
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
13 changes: 13 additions & 0 deletions src/status_im/ui/components/styles.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,16 @@
(def icon-default
{:width 24
:height 24})

(def inactive-overlay
{:position :absolute
:left 0
:top 0
:right 0
:bottom 0
:flex 1
:align-items :center
:justify-content :center
:elevation 8
:z-index 2019
:background-color colors/white})
18 changes: 17 additions & 1 deletion src/status_im/ui/screens/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
[status-im.utils.universal-links.core :as utils.universal-links]
[status-im.ui.components.react :as react]
[status-im.ui.components.bottom-sheet.core :as bottom-sheet]
[status-im.ui.components.common.common :as components.common]
[status-im.ui.components.styles :as components.styles]
[status-im.utils.navigation :as navigation]
[reagent.core :as reagent]
[status-im.utils.random :as rand]
Expand Down Expand Up @@ -35,6 +37,19 @@

[bottom-sheet/bottom-sheet opts])))

(views/defview inactive-overlay []
(letsubs [app-state [:get :app-state]]
{:component-will-mount
(fn []
(react/dismiss-keyboard!))
:component-will-update
(fn []
(react/dismiss-keyboard!))}
(when (= app-state (or "inactive" "background"))
[react/view {:style components.styles/inactive-overlay}
[components.common/logo {:size 111
:icon-size 46}]])))

(defn main []
(let [view-id (re-frame/subscribe [:get :view-id])
main-component (atom nil)]
Expand Down Expand Up @@ -84,5 +99,6 @@
(navigation/navigate-to @view-id)))
;; see https://reactnavigation.org/docs/en/state-persistence.html#development-mode
:persistenceKey (when js/goog.DEBUG rand-label)}]
[bottom-sheet]]))})))
[bottom-sheet]
[inactive-overlay]]))})))

0 comments on commit 95fc453

Please sign in to comment.