fix settings navigation (#19080)

This commit is contained in:
Parvesh Monu 2024-03-04 16:06:59 +05:30 committed by GitHub
parent 7754460acc
commit 851eb6ea8f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 30 additions and 27 deletions

View File

@ -28,7 +28,7 @@
:accessibility-label :network-button :accessibility-label :network-button
:container-margin-top 8 :container-margin-top 8
:on-press :on-press
#(re-frame/dispatch [:navigate-to :network-settings]) #(re-frame/dispatch [:open-modal :network-settings])
:accessory :text :accessory :text
:accessory-text network-name :accessory-text network-name
:chevron true} :chevron true}
@ -37,13 +37,13 @@
:accessibility-label :network-button :accessibility-label :network-button
:container-margin-top 8 :container-margin-top 8
:on-press :on-press
#(re-frame/dispatch [:navigate-to :network-info]) #(re-frame/dispatch [:open-modal :network-info])
:chevron true} :chevron true}
{:size :small {:size :small
:title (i18n/label :t/log-level) :title (i18n/label :t/log-level)
:accessibility-label :log-level-settings-button :accessibility-label :log-level-settings-button
:on-press :on-press
#(re-frame/dispatch [:navigate-to :log-level-settings]) #(re-frame/dispatch [:open-modal :log-level-settings])
:accessory :text :accessory :text
:accessory-text current-log-level :accessory-text current-log-level
:chevron true} :chevron true}
@ -51,7 +51,7 @@
:title (i18n/label :t/fleet) :title (i18n/label :t/fleet)
:accessibility-label :fleet-settings-button :accessibility-label :fleet-settings-button
:on-press :on-press
#(re-frame/dispatch [:navigate-to :fleet-settings]) #(re-frame/dispatch [:open-modal :fleet-settings])
:accessory :text :accessory :text
:accessory-text current-fleet :accessory-text current-fleet
:chevron true} :chevron true}
@ -66,14 +66,14 @@
:accessibility-label :rpc-usage-info :accessibility-label :rpc-usage-info
:container-margin-top 8 :container-margin-top 8
:on-press :on-press
#(re-frame/dispatch [:navigate-to :rpc-usage-info]) #(re-frame/dispatch [:open-modal :rpc-usage-info])
:chevron true} :chevron true}
{:size :small {:size :small
:title (i18n/label :t/peers-stats) :title (i18n/label :t/peers-stats)
:accessibility-label :peers-stats :accessibility-label :peers-stats
:container-margin-top 8 :container-margin-top 8
:on-press :on-press
#(re-frame/dispatch [:navigate-to :peers-stats]) #(re-frame/dispatch [:open-modal :peers-stats])
:chevron true} :chevron true}
{:size :small {:size :small
:title (i18n/label :t/light-client-enabled) :title (i18n/label :t/light-client-enabled)
@ -123,7 +123,7 @@
:title (i18n/label :t/set-currency) :title (i18n/label :t/set-currency)
:accessibility-label :wallet-change-currency :accessibility-label :wallet-change-currency
:on-press #(hide-sheet-and-dispatch :on-press #(hide-sheet-and-dispatch
[:navigate-to :currency-settings]) [:open-modal :currency-settings])
:chevron true}])) :chevron true}]))
(defn- flat-list-data (defn- flat-list-data

View File

@ -102,7 +102,7 @@
:chevron true :chevron true
:icon :main-icons/username} :icon :main-icons/username}
registrar registrar
(assoc :on-press #(re-frame/dispatch [:navigate-to :ens-main registrar])))] (assoc :on-press #(re-frame/dispatch [:open-modal :ens-main registrar])))]
[list.item/list-item [list.item/list-item
{:title (i18n/label :t/contacts) {:title (i18n/label :t/contacts)
:icon :main-icons/in-contacts :icon :main-icons/in-contacts
@ -112,7 +112,7 @@
(str active-contacts-count) (str active-contacts-count)
(i18n/label :t/none)) (i18n/label :t/none))
:chevron true :chevron true
:on-press #(re-frame/dispatch [:navigate-to :contacts-list])}] :on-press #(re-frame/dispatch [:open-modal :contacts-list])}]
[react/view {:padding-top 16} [react/view {:padding-top 16}
[quo/list-header (i18n/label :t/settings)]] [quo/list-header (i18n/label :t/settings)]]
[list.item/list-item [list.item/list-item
@ -122,71 +122,71 @@
:chevron true :chevron true
: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 [:open-modal :privacy-and-security])}]
(when config/quo-preview-enabled? (when config/quo-preview-enabled?
[list.item/list-item [list.item/list-item
{:icon :main-icons/appearance {:icon :main-icons/appearance
:title "Quo Preview" :title "Quo Preview"
:accessibility-label :appearance-settings-button :accessibility-label :appearance-settings-button
:chevron true :chevron true
:on-press #(re-frame/dispatch [:navigate-to :quo-preview])}]) :on-press #(re-frame/dispatch [:open-modal :quo-preview])}])
(when config/quo-preview-enabled? (when config/quo-preview-enabled?
[list.item/list-item [list.item/list-item
{:icon :main-icons/appearance {:icon :main-icons/appearance
:title "Status IM Components" :title "Status IM Components"
:accessibility-label :status-im-common-components :accessibility-label :status-im-common-components
:chevron true :chevron true
:on-press #(re-frame/dispatch [:navigate-to :status-im-preview])}]) :on-press #(re-frame/dispatch [:open-modal :status-im-preview])}])
[list.item/list-item [list.item/list-item
{:icon :main-icons/appearance {:icon :main-icons/appearance
:title (i18n/label :t/appearance) :title (i18n/label :t/appearance)
:accessibility-label :appearance-settings-button :accessibility-label :appearance-settings-button
:chevron true :chevron true
:on-press #(re-frame/dispatch [:navigate-to :appearance])}] :on-press #(re-frame/dispatch [:open-modal :appearance])}]
[list.item/list-item [list.item/list-item
{:icon :main-icons/notification {:icon :main-icons/notification
:title (i18n/label :t/notifications) :title (i18n/label :t/notifications)
:accessibility-label :notifications-settings-button :accessibility-label :notifications-settings-button
:chevron true :chevron true
:on-press #(re-frame/dispatch [:navigate-to :notifications])}] :on-press #(re-frame/dispatch [:open-modal :notifications])}]
[list.item/list-item [list.item/list-item
{:icon :main-icons/mobile {:icon :main-icons/mobile
:title (i18n/label :t/sync-settings) :title (i18n/label :t/sync-settings)
:accessibility-label :sync-settings-button :accessibility-label :sync-settings-button
:chevron true :chevron true
:on-press #(re-frame/dispatch [:navigate-to :sync-settings])}] :on-press #(re-frame/dispatch [:open-modal :sync-settings])}]
(when keycard-pairing (when keycard-pairing
[list.item/list-item [list.item/list-item
{:icon :main-icons/keycard {:icon :main-icons/keycard
:title (i18n/label :t/keycard) :title (i18n/label :t/keycard)
:accessibility-label :keycard-button :accessibility-label :keycard-button
:chevron true :chevron true
:on-press #(re-frame/dispatch [:navigate-to :keycard-settings])}]) :on-press #(re-frame/dispatch [:open-modal :keycard-settings])}])
[list.item/list-item [list.item/list-item
{:icon :main-icons/settings-advanced {:icon :main-icons/settings-advanced
:title (i18n/label :t/advanced) :title (i18n/label :t/advanced)
:accessibility-label :advanced-button :accessibility-label :advanced-button
:chevron true :chevron true
:on-press #(re-frame/dispatch [:navigate-to :advanced-settings])}] :on-press #(re-frame/dispatch [:open-modal :advanced-settings])}]
[list.item/list-item [list.item/list-item
{:icon :main-icons/help {:icon :main-icons/help
:title (i18n/label :t/need-help) :title (i18n/label :t/need-help)
:accessibility-label :help-button :accessibility-label :help-button
:chevron true :chevron true
:on-press #(re-frame/dispatch [:navigate-to :help-center])}] :on-press #(re-frame/dispatch [:open-modal :help-center])}]
[list.item/list-item [list.item/list-item
{:icon :main-icons/info {:icon :main-icons/info
:title (i18n/label :t/about-app) :title (i18n/label :t/about-app)
:accessibility-label :about-button :accessibility-label :about-button
:chevron true :chevron true
:on-press #(re-frame/dispatch [:navigate-to :about-app])}] :on-press #(re-frame/dispatch [:open-modal :about-app])}]
(when local-pairing-mode-enabled? (when local-pairing-mode-enabled?
[list.item/list-item [list.item/list-item
{:icon :i/mobile {:icon :i/mobile
:title (i18n/label :t/syncing) :title (i18n/label :t/syncing)
:accessibility-label :syncing :accessibility-label :syncing
:chevron true :chevron true
:on-press #(re-frame/dispatch [:navigate-to :settings-syncing])}]) :on-press #(re-frame/dispatch [:open-modal :settings-syncing])}])
[react/view {:padding-vertical 24} [react/view {:padding-vertical 24}
[list.item/list-item [list.item/list-item
{:icon :main-icons/log-out {:icon :main-icons/log-out

View File

@ -15,8 +15,8 @@
(defn navigate-back-handler (defn navigate-back-handler
[] []
(when (and (not @navigation.state/curr-modal) (when (or @navigation.state/curr-modal
(seq (utils/open-floating-screens))) (seq (utils/open-floating-screens)))
(rf/dispatch [:navigate-back]) (rf/dispatch [:navigate-back])
true)) true))

View File

@ -1,9 +1,12 @@
(ns status-im.contexts.syncing.setup-syncing.style (ns status-im.contexts.syncing.setup-syncing.style
(:require (:require
[quo.foundations.colors :as colors])) [quo.foundations.colors :as colors]
[react-native.safe-area :as safe-area]))
(def container-main (defn container-main
[]
{:background-color colors/neutral-95 {:background-color colors/neutral-95
:padding-top (safe-area/get-top)
:flex 1}) :flex 1})
(def page-container (def page-container

View File

@ -57,7 +57,7 @@
(rf/dispatch [:syncing/get-connection-string entered-password (rf/dispatch [:syncing/get-connection-string entered-password
set-code]))] set-code]))]
(fn [] (fn []
[rn/view {:style style/container-main} [rn/view {:style (style/container-main)}
[:f> f-use-interval clock cleanup-clock @delay-ms] [:f> f-use-interval clock cleanup-clock @delay-ms]
[rn/scroll-view {} [rn/scroll-view {}
[quo/page-nav [quo/page-nav

View File

@ -38,7 +38,7 @@
:type :primary :type :primary
:customization-color profile-color :customization-color profile-color
:icon-only? true :icon-only? true
:on-press #(rf/dispatch [:navigate-to :settings-setup-syncing])} :on-press #(rf/dispatch [:open-modal :settings-setup-syncing])}
:i/add]] :i/add]]
[device/view (merge user-device {:this-device? true})] [device/view (merge user-device {:this-device? true})]
(when (seq paired-devices) (when (seq paired-devices)

View File

@ -174,7 +174,7 @@
:component settings-syncing/view} :component settings-syncing/view}
{:name :settings-setup-syncing {:name :settings-setup-syncing
:options (merge options/dark-screen {:insets {:top? true}}) :options options/transparent-screen-options
:component settings-setup-syncing/view} :component settings-setup-syncing/view}
;; Onboarding ;; Onboarding