Enable Quo Preview in dev app

Signed-off-by: Gheorghe Pinzaru <feross95@gmail.com>
This commit is contained in:
Gheorghe Pinzaru 2020-08-10 11:49:09 +03:00
parent 9c37eac6f4
commit feb8dfce07
No known key found for this signature in database
GPG Key ID: C9A094959935A952
5 changed files with 84 additions and 65 deletions

1
.env
View File

@ -23,3 +23,4 @@ KEYCARD_TEST_MENU=0
QR_READ_TEST_MENU=1 QR_READ_TEST_MENU=1
ENABLE_ROOT_ALERT=1 ENABLE_ROOT_ALERT=1
ENABLE_REFERRAL_INVITE=1 ENABLE_REFERRAL_INVITE=1
ENABLE_QUO_PREVIEW=1

View File

@ -82,17 +82,20 @@
(reset! navigation-state state-obj) (reset! navigation-state state-obj)
(resolve true)))) (resolve true))))
(defn preview-screens [] (defn preview-stack []
(let [stack (navigation/create-stack)] (let [stack (navigation/create-stack)]
[navigation/navigation-container
{:ref navigation/set-navigator-ref
:initial-state @navigation-state
:on-state-change persist-state!}
[stack {} [stack {}
(into [{:name :main (into [{:name :main
:insets {:top false} :insets {:top false}
:component main-screen}] :component main-screen}]
screens)]])) screens)]))
(defn preview-screens []
[navigation/navigation-container
{:ref navigation/set-navigator-ref
:initial-state @navigation-state
:on-state-change persist-state!}
[preview-stack]])

View File

@ -115,6 +115,13 @@
:accessory (when mnemonic :accessory (when mnemonic
[components.common/counter {:size 22} 1]) [components.common/counter {:size 22} 1])
:on-press #(re-frame/dispatch [:navigate-to :privacy-and-security])}] :on-press #(re-frame/dispatch [:navigate-to :privacy-and-security])}]
(when config/quo-preview-enabled?
[quo/list-item
{:icon :main-icons/appearance
:title "Quo Preview"
:accessibility-label :appearance-settings-button
:chevron true
:on-press #(re-frame/dispatch [:navigate-to :quo-preview])}])
[quo/list-item [quo/list-item
{:icon :main-icons/appearance {:icon :main-icons/appearance
:title (i18n/label :t/appearance) :title (i18n/label :t/appearance)

View File

@ -20,6 +20,8 @@
[status-im.ui.components.invite.views :as invite] [status-im.ui.components.invite.views :as invite]
[status-im.ui.screens.routing.core :as navigation] [status-im.ui.screens.routing.core :as navigation]
[status-im.utils.platform :as platform] [status-im.utils.platform :as platform]
[quo.previews.main :as quo.preview]
[status-im.utils.config :as config]
[status-im.ui.screens.chat.image.preview.views :as image-preview] [status-im.ui.screens.chat.image.preview.views :as image-preview]
[status-im.ui.screens.notifications-settings.views :as notifications-settings])) [status-im.ui.screens.notifications-settings.views :as notifications-settings]))
@ -52,6 +54,7 @@
;; https://github.com/react-navigation/react-navigation/issues/6520 ;; https://github.com/react-navigation/react-navigation/issues/6520
(when platform/ios? (when platform/ios?
{:mode :modal})) {:mode :modal}))
(concat
[(if logged-in? [(if logged-in?
{:name :tabs {:name :tabs
:insets {:top false} :insets {:top false}
@ -106,4 +109,8 @@
{:name :notifications-settings {:name :notifications-settings
:back-handler :noop :back-handler :noop
:insets {:bottom true} :insets {:bottom true}
:component notifications-settings/notifications-settings}]])) :component notifications-settings/notifications-settings}]
(when config/quo-preview-enabled?
[{:name :quo-preview
:insets {:top false :bottom false}
:component quo.preview/preview-stack}]))]))

View File

@ -40,6 +40,7 @@
(def keycard-test-menu-enabled? (enabled? (get-config :KEYCARD_TEST_MENU "0"))) (def keycard-test-menu-enabled? (enabled? (get-config :KEYCARD_TEST_MENU "0")))
(def qr-test-menu-enabled? (enabled? (get-config :QR_READ_TEST_MENU "0"))) (def qr-test-menu-enabled? (enabled? (get-config :QR_READ_TEST_MENU "0")))
(def referrals-invite-enabled? (enabled? (get-config :ENABLE_REFERRAL_INVITE "0"))) (def referrals-invite-enabled? (enabled? (get-config :ENABLE_REFERRAL_INVITE "0")))
(def quo-preview-enabled? (enabled? (get-config :ENABLE_QUO_PREVIEW "0")))
;; CONFIG VALUES ;; CONFIG VALUES
(def log-level (def log-level