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
ENABLE_ROOT_ALERT=1
ENABLE_REFERRAL_INVITE=1
ENABLE_QUO_PREVIEW=1

View File

@ -82,17 +82,20 @@
(reset! navigation-state state-obj)
(resolve true))))
(defn preview-screens []
(defn preview-stack []
(let [stack (navigation/create-stack)]
[navigation/navigation-container
{:ref navigation/set-navigator-ref
:initial-state @navigation-state
:on-state-change persist-state!}
[stack {}
(into [{:name :main
:insets {:top false}
:component main-screen}]
screens)]]))
[stack {}
(into [{:name :main
:insets {:top false}
:component main-screen}]
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
[components.common/counter {:size 22} 1])
: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
{:icon :main-icons/appearance
:title (i18n/label :t/appearance)

View File

@ -20,6 +20,8 @@
[status-im.ui.components.invite.views :as invite]
[status-im.ui.screens.routing.core :as navigation]
[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.notifications-settings.views :as notifications-settings]))
@ -52,58 +54,63 @@
;; https://github.com/react-navigation/react-navigation/issues/6520
(when platform/ios?
{:mode :modal}))
[(if logged-in?
{:name :tabs
:insets {:top false}
:component tabs}
{:name :intro-stack
:insets {:top false
:bottom true}
:component intro-login-stack/intro-stack})
{:name :stickers-pack-modal
:component stickers/pack-modal}
{:name :tribute-learn-more
:component tr-to-talk/learn-more}
{:name :welcome
:back-handler :noop
:component home/welcome}
{:name :new-chat
:on-focus [::new-chat.events/new-chat-focus]
:transition :presentation-ios
:component new-chat/new-chat}
{:name :new-contact
:on-focus [::new-chat.events/new-chat-focus]
:transition :presentation-ios
:component new-chat/new-contact}
{:name :new-public-chat
:transition :presentation-ios
:insets {:bottom true}
:component new-public-chat/new-public-chat}
{:name :edit-group-chat-name
:transition :presentation-ios
:insets {:bottom true}
:component group-chat/edit-group-chat-name}
{:name :create-group-chat
:transition :presentation-ios
:component chat-stack/new-group-chat}
{:name :referral-invite
:transition :presentation-ios
:insets {:bottom true}
:component invite/referral-invite}
{:name :add-participants-toggle-list
:on-focus [::group.events/add-participants-toggle-list]
:transition :presentation-ios
:insets {:bottom true}
:component group-chat/add-participants-toggle-list}
{:name :contact-code
:component wallet.components/contact-code}
{:name :qr-scanner
:insets {:top false :bottom false}
:component qr-scanner/qr-scanner}
{:name :image-preview
:insets {:top false :bottom false}
:component image-preview/preview-image}
{:name :notifications-settings
:back-handler :noop
:insets {:bottom true}
:component notifications-settings/notifications-settings}]]))
(concat
[(if logged-in?
{:name :tabs
:insets {:top false}
:component tabs}
{:name :intro-stack
:insets {:top false
:bottom true}
:component intro-login-stack/intro-stack})
{:name :stickers-pack-modal
:component stickers/pack-modal}
{:name :tribute-learn-more
:component tr-to-talk/learn-more}
{:name :welcome
:back-handler :noop
:component home/welcome}
{:name :new-chat
:on-focus [::new-chat.events/new-chat-focus]
:transition :presentation-ios
:component new-chat/new-chat}
{:name :new-contact
:on-focus [::new-chat.events/new-chat-focus]
:transition :presentation-ios
:component new-chat/new-contact}
{:name :new-public-chat
:transition :presentation-ios
:insets {:bottom true}
:component new-public-chat/new-public-chat}
{:name :edit-group-chat-name
:transition :presentation-ios
:insets {:bottom true}
:component group-chat/edit-group-chat-name}
{:name :create-group-chat
:transition :presentation-ios
:component chat-stack/new-group-chat}
{:name :referral-invite
:transition :presentation-ios
:insets {:bottom true}
:component invite/referral-invite}
{:name :add-participants-toggle-list
:on-focus [::group.events/add-participants-toggle-list]
:transition :presentation-ios
:insets {:bottom true}
:component group-chat/add-participants-toggle-list}
{:name :contact-code
:component wallet.components/contact-code}
{:name :qr-scanner
:insets {:top false :bottom false}
:component qr-scanner/qr-scanner}
{:name :image-preview
:insets {:top false :bottom false}
:component image-preview/preview-image}
{:name :notifications-settings
:back-handler :noop
: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 qr-test-menu-enabled? (enabled? (get-config :QR_READ_TEST_MENU "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
(def log-level