Skip to content

Commit

Permalink
Merge branch 'develop' into refresh-control-test
Browse files Browse the repository at this point in the history
  • Loading branch information
mmilad75 committed May 2, 2024
2 parents 103d949 + 041ceda commit 76399af
Show file tree
Hide file tree
Showing 16 changed files with 111 additions and 71 deletions.
62 changes: 24 additions & 38 deletions src/legacy/status_im/ui/screens/advanced_settings/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@

(defn- normal-mode-settings-data
[{:keys [current-log-level
telemetry-enabled?
light-client-enabled?
transactions-management-enabled?
current-fleet
webview-debug
test-networks-enabled?
is-goerli-enabled?
peer-syncing-enabled?]}]
Expand Down Expand Up @@ -62,33 +61,22 @@
#(re-frame/dispatch [:open-modal :peers-stats])
:chevron true}
{:size :small
:title (i18n/label :t/light-client-enabled)
:accessibility-label :light-client-enabled
:container-margin-bottom 8
:on-press
#(re-frame/dispatch
[:wakuv2.ui/toggle-light-client (not light-client-enabled?)])
:accessory :switch
:active light-client-enabled?}
{:size :small
:title (i18n/label :t/transactions-management-enabled)
:accessibility-label :transactions-management-enabled
:title "Telemetry"
:accessibility-label :telemetry-enabled
:container-margin-bottom 8
:on-press
#(re-frame/dispatch
[:multiaccounts.ui/switch-transactions-management-enabled
(not transactions-management-enabled?)])
#(re-frame/dispatch [:profile.settings/toggle-telemetry])
:accessory :switch
:active transactions-management-enabled?}
:active telemetry-enabled?}
{:size :small
:title "Webview debug"
:accessibility-label :webview-debug-switch
:title (i18n/label :t/light-client-enabled)
:accessibility-label :light-client-enabled
:container-margin-bottom 8
:on-press
#(re-frame/dispatch
[:profile.settings/change-webview-debug (not webview-debug)])
[:wakuv2.ui/toggle-light-client (not light-client-enabled?)])
:accessory :switch
:active webview-debug}
:active light-client-enabled?}
{:size :small
:title "Testnet mode"
:accessibility-label :test-networks-enabled
Expand Down Expand Up @@ -126,14 +114,13 @@

(views/defview advanced-settings
[]
(views/letsubs [test-networks-enabled? [:profile/test-networks-enabled?]
is-goerli-enabled? [:profile/is-goerli-enabled?]
light-client-enabled? [:profile/light-client-enabled?]
webview-debug [:profile/webview-debug]
transactions-management-enabled? [:wallet-legacy/transactions-management-enabled?]
current-log-level [:log-level/current-log-level]
current-fleet [:fleets/current-fleet]
peer-syncing-enabled? [:profile/peer-syncing-enabled?]]
(views/letsubs [test-networks-enabled? [:profile/test-networks-enabled?]
is-goerli-enabled? [:profile/is-goerli-enabled?]
light-client-enabled? [:profile/light-client-enabled?]
telemetry-enabled? [:profile/telemetry-enabled?]
current-log-level [:log-level/current-log-level]
current-fleet [:fleets/current-fleet]
peer-syncing-enabled? [:profile/peer-syncing-enabled?]]
[:<>
[quo/page-nav
{:type :title
Expand All @@ -143,14 +130,13 @@
:on-press #(rf/dispatch [:navigate-back])}]
[list/flat-list
{:data (flat-list-data
{:current-log-level current-log-level
:transactions-management-enabled? transactions-management-enabled?
:light-client-enabled? light-client-enabled?
:current-fleet current-fleet
:dev-mode? false
:webview-debug webview-debug
:test-networks-enabled? test-networks-enabled?
:is-goerli-enabled? is-goerli-enabled?
:peer-syncing-enabled? peer-syncing-enabled?})
{:current-log-level current-log-level
:telemetry-enabled? telemetry-enabled?
:light-client-enabled? light-client-enabled?
:current-fleet current-fleet
:dev-mode? false
:test-networks-enabled? test-networks-enabled?
:is-goerli-enabled? is-goerli-enabled?
:peer-syncing-enabled? peer-syncing-enabled?})
:key-fn (fn [_ i] (str i))
:render-fn render-item}]]))
44 changes: 31 additions & 13 deletions src/status_im/common/home/actions/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -415,13 +415,16 @@
[{:keys [chat-id public? chat-type muted-till]} inside-chat? needs-divider?]
[(mark-as-read-entry chat-id needs-divider?)
(mute-chat-entry chat-id chat-type muted-till)
(notifications-entry false)
(when config/show-not-implemented-features?
(notifications-entry false))
(when (and config/fetch-messages-enabled? inside-chat?)
(chat-actions/fetch-messages chat-id))
(when public?
(show-qr-entry))
(when config/show-not-implemented-features?
(show-qr-entry)))
(when public?
(share-group-entry))])
(when config/show-not-implemented-features?
(share-group-entry)))])

(defn group-actions
[{:keys [chat-id admins]} inside-chat?]
Expand All @@ -430,10 +433,16 @@
[(group-details-entry chat-id)
(when inside-chat?
(if admin?
(manage-members-entry)
(add-members-entry)))
(when (and admin? inside-chat?) (edit-group-entry))
(when (and admin? inside-chat?) (group-privacy-entry))]))
(when config/show-not-implemented-features?
(manage-members-entry))
(when config/show-not-implemented-features?
(add-members-entry))))
(when (and admin? inside-chat?)
(when config/show-not-implemented-features?
(edit-group-entry)))
(when (and admin? inside-chat?)
(when config/show-not-implemented-features?
(group-privacy-entry)))]))

(defn one-to-one-actions
[{:keys [chat-id] :as item} inside-chat?]
Expand All @@ -456,11 +465,17 @@
(let [current-pub-key (rf/sub [:multiaccount/public-key])]
[quo/action-drawer
[[(view-profile-entry public-key)
(when-not (= current-pub-key public-key)
(when config/show-not-implemented-features?
(rename-entry)))
(when config/show-not-implemented-features?
(show-qr-entry))
(when config/show-not-implemented-features?
(share-profile-entry))]
[(when-not (= current-pub-key public-key)
(when config/show-not-implemented-features?
(mark-untrustworthy-entry)))
(when-not (= current-pub-key public-key) (remove-from-contacts-entry contact))
(when-not (= current-pub-key public-key) (rename-entry))
(show-qr-entry)
(share-profile-entry)]
[(when-not (= current-pub-key public-key) (mark-untrustworthy-entry))
(when-not (= current-pub-key public-key) (block-user-entry contact))]
(when (and admin? chat-id)
[(if (= current-pub-key public-key)
Expand All @@ -485,6 +500,9 @@
(let [current-pub-key (rf/sub [:multiaccount/public-key])
admin? (get admins current-pub-key)]
[quo/action-drawer
[(when admin? [(edit-name-image-entry)])
[(notifications-entry admin?)]
[(when admin?
[(when config/show-not-implemented-features?
(edit-name-image-entry))])
[(when config/show-not-implemented-features?
(notifications-entry admin?))]
(destructive-actions group false)]]))
2 changes: 2 additions & 0 deletions src/status_im/constants.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -493,3 +493,5 @@
(def ^:const status-hostname "status.app")

(def ^:const community-joined-notification-type "communityJoined")

(def ^:const default-telemetry-server-url "https://telemetry.status.im")
5 changes: 1 addition & 4 deletions src/status_im/contexts/chat/messenger/composer/effects.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,7 @@
(fn []
(empty-effect animations subscriptions))
[input-text images link-previews? reply])
(rn/use-effect
(fn []
(reenter-screen-effect state dimensions subscriptions animations))
[max-height subscriptions]))
(rn/use-mount #(reenter-screen-effect state dimensions subscriptions animations)))

(defn use-edit
[{:keys [input-ref]}
Expand Down
6 changes: 4 additions & 2 deletions src/status_im/contexts/chat/messenger/composer/gesture.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@
(reanimated/set-shared-value saved-height max-height)
(reanimated/set-shared-value background-y 0)
(reanimated/animate opacity 1)
(reset! maximized? true)
(rf/dispatch [:chat.ui/set-input-maximized true]))
(js/setTimeout (fn []
(reset! maximized? true)
(rf/dispatch [:chat.ui/set-input-maximized true]))
300))

(defn minimize
[{:keys [input-ref emoji-kb-extra-height saved-emoji-kb-extra-height]}
Expand Down
6 changes: 6 additions & 0 deletions src/status_im/contexts/profile/settings/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@
:params [{:enabled new-value}]
:on-error #(log/error "failed to toggle peer syncing" new-value %)}]]]})))

(rf/reg-event-fx :profile.settings/toggle-telemetry
(fn [{:keys [db]}]
(let [value (get-in db [:profile/profile :telemetry-server-url])
new-value (if (string/blank? value) constants/default-telemetry-server-url "")]
{:dispatch [:profile.settings/profile-update :telemetry-server-url new-value]})))

(rf/reg-event-fx :profile.settings/change-appearance
(fn [_ [theme]]
{:fx [[:dispatch [:profile.settings/profile-update :appearance theme]]
Expand Down
6 changes: 6 additions & 0 deletions src/status_im/contexts/wallet/account/tabs/assets/style.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(ns status-im.contexts.wallet.account.tabs.assets.style
(:require [status-im.contexts.shell.jump-to.constants :as constants]))

(def list-container-style
{:padding-horizontal 8
:padding-bottom constants/floating-shell-button-height})
3 changes: 2 additions & 1 deletion src/status_im/contexts/wallet/account/tabs/assets/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
(:require
[quo.core :as quo]
[react-native.core :as rn]
[status-im.contexts.wallet.account.tabs.assets.style :as style]
[status-im.contexts.wallet.common.token-value.view :as token-value]
[utils.re-frame :as rf]))

Expand All @@ -20,4 +21,4 @@
:style {:flex 1}
:data tokens
:render-data {:watch-only? watch-only?}
:content-container-style {:padding-horizontal 8}}])))
:content-container-style style/list-container-style}])))
12 changes: 10 additions & 2 deletions src/status_im/contexts/wallet/account/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
(let [selected-tab (reagent/atom first-tab-id)]
(fn []
(let [{:keys [name color formatted-balance
watch-only?]} (rf/sub [:wallet/current-viewing-account])]
watch-only?]} (rf/sub [:wallet/current-viewing-account])
customization-color (rf/sub [:profile/customization-color])]
[rn/view {:style {:flex 1}}
[account-switcher/view
{:type :wallet-networks
Expand Down Expand Up @@ -55,4 +56,11 @@
:on-change #(reset! selected-tab %)
:scrollable? true
:scroll-on-press? true}]
[tabs/view {:selected-tab @selected-tab}]]))))
[tabs/view {:selected-tab @selected-tab}]
[quo/floating-shell-button
{:jump-to
{:on-press #(rf/dispatch [:shell/navigate-to-jump-to])
:customization-color customization-color
:label (i18n/label :t/jump-to)}}
{:position :absolute
:bottom 0}]]))))
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
:button-one-label (i18n/label :t/continue)
:button-one-props {:disabled? (or (pos? error)
(< (count keypair-name)
keypair-name-min-length))
keypair-name-min-length)
(> (count keypair-name)
keypair-name-max-length))
:customization-color customization-color
:on-press on-continue}
:container-style style/bottom-action}]}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(ns status-im.contexts.wallet.common.collectibles-tab.style
(:require [status-im.contexts.shell.jump-to.constants :as constants]))

(def list-container-style
{:margin-horizontal 12
:padding-bottom constants/floating-shell-button-height})
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
[react-native.core :as rn]
[status-im.common.resources :as resources]
[status-im.contexts.wallet.collectible.utils :as utils]
[status-im.contexts.wallet.common.collectibles-tab.style :as style]
[status-im.contexts.wallet.common.empty-tab.view :as empty-tab]
[utils.i18n :as i18n]))

Expand Down Expand Up @@ -50,7 +51,7 @@
[rn/flat-list
{:data collectibles
:style {:flex 1}
:content-container-style {:margin-horizontal 12}
:content-container-style style/list-container-style
:window-size 11
:num-columns 2
:render-fn (fn [item index]
Expand Down
6 changes: 4 additions & 2 deletions src/status_im/contexts/wallet/home/tabs/assets/style.cljs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
(ns status-im.contexts.wallet.home.tabs.assets.style)
(ns status-im.contexts.wallet.home.tabs.assets.style
(:require [status-im.contexts.shell.jump-to.constants :as constants]))

(def list-container
{:padding-horizontal 8})
{:padding-horizontal 8
:padding-bottom constants/floating-shell-button-height})
5 changes: 1 addition & 4 deletions src/status_im/navigation/screens.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,7 @@
:component emoji-picker/view}

{:name :screen/wallet.accounts
:options {:insets {:top? true}
:popGesture false
:hardwareBackButton {:dismissModalOnPress false
:popStackOnPress false}}
:options {:insets {:top? true}}
:component wallet-accounts/view}

{:name :screen/wallet.edit-account
Expand Down
6 changes: 6 additions & 0 deletions src/status_im/subs/profile.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@
(fn [profile]
(get-in profile [:wakuv2-config :LightClient])))

(re-frame/reg-sub
:profile/telemetry-enabled?
:<- [:profile/profile]
(fn [profile]
(not (string/blank? (:telemetry-server-url profile)))))

(re-frame/reg-sub
:profile/test-networks-enabled?
:<- [:profile/profile]
Expand Down
6 changes: 3 additions & 3 deletions status-go-version.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
"owner": "status-im",
"repo": "status-go",
"version": "v0.179.11",
"commit-sha1": "b124e2b4f27a2aa41ffebb1ccf385475c5e87781",
"src-sha256": "142988smak33gmz0zd21ifkn2kajh9di858hrfffbk0xsxbv59rm"
"version": "v0.179.12",
"commit-sha1": "22bea87bb2102aaffe7bb19ba07893a223f0f3d9",
"src-sha256": "0nh2nr5lg8f7lsqqqxpxz045ymrry787qvyn5hzvsqazda1ii1hb"
}

0 comments on commit 76399af

Please sign in to comment.