Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Parveshdhull committed May 21, 2024
1 parent 4a0129c commit 32b0890
Show file tree
Hide file tree
Showing 16 changed files with 46 additions and 35 deletions.
6 changes: 2 additions & 4 deletions src/status_im/config.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
(def commands-enabled? (enabled? (get-config :COMMANDS_ENABLED "0")))
(def keycard-test-menu-enabled? (enabled? (get-config :KEYCARD_TEST_MENU "1")))
(def qr-test-menu-enabled? (enabled? (get-config :QR_READ_TEST_MENU "0")))
(def quo-preview-enabled? (enabled? (get-config :ENABLE_QUO_PREVIEW "0")))
;; todo - revert this
(def quo-preview-enabled? (or true (enabled? (get-config :ENABLE_QUO_PREVIEW "0"))))
(def database-management-enabled? (enabled? (get-config :DATABASE_MANAGEMENT_ENABLED "0")))
(def debug-webview? (enabled? (get-config :DEBUG_WEBVIEW "0")))
(def collectibles-enabled? (enabled? (get-config :COLLECTIBLES_ENABLED "1")))
Expand Down Expand Up @@ -141,6 +142,3 @@
;; Alert banners are disabled for debug builds because alert banners overlay
;; interfere with react-native debug tools, such as inspector and Perf monitor
(def enable-alert-banner? (enabled? (get-config :ENABLE_ALERT_BANNER "0")))

(def jump-to-enabled? (enabled? (get-config :ENABLE_JUMP_TO "0")))
;; (def jump-to-enabled? (or true (enabled? (get-config :ENABLE_JUMP_TO "0"))))
4 changes: 3 additions & 1 deletion src/status_im/contexts/chat/group_details/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
[status-im.common.contact-list.view :as contact-list]
[status-im.common.home.actions.view :as actions]
[status-im.constants :as constants]
[status-im.feature-flags :as ff]
[status-im.contexts.chat.group-details.style :as style]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))
Expand Down Expand Up @@ -179,8 +180,9 @@
:admin? admin?}
:render-fn contact-item-render
:separator [rn/view {:style {:height 4}}]}]
(when (ff/enabled? ::ff/shell.jump-to)
[quo/floating-shell-button
{:jump-to {:on-press #(rf/dispatch [:shell/navigate-to-jump-to])
:customization-color profile-color
:label (i18n/label :t/jump-to)}}
style/floating-shell-button]]))
style/floating-shell-button])]))
4 changes: 3 additions & 1 deletion src/status_im/contexts/chat/messenger/composer/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
[status-im.contexts.chat.messenger.composer.utils :as utils]
[status-im.contexts.chat.messenger.messages.contact-requests.bottom-drawer.view :as
contact-requests.bottom-drawer]
[status-im.feature-flags :as ff]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))

Expand Down Expand Up @@ -95,7 +96,8 @@
(:edit subscriptions)]
[rn/view
{:style style/composer-sheet-and-jump-to-container}
[sub-view/shell-button shared-values chat-list-scroll-y window-height]
(when (ff/enabled? ::ff/shell.jump-to)
[sub-view/shell-button shared-values chat-list-scroll-y window-height])
[gesture/gesture-detector
{:gesture
(drag-gesture/drag-gesture props state animations dimensions keyboard-shown)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
[status-im.constants :as constants]
[status-im.contexts.chat.messenger.messages.contact-requests.bottom-drawer.style :as style]
[status-im.contexts.shell.jump-to.constants :as jump-to.constants]
[status-im.feature-flags :as ff]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))

Expand Down Expand Up @@ -49,10 +50,11 @@

contact-request-pending?
(i18n/label :t/contact-request-chat-pending))}]
(when (ff/enabled? ::ff/shell.jump-to)
[quo/floating-shell-button
{:jump-to
{:on-press #(rf/dispatch [:shell/navigate-to-jump-to])
:customization-color customization-color
:label (i18n/label :t/jump-to)}}
{:position :absolute
:top (- jump-to.constants/floating-shell-button-height)}]]))
:top (- jump-to.constants/floating-shell-button-height)}])]))
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
[status-im.common.contact-list-item.view :as contact-list-item]
[status-im.common.contact-list.view :as contact-list]
[status-im.common.home.actions.view :as home.actions]
[status-im.feature-flags :as ff]
[status-im.contexts.communities.actions.channel-view-details.style :as style]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))
Expand Down Expand Up @@ -69,11 +70,12 @@
(rn/use-mount (fn []
(rf/dispatch [:pin-message/load-pin-messages chat-id])))
[:<>
(when (ff/enabled? ::ff/shell.jump-to)
[quo/floating-shell-button
{:jump-to {:on-press #(rf/dispatch [:shell/navigate-to-jump-to])
:customization-color color
:label (i18n/label :t/jump-to)}}
style/floating-shell-button]
style/floating-shell-button])
[quo/gradient-cover {:customization-color color :opacity 0.4}]
[quo/page-nav
{:background :blur
Expand Down
4 changes: 3 additions & 1 deletion src/status_im/contexts/communities/discover/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
[status-im.common.scroll-page.view :as scroll-page]
[status-im.contexts.communities.actions.community-options.view :as options]
[status-im.contexts.communities.discover.style :as style]
[status-im.feature-flags :as ff]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))

Expand Down Expand Up @@ -238,8 +239,9 @@
colors/neutral-95
theme))}
[discover-screen-content featured-communities theme]
(when (ff/enabled? ::ff/shell.jump-to)
[quo/floating-shell-button
{:jump-to {:on-press #(rf/dispatch [:shell/navigate-to-jump-to])
:customization-color customization-color
:label (i18n/label :t/jump-to)}}
style/floating-shell-button]]))
style/floating-shell-button])]))
4 changes: 3 additions & 1 deletion src/status_im/contexts/communities/overview/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
[status-im.contexts.communities.actions.community-options.view :as options]
[status-im.contexts.communities.overview.style :as style]
[status-im.contexts.communities.utils :as communities.utils]
[status-im.feature-flags :as ff]
[utils.debounce :as debounce]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))
Expand Down Expand Up @@ -387,8 +388,9 @@
customization-color (rf/sub [:profile/customization-color])]
[rn/view {:style style/community-overview-container}
[community-card-page-view id]
(when (ff/enabled? ::ff/shell.jump-to)
[quo/floating-shell-button
{:jump-to {:on-press #(rf/dispatch [:shell/navigate-to-jump-to])
:customization-color customization-color
:label (i18n/label :t/jump-to)}}
style/floating-shell-button]]))
style/floating-shell-button])]))
4 changes: 3 additions & 1 deletion src/status_im/contexts/profile/contact/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
[status-im.contexts.profile.contact.actions.view :as actions]
[status-im.contexts.profile.contact.header.view :as contact-header]
[status-im.contexts.shell.jump-to.constants :as jump-to.constants]
[status-im.feature-flags :as ff]
[utils.debounce :as debounce]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))
Expand Down Expand Up @@ -40,10 +41,11 @@
:on-press on-show-actions
:accessibility-label :contact-actions}]}}
[contact-header/view {:scroll-y scroll-y}]]
(when (ff/enabled? ::ff/shell.jump-to)
[quo/floating-shell-button
{:jump-to
{:on-press on-jump-to
:customization-color profile-customization-color
:label (i18n/label :t/jump-to)}}
{:position :absolute
:bottom jump-to.constants/floating-shell-button-height}]]))
:bottom jump-to.constants/floating-shell-button-height}])]))
3 changes: 2 additions & 1 deletion src/status_im/contexts/profile/settings/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@
:on-scroll on-scroll
:bounces false
:over-scroll-mode :never}]
(when (ff/enabled? ::ff/shell.jump-to)
[quo/floating-shell-button
{:jump-to
{:on-press #(rf/dispatch [:shell/navigate-to-jump-to])
:customization-color customization-color
:label (i18n/label :t/jump-to)}}
(style/floating-shell-button-style insets)]]))
(style/floating-shell-button-style insets)])]))
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[status-im.contexts.shell.jump-to.constants :as shell.constants]
[status-im.contexts.shell.jump-to.state :as state]
[status-im.contexts.shell.jump-to.utils :as utils]
[status-im.config :as config]
[status-im.feature-flags :as ff]
[utils.re-frame :as rf]))

(defn blur-overlay-params
Expand Down Expand Up @@ -44,7 +44,7 @@
(defn f-bottom-tabs
[]
(let [notifications-data (rf/sub [:shell/bottom-tabs-notifications-data])
pass-through? (and config/jump-to-enabled?
pass-through? (and (ff/enabled? ::ff/shell.jump-to)
(rf/sub [:shell/shell-pass-through?]))
shared-values @state/shared-values-atom
communities-double-tab-gesture (-> (gesture/gesture-tap)
Expand All @@ -59,7 +59,7 @@
(rf/dispatch [:messages-home/select-tab :tab/recent]))))
bottom-tabs-blur-overlay-style (style/bottom-tabs-blur-overlay (:bottom-tabs-height
shared-values))]
(utils/load-stack (if config/jump-to-enabled? @state/selected-stack-id shell.constants/default-selected-stack))
(utils/load-stack (if (ff/enabled? ::ff/shell.jump-to) @state/selected-stack-id shell.constants/default-selected-stack))
(reanimated/set-shared-value (:pass-through? shared-values) pass-through?)
[quo.theme/provider :dark
[reanimated/view
Expand Down
6 changes: 3 additions & 3 deletions src/status_im/contexts/shell/jump_to/shared_values.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[status-im.contexts.shell.jump-to.constants :as shell.constants]
[status-im.contexts.shell.jump-to.state :as state]
[status-im.contexts.shell.jump-to.utils :as utils]
[status-im.config :as config]
[status-im.feature-flags :as ff]
[utils.worklets.shell :as worklets.shell]))

(defn calculate-home-stack-position
Expand Down Expand Up @@ -112,7 +112,7 @@
{:selected-stack-id (reanimated/use-shared-value
(name (or @state/selected-stack-id shell.constants/default-selected-stack)))
:home-stack-state (reanimated/use-shared-value
(if config/jump-to-enabled?
(if (ff/enabled? ::ff/shell.jump-to)
@state/home-stack-state
shell.constants/open-without-animation))}]
;; Whenever shell stack is created, calculate shared values function is called
Expand All @@ -126,7 +126,7 @@
shared-values
(stacks-and-bottom-tabs-derived-values shared-values)
(home-stack-derived-values shared-values dimensions)
(when config/jump-to-enabled?
(when (or true (ff/enabled? ::ff/shell.jump-to))
(into {}
(for [screen-id shell.constants/floating-screens]
[screen-id
Expand Down
4 changes: 2 additions & 2 deletions src/status_im/contexts/shell/jump_to/utils.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
(:require
[react-native.async-storage :as async-storage]
[react-native.core :as rn]
[status-im.config :as config]
[status-im.feature-flags :as ff]
[react-native.platform :as platform]
[react-native.reanimated :as reanimated]
[react-native.safe-area :as safe-area]
Expand Down Expand Up @@ -119,7 +119,7 @@
;;; Navigation
(defn shell-navigation?
[view-id]
(and config/jump-to-enabled?
(and (ff/enabled? ::ff/shell.jump-to)
(some #{view-id} shell.constants/floating-screens)))

(defn calculate-view-id
Expand Down
20 changes: 8 additions & 12 deletions src/status_im/contexts/shell/jump_to/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
(:require
[quo.core :as quo]
[react-native.core :as rn]
[status-im.config :as config]
[status-im.feature-flags :as ff]
[status-im.contexts.shell.jump-to.animation :as animation]
[status-im.contexts.shell.jump-to.components.bottom-tabs.view :as bottom-tabs]
[status-im.contexts.shell.jump-to.components.floating-screens.view :as floating-screens]
Expand Down Expand Up @@ -30,17 +30,9 @@
:label (i18n/label :t/jump-to)
:customization-color (rf/sub [:profile/customization-color])}}
{:position :absolute
:z-index 1
:bottom (utils/bottom-tabs-container-height)}
(:home-stack-opacity shared-values)])))

(defn- jump-to-components
[shared-values]
[:<>
[jump-to-screen/view]
[floating-screens/view]
[floating-button shared-values]])

(defn shell-stack
[]
(let [alert-banners-top-margin (rf/sub [:alert-banners/top-margin])
Expand All @@ -51,7 +43,11 @@
(rn/hw-back-add-listener navigate-back-handler)
#(rn/hw-back-remove-listener navigate-back-handler)))
[:<>
(when config/jump-to-enabled?
[jump-to-components shared-values])
(when (ff/enabled? ::ff/shell.jump-to)
[jump-to-screen/view])
[:f> bottom-tabs/f-bottom-tabs]
[:f> home-stack/f-home-stack]]))
[:f> home-stack/f-home-stack]
(when (ff/enabled? ::ff/shell.jump-to)
[:<>
[floating-button shared-values]
[floating-screens/view]])]))
3 changes: 2 additions & 1 deletion src/status_im/contexts/wallet/account/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@
:scrollable? true
:scroll-on-press? true}]
[tabs/view {:selected-tab @selected-tab}]
(when (ff/enabled? ::ff/shell.jump-to)
[quo/floating-shell-button
{:jump-to
{:on-press #(rf/dispatch [:shell/navigate-to-jump-to])
:customization-color customization-color
:label (i18n/label :t/jump-to)}}
style/shell-button]]))))
style/shell-button])]))))
1 change: 1 addition & 0 deletions src/status_im/feature_flags.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
:FLAG_WALLET_SETTINGS_KEYPAIRS_AND_ACCOUNTS_ENABLED)
::settings.network-settings (enabled-in-env?
:FLAG_WALLET_SETTINGS_NETWORK_SETTINGS_ENABLED)
::shell.jump-to (enabled-in-env? :ENABLE_JUMP_TO)
::wallet.assets-modal-hide (enabled-in-env? :FLAG_ASSETS_MODAL_HIDE)
::wallet.assets-modal-manage-tokens (enabled-in-env? :FLAG_ASSETS_MODAL_MANAGE_TOKENS)
::wallet.bridge-token (enabled-in-env? :FLAG_BRIDGE_TOKEN_ENABLED)
Expand Down
4 changes: 2 additions & 2 deletions src/status_im/subs/shell.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[status-im.common.resources :as resources]
[status-im.constants :as constants]
[status-im.contexts.shell.jump-to.constants :as shell.constants]
[status-im.config :as config]
[status-im.feature-flags :as ff]
[utils.datetime :as datetime]
[utils.i18n :as i18n]))

Expand Down Expand Up @@ -269,5 +269,5 @@
:shell/chat-screen-loaded?
:<- [:shell/loaded-screens]
(fn [screens]
(or (not config/jump-to-enabled?)
(or (not (ff/enabled? ::ff/shell.jump-to))
(get screens shell.constants/chat-screen))))

0 comments on commit 32b0890

Please sign in to comment.