Add peers stats screen

This commit is contained in:
Roman Volosovskyi 2022-12-08 11:08:16 +01:00
parent 5ca46fe805
commit 9be8a5b961
No known key found for this signature in database
GPG Key ID: 0238A4B5ECEE70DE
4 changed files with 27 additions and 0 deletions

View File

@ -69,6 +69,13 @@
:on-press
#(re-frame/dispatch [:navigate-to :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 [:navigate-to :peers-stats])
:chevron true}
;; If it's enabled in the config, we don't show the option
(when (not config/communities-enabled?)
{:size :small

View File

@ -0,0 +1,14 @@
(ns status-im.ui.screens.peers-stats
(:require [react-native.core :as react-native.core]
[status-im.i18n.i18n :as i18n]
[utils.re-frame :as re-frame]))
(defn peers-stats []
(let [peers-count (re-frame/sub [:peers-count])]
[react-native.core/view {:flex 1
:margin-horizontal 8}
[react-native.core/view
{:style {:flex-direction :row
:margin-vertical 8
:justify-content :space-between}}
[react-native.core/text (str (i18n/label :t/peers-count) ": " peers-count)]]]))

View File

@ -102,6 +102,7 @@
[status-im.ui.screens.backup-settings.view :as backup-settings]
[status-im.ui.screens.reset-password.views :as reset-password]
[status-im.ui.screens.rpc-usage-info :as rpc-usage-info]
[status-im.ui.screens.peers-stats :as peers-stats]
[status-im.ui.screens.status.new.views :as status.new]
[status-im.ui.screens.stickers.views :as stickers]
[status-im.ui.screens.sync-settings.views :as sync-settings]
@ -541,6 +542,9 @@
{:name :rpc-usage-info
:options {:topBar {:title {:text (i18n/label :t/rpc-usage-info)}}}
:component rpc-usage-info/usage-info}
{:name :peers-stats
:options {:topBar {:title {:text (i18n/label :t/peers-stats)}}}
:component peers-stats/peers-stats}
{:name :edit-network
:options {:topBar {:title {:text (i18n/label :t/add-network)}}}
:component edit-network/edit-network}

View File

@ -1049,6 +1049,8 @@
"paste-json": "Paste JSON",
"pay-to-chat": "Pay to chat",
"peers": "Peers",
"peers-count": "Peers count",
"peers-stats": "Peers stats",
"pending": "Pending",
"pending-confirmation": "Pending confirmation...",
"permissions": "Permissions",