fix: remove qa-only features(unicorn, skull) (#17594)

This commit is contained in:
codemaster 2023-10-23 05:33:09 -07:00 committed by GitHub
parent 071d8f0925
commit 221c501279
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 18 additions and 127 deletions

View File

@ -95,25 +95,12 @@
notification-count
activity-center-on-press
scan-on-press
qr-code-on-press
for-qa-only-cellular-network
for-qa-only-no-network
for-qa-only-network-type]
qr-code-on-press]
:as props}]
(let [button-common-props (get-button-common-props {:theme theme
:jump-to? jump-to?
:blur? blur?})]
[rn/view {:style style/right-section}
(when (= for-qa-only-network-type "cellular")
[button/button
(merge (dissoc button-common-props :icon-only?)
for-qa-only-cellular-network)
"🦄"])
(when (= for-qa-only-network-type "none")
[button/button
(merge (dissoc button-common-props :icon-only?)
for-qa-only-no-network)
"💀"])
[button/button
(assoc button-common-props :accessibility-label :open-scanner-button :on-press scan-on-press)
:i/scan]
@ -160,8 +147,5 @@
:qr-code-on-press callback
:notification-count number
:max-unread-notifications used to specify max number for counter
:for-qa-only-cellular-network used for testing purposed
:for-qa-only-no-network used for testing purposed
:for-qa-only-network-type used for testing purposed
"
(quo.theme/with-theme view-internal))

View File

@ -20,9 +20,6 @@
(map? view)
(merge view)
(= view :mobile-network)
(merge mobile-network-settings/settings-sheet)
(= view :mobile-network-offline)
(merge mobile-network-settings/offline-sheet)

View File

@ -29,15 +29,6 @@
cofx
{:db (assoc db :network-status/initialized? true)}
(cond
(and logged-in?
(utils/cellular? (:network/type db))
(not remember-syncing-choice?)
(not= :create-multiaccount (:view-id db)))
[(bottom-sheet/show-bottom-sheet-old
{:view :mobile-network})
(sheet-defaults)]
;; NOTE(rasom): When we log into account on-network-status-change is
;; dispatched, but that doesn't mean there was a status change, thus
;; no reason to restart wallet.

View File

@ -1,12 +1,10 @@
(ns status-im.ui.screens.mobile-network-settings.sheets
(:require-macros [status-im.utils.views :as views])
(:require
[re-frame.core :as re-frame]
[status-im.ui.components.checkbox.view :as checkbox]
[status-im.ui.components.list.item :as list.item]
[status-im.ui.components.react :as react]
[status-im.ui.screens.mobile-network-settings.sheets-styles :as styles]
[utils.i18n :as i18n]))
(:require [re-frame.core :as re-frame]
[status-im.ui.components.list.item :as list.item]
[status-im.ui.components.react :as react]
[status-im.ui.screens.mobile-network-settings.sheets-styles :as styles]
[utils.i18n :as i18n]))
(defn title
[label]
@ -36,65 +34,6 @@
:on-press #(re-frame/dispatch [:mobile-network/navigate-to-settings])}
(i18n/label :t/mobile-network-go-to-settings)]])
(views/defview checkbox
[]
(views/letsubs [checked? [:mobile-network/remember-choice?]]
[react/view
{:style styles/checkbox-line-container
:accessibility-label "remember-choice"}
[checkbox/checkbox
{:checked? checked?
:style styles/checkbox
:icon-style styles/checkbox-icon
:on-value-change #(re-frame/dispatch [:mobile-network/remember-choice? %])}]
[react/view
{:style styles/checkbox-text-container}
[react/text (i18n/label :t/mobile-network-sheet-remember-choice)]]]))
(defn settings
[]
[react/view
{:style styles/settings-container}
[react/nested-text
{:style styles/settings-text
:on-press #(re-frame/dispatch [:mobile-network/navigate-to-settings])}
(i18n/label :t/mobile-network-sheet-configure)
[{:style styles/settings-link}
(str " " (i18n/label :t/mobile-network-sheet-settings))]]])
(defn hide-sheet-and-dispatch
[event]
(re-frame/dispatch [:bottom-sheet/hide-old])
(re-frame/dispatch event))
(views/defview settings-sheet
[]
[react/view {:flex 1}
[react/view {:align-items :center}
[title :mobile-syncing-sheet-title]
[details :mobile-syncing-sheet-details]]
[list.item/list-item
{:theme :accent
:accessibility-label "mobile-network-continue-syncing"
:title (i18n/label :t/mobile-network-continue-syncing)
:subtitle (i18n/label :t/mobile-network-continue-syncing-details)
:subtitle-max-lines 2
:icon :main-icons/network
:on-press #(hide-sheet-and-dispatch [:mobile-network/continue-syncing])}]
[list.item/list-item
{:theme :negative
:accessibility-label "mobile-network-stop-syncing"
:title (i18n/label :t/mobile-network-stop-syncing)
:subtitle (i18n/label :t/mobile-network-stop-syncing-details)
:icon :main-icons/cancel
:on-press #(hide-sheet-and-dispatch [:mobile-network/stop-syncing])}]
[separator]
[react/view
{:flex 1
:align-self :stretch}
[checkbox]
[settings]]])
(views/defview offline-sheet
[]
[react/view {:flex 1}

View File

@ -53,8 +53,5 @@
:on-press #(hide-sheet-and-dispatch [:mobile-network/restore-defaults])}
(i18n/label :t/restore-defaults)]]]))
(def settings-sheet
{:content sheets/settings-sheet})
(def offline-sheet
{:content sheets/offline-sheet})

View File

@ -1,21 +1,12 @@
(ns status-im2.common.home.top-nav.view
(:require
[quo.core :as quo]
[react-native.core :as rn]
[status-im.multiaccounts.core :as multiaccounts]
[status-im2.common.home.top-nav.style :as style]
[status-im2.constants :as constants]
[utils.debounce :refer [dispatch-and-chill]]
[utils.re-frame :as rf]))
(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 view
"[top-nav props]
props
@ -30,7 +21,6 @@
avatar {:online? online?
:full-name (multiaccounts/displayed-name account)
:profile-picture (multiaccounts/displayed-photo account)}
network-type (rf/sub [:network/type])
unread-count (rf/sub [:activity-center/unread-count])
indicator (rf/sub [:activity-center/unread-indicator])
notification-type (case indicator
@ -41,22 +31,15 @@
; https://github.com/status-im/status-mobile/issues/17102
nil)]
[quo/top-nav
{:avatar-on-press #(rf/dispatch [:navigate-to :my-profile])
:scan-on-press #(js/alert "to be implemented")
:activity-center-on-press #(rf/dispatch [:activity-center/open])
:qr-code-on-press #(dispatch-and-chill [:open-modal :share-shell] 1000)
:container-style (merge style/top-nav-container container-style)
:blur? blur?
:jump-to? jump-to?
:customization-color customization-color
:avatar-props avatar
:max-unread-notifications constants/activity-center-max-unread-count
:notification-count unread-count
:notification notification-type
:for-qa-only-cellular-network {:accessibility-label :on-cellular-network
:on-press #(rf/dispatch [:show-bottom-sheet
{:content connectivity-sheet}])}
:for-qa-only-no-network {:accessibility-label :no-network-connection
:on-press #(rf/dispatch [:show-bottom-sheet
{:content connectivity-sheet}])}
:for-qa-only-network-type network-type}]))
{:avatar-on-press #(rf/dispatch [:navigate-to :my-profile])
:scan-on-press #(js/alert "to be implemented")
:activity-center-on-press #(rf/dispatch [:activity-center/open])
:qr-code-on-press #(dispatch-and-chill [:open-modal :share-shell] 1000)
:container-style (merge style/top-nav-container container-style)
:blur? blur?
:jump-to? jump-to?
:customization-color customization-color
:avatar-props avatar
:max-unread-notifications constants/activity-center-max-unread-count
:notification-count unread-count
:notification notification-type}]))