Skip to content

Chore: Add :screen qualifier to all screens #22413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions doc/new-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -550,14 +550,14 @@ used in the new code in `src/status_im2/`. Don't use
(rf/merge cofx
(reset-community-id-input id)
(bottom-sheet/hide-bottom-sheet)
(navigation/open-modal :invite-people-community {:invite? true})))
(navigation/open-modal :screen/invite-people-community {:invite? true})))

;; good
(re-frame/reg-event-fx :communities/invite-people-pressed
(fn [{:keys [db]} [id]]
{:db (assoc db :communities/community-id-input id)
:fx [[:dispatch [:hide-bottom-sheet]]
[:dispatch [:open-modal :invite-people-community {:invite? true}]]]}))
[:dispatch [:open-modal :screen/invite-people-community {:invite? true}]]]}))
```

### Registering top-level re-frame subscriptions
Expand Down
8 changes: 4 additions & 4 deletions src/legacy/status_im/browser/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,8 @@
:browser/options
{:browser-id (:browser-id browser)}
:browser/screen-id :browser)
:dispatch-n [[:shell/change-tab :browser-stack]]}
(navigation/pop-to-root :shell-stack)
:dispatch-n [[:shell/change-tab :screen/browser-stack]]}
(navigation/pop-to-root :screen/shell-stack)
(chat.events/close-chat (:current-chat-id db))
(update-browser browser)
(resolve-url nil))
Expand All @@ -323,7 +323,7 @@
:browser/options
{:browser-id browser-id}
:browser/screen-id :browser)
:dispatch-n [[:shell/change-tab :browser-stack]]}
:dispatch-n [[:shell/change-tab :screen/browser-stack]]}
(update-browser browser)
(resolve-url nil))))

Expand All @@ -332,7 +332,7 @@
[{:keys [db] :as cofx}]
(rf/merge cofx
{:db (assoc db :browser/screen-id :browser-tabs)
:dispatch-n [[:shell/change-tab :browser-stack]]}))
:dispatch-n [[:shell/change-tab :screen/browser-stack]]}))

(rf/defn web3-error-callback
{:events [:browser.dapp/transaction-on-error]}
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/status_im/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
[{:keys [db] :as cofx} view-id]
(rf/merge cofx
(cond
(= :chat view-id)
(= :screen/chat view-id)
{:effects.async-storage/set {:chat-id (get-in cofx [:db :current-chat-id])
:key-uid (get-in cofx [:db :profile/profile :key-uid])}
:db (assoc db :screens/was-focused-once? true)
Expand Down
4 changes: 2 additions & 2 deletions src/legacy/status_im/group_chats/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
(fn [{:keys [db]} [response]]
{:db (dissoc db :current-chat-id)
:fx [[:dispatch [:sanitize-messages-and-process-response response]]
[:dispatch [:pop-to-root :shell-stack]]
[:dispatch [:pop-to-root :screen/shell-stack]]
[:activity-center.notifications/fetch-unread-count]]}))

(rf/defn handle-chat-update
Expand Down Expand Up @@ -116,7 +116,7 @@
[cofx chat-id]
(rf/merge cofx
(chat.events/deactivate-chat chat-id)
(navigation/pop-to-root :shell-stack)))
(navigation/pop-to-root :screen/shell-stack)))

(def not-blank?
(complement string/blank?))
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/status_im/pairing/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
[{:keys [db] :as cofx}]
(rf/merge cofx
{:db (assoc-in db [:pairing/prompt-user-pop-up] false)}
(navigation/navigate-to :installations nil)))
(navigation/navigate-to :screen/installations nil)))

(rf/defn prompt-user-on-new-installation
[{:keys [db]}]
Expand Down
16 changes: 9 additions & 7 deletions src/legacy/status_im/qr_scanner/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[_ opts]
{:request-permissions-fx
{:permissions [:camera]
:on-allowed #(re-frame/dispatch [:open-modal :qr-scanner opts])
:on-allowed #(re-frame/dispatch [:open-modal :screen/qr-scanner opts])
:on-denied (fn []
(utils/set-timeout
#(utils/show-popup (i18n/label :t/error)
Expand Down Expand Up @@ -62,8 +62,8 @@
(cond
(and public-key own)
(rf/merge cofx
(navigation/pop-to-root :shell-stack)
(navigation/navigate-to :my-profile nil))
(navigation/pop-to-root :screen/shell-stack)
(navigation/navigate-to :screen/my-profile nil))

(and public-key (not own))
(rf/merge cofx
Expand All @@ -73,14 +73,15 @@
:else
{:effects.utils/show-popup {:title (i18n/label :t/unable-to-read-this-code)
:content (i18n/label :t/ens-name-not-found)
:on-dismiss #(re-frame/dispatch [:pop-to-root :shell-stack])}})))
:on-dismiss #(re-frame/dispatch [:pop-to-root
:screen/shell-stack])}})))

(rf/defn handle-eip681
[cofx data]
(rf/merge cofx
{:dispatch-n [[:shell/change-tab :wallet-stack]
{:dispatch-n [[:shell/change-tab :screen/wallet-stack]
[:wallet-legacy/parse-eip681-uri-and-resolve-ens data]]}
(navigation/pop-to-root :shell-stack)))
(navigation/pop-to-root :screen/shell-stack)))

(rf/defn handle-local-pairing
{:events [::handle-local-pairing-uri]}
Expand All @@ -103,7 +104,8 @@
:event ::match-scanned-value})
{:dispatch [:navigate-back]
:effects.utils/show-popup {:title (i18n/label :t/unable-to-read-this-code)
:on-dismiss #(re-frame/dispatch [:pop-to-root :shell-stack])}})))
:on-dismiss #(re-frame/dispatch [:pop-to-root
:screen/shell-stack])}})))

(rf/defn on-scan
{:events [::on-scan-success]}
Expand Down
8 changes: 4 additions & 4 deletions src/legacy/status_im/ui/screens/advanced_settings/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@
:title (i18n/label :t/log-level)
:accessibility-label :log-level-settings-button
:on-press
#(re-frame/dispatch [:open-modal :legacy-:og-level-settings])
#(re-frame/dispatch [:open-modal :screen/legacy-log-level-settings])
:accessory :text
:accessory-text current-log-level
:chevron true}
{:size :small
:title (i18n/label :t/fleet)
:accessibility-label :fleet-settings-button
:on-press
#(re-frame/dispatch [:open-modal :fleet-settings])
#(re-frame/dispatch [:open-modal :screen/fleet-settings])
:accessory :text
:accessory-text current-fleet
:chevron true}
Expand All @@ -64,14 +64,14 @@
:accessibility-label :rpc-usage-info
:container-margin-top 8
:on-press
#(re-frame/dispatch [:open-modal :rpc-usage-info])
#(re-frame/dispatch [:open-modal :screen/rpc-usage-info])
:chevron true}
{:size :small
:title (i18n/label :t/peers-stats)
:accessibility-label :peers-stats
:container-margin-top 8
:on-press
#(re-frame/dispatch [:open-modal :peers-stats])
#(re-frame/dispatch [:open-modal :screen/peers-stats])
:chevron true}
{:size :small
:title (i18n/label :t/light-client-enabled)
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/status_im/ui/screens/browser/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
(if empty-tab
[react/touchable-highlight
{:accessibility-label :universal-qr-scanner
:on-press #(re-frame/dispatch [:open-modal :shell-qr-reader])}
:on-press #(re-frame/dispatch [:open-modal :screen/shell-qr-reader])}
[icons/icon :main-icons/qr {:color colors/black}]]
[react/touchable-highlight
{:on-press #(re-frame/dispatch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
[rn/view (style/community-view-button)
[rn/touchable-opacity
{:on-press #(do
(rf/dispatch [:pop-to-root :shell-stack])
(rf/dispatch [:pop-to-root :screen/shell-stack])
(rf/dispatch [:communities/navigate-to-community-overview (:id community)])
(rf/dispatch [:chat/close]))}
[rn/text
Expand Down
3 changes: 2 additions & 1 deletion src/legacy/status_im/ui/screens/communities/members.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@
[react/view {:flex-direction :row}
(when (pos? requests-count)
[unviewed-indicator/unviewed-indicator requests-count])]
:on-press #(rf/dispatch [:navigate-to :community-requests-to-join {:community-id community-id}])
:on-press #(rf/dispatch [:navigate-to :screen/community-requests-to-join
{:community-id community-id}])
:title (i18n/label :t/membership-requests)}]
[quo/separator {:style {:margin-vertical 8}}]]))

Expand Down
74 changes: 0 additions & 74 deletions src/legacy/status_im/ui/screens/glossary/view.cljs

This file was deleted.

2 changes: 1 addition & 1 deletion src/legacy/status_im/ui/screens/help_center/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
[{:size :small
:title (i18n/label :t/submit-bug)
:accessibility-label :submit-bug-button
:on-press #(re-frame/dispatch [:open-modal :bug-report])
:on-press #(re-frame/dispatch [:open-modal :screen/bug-report])
:chevron true}
{:size :small
:title (i18n/label :t/status-help)
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/status_im/ui/screens/profile/user/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
:title (i18n/label :t/sync-settings)
:accessibility-label :sync-settings-button
:chevron true
:on-press #(re-frame/dispatch [:open-modal :legacy-sync-settings])}]])
:on-press #(re-frame/dispatch [:open-modal :screen/legacy-sync-settings])}]])

(defn legacy-settings
[]
Expand Down
Loading