mirror of
https://github.com/status-im/status-react.git
synced 2025-01-25 18:29:37 +00:00
[#14622] Show ugly network state icons and connection bottom sheet
This commit is contained in:
parent
854e372f73
commit
d608b88e26
@ -58,10 +58,35 @@
|
|||||||
:size :small}
|
:size :small}
|
||||||
avatar)]]])
|
avatar)]]])
|
||||||
|
|
||||||
|
(defn connectivity-sheet
|
||||||
|
[]
|
||||||
|
(let [peers-count (rf/sub [:peers-count])
|
||||||
|
network-type (rf/sub [:network/type])]
|
||||||
|
[rn/view
|
||||||
|
[quo/text {:accessibility-label :peers-network-type-text} (str "NETWORK TYPE: " network-type)]
|
||||||
|
[quo/text {:accessibility-label :peers-count-text} (str "PEERS COUNT: " peers-count)]]))
|
||||||
|
|
||||||
(defn- right-section
|
(defn- right-section
|
||||||
[{:keys [button-type search?]}]
|
[{:keys [button-type search?]}]
|
||||||
(let [button-common-props (get-button-common-props button-type)]
|
(let [button-common-props (get-button-common-props button-type)
|
||||||
|
network-type (rf/sub [:network/type])]
|
||||||
[rn/view {:style style/right-section}
|
[rn/view {:style style/right-section}
|
||||||
|
(when (= network-type "cellular")
|
||||||
|
[quo/button
|
||||||
|
(merge button-common-props
|
||||||
|
{:icon false
|
||||||
|
:accessibility-label :on-cellular-network
|
||||||
|
:on-press #(rf/dispatch [:bottom-sheet/show-sheet
|
||||||
|
{:content connectivity-sheet}])})
|
||||||
|
"🦄"])
|
||||||
|
(when (= network-type "none")
|
||||||
|
[quo/button
|
||||||
|
(merge button-common-props
|
||||||
|
{:icon false
|
||||||
|
:accessibility-label :no-network-connection
|
||||||
|
:on-press #(rf/dispatch [:bottom-sheet/show-sheet
|
||||||
|
{:content connectivity-sheet}])})
|
||||||
|
"💀"])
|
||||||
(when search?
|
(when search?
|
||||||
[quo/button
|
[quo/button
|
||||||
(assoc button-common-props :accessibility-label :open-search-button)
|
(assoc button-common-props :accessibility-label :open-search-button)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user