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 [stack {}
{:ref navigation/set-navigator-ref (into [{:name :main
:initial-state @navigation-state :insets {:top false}
:on-state-change persist-state!} :component main-screen}]
[stack {} screens)]))
(into [{:name :main
:insets {:top false} (defn preview-screens []
:component main-screen}] [navigation/navigation-container
screens)]])) {: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,58 +54,63 @@
;; 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}))
[(if logged-in? (concat
{:name :tabs [(if logged-in?
:insets {:top false} {:name :tabs
:component tabs} :insets {:top false}
{:name :intro-stack :component tabs}
:insets {:top false {:name :intro-stack
:bottom true} :insets {:top false
:component intro-login-stack/intro-stack}) :bottom true}
{:name :stickers-pack-modal :component intro-login-stack/intro-stack})
:component stickers/pack-modal} {:name :stickers-pack-modal
{:name :tribute-learn-more :component stickers/pack-modal}
:component tr-to-talk/learn-more} {:name :tribute-learn-more
{:name :welcome :component tr-to-talk/learn-more}
:back-handler :noop {:name :welcome
:component home/welcome} :back-handler :noop
{:name :new-chat :component home/welcome}
:on-focus [::new-chat.events/new-chat-focus] {:name :new-chat
:transition :presentation-ios :on-focus [::new-chat.events/new-chat-focus]
:component new-chat/new-chat} :transition :presentation-ios
{:name :new-contact :component new-chat/new-chat}
:on-focus [::new-chat.events/new-chat-focus] {:name :new-contact
:transition :presentation-ios :on-focus [::new-chat.events/new-chat-focus]
:component new-chat/new-contact} :transition :presentation-ios
{:name :new-public-chat :component new-chat/new-contact}
:transition :presentation-ios {:name :new-public-chat
:insets {:bottom true} :transition :presentation-ios
:component new-public-chat/new-public-chat} :insets {:bottom true}
{:name :edit-group-chat-name :component new-public-chat/new-public-chat}
:transition :presentation-ios {:name :edit-group-chat-name
:insets {:bottom true} :transition :presentation-ios
:component group-chat/edit-group-chat-name} :insets {:bottom true}
{:name :create-group-chat :component group-chat/edit-group-chat-name}
:transition :presentation-ios {:name :create-group-chat
:component chat-stack/new-group-chat} :transition :presentation-ios
{:name :referral-invite :component chat-stack/new-group-chat}
:transition :presentation-ios {:name :referral-invite
:insets {:bottom true} :transition :presentation-ios
:component invite/referral-invite} :insets {:bottom true}
{:name :add-participants-toggle-list :component invite/referral-invite}
:on-focus [::group.events/add-participants-toggle-list] {:name :add-participants-toggle-list
:transition :presentation-ios :on-focus [::group.events/add-participants-toggle-list]
:insets {:bottom true} :transition :presentation-ios
:component group-chat/add-participants-toggle-list} :insets {:bottom true}
{:name :contact-code :component group-chat/add-participants-toggle-list}
:component wallet.components/contact-code} {:name :contact-code
{:name :qr-scanner :component wallet.components/contact-code}
:insets {:top false :bottom false} {:name :qr-scanner
:component qr-scanner/qr-scanner} :insets {:top false :bottom false}
{:name :image-preview :component qr-scanner/qr-scanner}
:insets {:top false :bottom false} {:name :image-preview
:component image-preview/preview-image} :insets {:top false :bottom false}
{:name :notifications-settings :component image-preview/preview-image}
:back-handler :noop {:name :notifications-settings
:insets {:bottom true} :back-handler :noop
:component notifications-settings/notifications-settings}]])) :insets {:bottom true}
: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