Skip to content

Commit 7764e2c

Browse files
authored
Merge branch 'develop' into 21658-avatars-blinking
2 parents f87590c + bc9b0f8 commit 7764e2c

File tree

53 files changed

+486
-223
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+486
-223
lines changed

doc/debugging.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ This one is straightforward, just evaluate a navigation dispatch form from anywh
150150
151151
#### REPL-ing a component
152152

153-
This is also straighforward, but there are some small differences. Just like above, we only have to evaluate a dispatch form, as follows:
153+
This is also straightforward, but there are some small differences. Just like above, we only have to evaluate a dispatch form, as follows:
154154

155155
```cljs
156156
;; example debugging a quo component, although it could be any other component e.g. from the `status-im2` ns.

logs/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ These log files are uploaded to Jenkins as CI job artifacts on failure using `ar
2626
* `set_xcode_version.log` - Output from `node_modules/react-native/scripts/react-native-xcode.sh`.
2727
- Created by redirecting output of `shellScript` in `ios/StatusIm.xcodeproj/project.pbxproj` for "Run Script" build Phase.
2828
* `Status PR-StatusImPR.log - Created by [Fastlane Gym](https://docs.fastlane.tools/actions/gym/).
29-
- Configred via [`Fastfile`](../Fastfile) using `buildlog_path` argument for `build_ios_app`.
29+
- Configured via [`Fastfile`](../Fastfile) using `buildlog_path` argument for `build_ios_app`.
5.86 KB
Loading
10.6 KB
Loading
113 KB
Loading
215 KB
Loading
542 KB
Loading
1 MB
Loading

src/quo/components/text_combinations/page_top/view.cljs

+3-3
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@
7979
[rn/view {:style style/community-logo-ring}]])
8080

8181
(defn- description-container
82-
[{:keys [description description-text collection-text community-text
83-
collection-image community-image blur?]
82+
[{:keys [description description-text collection-text community-text blur?
83+
collection-image community-image description-accessibility-label]
8484
context-tag-props :context-tag
8585
summary-props :summary}]
86-
[rn/view
86+
[rn/view {:accessibility-label description-accessibility-label}
8787
(cond
8888
(and (= description :text) (not (string/blank? description-text)))
8989
[text/text

src/status_im/common/resources.cljs

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
(def ui
44
{:add-new-contact (js/require "../resources/images/ui2/add-contact.png")
55
:biometrics (js/require "../resources/images/ui2/biometrics.png")
6+
:usage-data (js/require "../resources/images/ui2/usage-data.png")
7+
:login-syncing (js/require "../resources/images/ui2/login-syncing.png")
68
:chat-privately-with-friends (js/require "../resources/images/ui2/chat-privately-with-friends.png")
79
:desktop-how-to-pair-sign-in (js/require "../resources/images/ui2/desktop-how-to-pair-sign-in.png")
810
:desktop-how-to-pair-logged-in (js/require

src/status_im/common/standard_authentication/events.cljs

+40-29
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,44 @@
1010
[utils.re-frame :as rf]
1111
[utils.security.core :as security]))
1212

13-
(rf/reg-fx :effects.keycard/call-on-auth-success
14-
(fn [on-auth-success]
15-
(when on-auth-success (on-auth-success ""))))
13+
(defn- handle-password-success
14+
[has-partially-operable-accounts? on-auth-success password]
15+
(let [sha3-pwd (security/hash-masked-password password)
16+
on-auth-success-callback #(on-auth-success sha3-pwd)]
17+
(rf/dispatch [:standard-auth/set-success true])
18+
(rf/dispatch [:standard-auth/reset-login-password])
19+
(if has-partially-operable-accounts?
20+
(rf/dispatch [:wallet/make-partially-operable-accounts-fully-operable
21+
{:password sha3-pwd
22+
:on-success on-auth-success-callback
23+
:on-error on-auth-success-callback}])
24+
(on-auth-success-callback))))
1625

1726
(defn authorize
18-
[{:keys [db]} [{:keys [on-auth-success keycard-supported?] :as args}]]
19-
(let [key-uid (get-in db [:profile/profile :key-uid])
20-
keycard? (get-in db [:profile/profile :keycard-pairing])]
27+
[{:keys [db]} [{:keys [on-auth-success] :as args}]]
28+
(let [key-uid (get-in db [:profile/profile :key-uid])
29+
keycard-profile? (get-in db [:profile/profile :keycard-pairing])]
2130
{:fx
22-
[(if keycard?
23-
(if keycard-supported?
24-
[:effects.keycard/call-on-auth-success on-auth-success]
25-
[:effects.utils/show-popup
26-
{:title "This feature is not supported yet "
27-
:content
28-
"Keycard support is limited to logging in
29-
and signing the sending transaction.
30-
Use Status Desktop to access all functions."}])
31+
[(if keycard-profile?
32+
[:dispatch
33+
[:standard-auth/authorize-with-keycard
34+
{:on-complete
35+
(fn [pin]
36+
(rf/dispatch
37+
[:keycard/connect
38+
{:key-uid key-uid
39+
:on-success
40+
(fn []
41+
(rf/dispatch
42+
[:keycard/get-keys
43+
{:pin pin
44+
:on-success (fn [{:keys [encryption-public-key]}]
45+
(rf/dispatch [:keycard/disconnect])
46+
(handle-password-success false
47+
on-auth-success
48+
encryption-public-key))
49+
:on-failure #(rf/dispatch [:keycard/on-action-with-pin-error
50+
%])}]))}]))}]]
3151
[:effects.biometric/check-if-available
3252
{:key-uid key-uid
3353
:on-success #(rf/dispatch [:standard-auth/authorize-with-biometric args])
@@ -89,21 +109,12 @@
89109
(defn- bottom-sheet-password-view
90110
[{:keys [on-press-biometric on-auth-success auth-button-icon-left auth-button-label]}]
91111
(fn []
92-
(let [has-partially-operable-accounts? (rf/sub [:wallet/has-partially-operable-accounts?])
93-
handle-password-success
94-
(fn [password]
95-
(let [sha3-pwd (security/hash-masked-password password)
96-
on-auth-success-callback #(on-auth-success sha3-pwd)]
97-
(rf/dispatch [:standard-auth/set-success true])
98-
(rf/dispatch [:standard-auth/reset-login-password])
99-
(if has-partially-operable-accounts?
100-
(rf/dispatch [:wallet/make-partially-operable-accounts-fully-operable
101-
{:password sha3-pwd
102-
:on-success on-auth-success-callback
103-
:on-error on-auth-success-callback}])
104-
(on-auth-success-callback))))]
112+
(let [has-partially-operable-accounts? (rf/sub [:wallet/has-partially-operable-accounts?])]
105113
[enter-password/view
106-
{:on-enter-password handle-password-success
114+
{:on-enter-password #(handle-password-success
115+
has-partially-operable-accounts?
116+
on-auth-success
117+
%)
107118
:on-press-biometrics on-press-biometric
108119
:button-icon-left auth-button-icon-left
109120
:button-label auth-button-label}])))

src/status_im/common/standard_authentication/standard_auth/slide_button/view.cljs

+18-19
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,25 @@
99

1010
(defn view
1111
[{:keys [track-text customization-color auth-button-label on-auth-success on-auth-fail
12-
auth-button-icon-left size blur? container-style disabled? dependencies keycard-supported?]
12+
auth-button-icon-left size blur? container-style disabled? dependencies on-complete]
1313
:or {container-style {:flex 1}}}]
14-
(let [theme (quo.theme/use-theme)
15-
auth-method (rf/sub [:auth-method])
16-
biometric-auth? (= auth-method constants/auth-method-biometric)
17-
on-complete (rn/use-callback
18-
(fn [reset-slider-fn]
19-
(js/setTimeout #(reset-slider-fn false) 500)
20-
(rf/dispatch
21-
[:standard-auth/authorize
22-
{:auth-button-icon-left auth-button-icon-left
23-
:theme theme
24-
:blur? blur?
25-
:keycard-supported? keycard-supported?
26-
:biometric-auth? biometric-auth?
27-
:on-auth-success on-auth-success
28-
:on-auth-fail on-auth-fail
29-
:auth-button-label auth-button-label}]))
30-
(vec (conj dependencies on-auth-success on-auth-fail)))
31-
biometric-type (rf/sub [:biometrics/supported-type])]
14+
(let [theme (quo.theme/use-theme)
15+
auth-method (rf/sub [:auth-method])
16+
biometric-auth? (= auth-method constants/auth-method-biometric)
17+
on-complete-callback (rn/use-callback
18+
(fn [reset-slider-fn]
19+
(js/setTimeout #(reset-slider-fn false) 500)
20+
(rf/dispatch [:standard-auth/authorize
21+
{:auth-button-icon-left auth-button-icon-left
22+
:theme theme
23+
:blur? blur?
24+
:biometric-auth? biometric-auth?
25+
:on-auth-success on-auth-success
26+
:on-auth-fail on-auth-fail
27+
:auth-button-label auth-button-label}]))
28+
(vec (conj dependencies on-auth-success on-auth-fail)))
29+
on-complete (or on-complete on-complete-callback)
30+
biometric-type (rf/sub [:biometrics/supported-type])]
3231
[quo/slide-button
3332
{:container-style container-style
3433
:size size

src/status_im/constants.cljs

+1
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@
334334
(def ^:const privacy-policy-link "https://status.im/privacy-policy/")
335335
(def ^:const terms-of-service-link "https://status.im/terms-of-use")
336336
(def ^:const create-account-link "https://status.app/help/wallet/create-wallet-accounts")
337+
(def ^:const mobile-upvote-link "https://status-mobile.featureupvote.com")
337338

338339
(def ^:const visibility-status-unknown 0)
339340
(def ^:const visibility-status-automatic 1)

src/status_im/contexts/chat/messenger/messages/contact_requests/bottom_drawer/view.cljs

+24-19
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,35 @@
1111
[{:keys [contact-id]}]
1212
(let [{:keys [contact-request-state
1313
community-id
14-
chat-name]} (rf/sub [:chats/current-chat-chat-view])
15-
chat-type (rf/sub [:chats/chat-type])
16-
[primary-name _] (if (= chat-type :public-chat)
17-
[(str "#" chat-name) ""]
18-
(rf/sub [:contacts/contact-two-names-by-identity contact-id]))
19-
community-chat? (= chat-type :community-chat)
20-
joined (when community-chat?
21-
(rf/sub [:communities/community-joined community-id]))
22-
pending? (when community-chat?
23-
(rf/sub [:communities/my-pending-request-to-join community-id]))
24-
contact-request-send? (or (not contact-request-state)
25-
(= contact-request-state
26-
constants/contact-request-state-none))
27-
contact-request-received? (= contact-request-state
28-
constants/contact-request-state-received)
29-
contact-request-pending? (= contact-request-state
30-
constants/contact-request-state-sent)]
14+
chat-name]} (rf/sub [:chats/current-chat-chat-view])
15+
chat-type (rf/sub [:chats/chat-type])
16+
[primary-name _] (if (= chat-type :public-chat)
17+
[(str "#" chat-name) ""]
18+
(rf/sub [:contacts/contact-two-names-by-identity contact-id]))
19+
community-chat? (= chat-type :community-chat)
20+
joined (when community-chat?
21+
(rf/sub [:communities/community-joined community-id]))
22+
pending? (when community-chat?
23+
(rf/sub [:communities/my-pending-request-to-join community-id]))
24+
contact-request-send? (or (not contact-request-state)
25+
(= contact-request-state
26+
constants/contact-request-state-none))
27+
contact-request-received? (= contact-request-state
28+
constants/contact-request-state-received)
29+
contact-request-pending? (= contact-request-state
30+
constants/contact-request-state-sent)
31+
keycard? (rf/sub [:keycard/keycard-profile?])
32+
keycard-feature-unavailable (rn/use-callback
33+
#(rf/dispatch [:keycard/feature-unavailable-show]))]
3134
[rn/view {:style style/container}
3235
[quo/permission-context
3336
{:blur? true
3437
:on-press (cond
3538
(and community-chat? (not pending?) (not joined))
36-
#(rf/dispatch [:open-modal :community-account-selection-sheet
37-
{:community-id community-id}])
39+
(if keycard?
40+
keycard-feature-unavailable
41+
#(rf/dispatch [:open-modal :community-account-selection-sheet
42+
{:community-id community-id}]))
3843

3944
(not community-chat?)
4045
#(rf/dispatch [:chat.ui/show-profile contact-id]))

src/status_im/contexts/communities/actions/request_to_join/view.cljs

+7-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@
2727
(fn []
2828
(let [theme (quo.theme/use-theme)
2929
{:keys [id]} (rf/sub [:get-screen-params])
30-
{:keys [color name images]} (rf/sub [:communities/community id])]
30+
{:keys [color name images]} (rf/sub [:communities/community id])
31+
keycard? (rf/sub [:keycard/keycard-profile?])
32+
keycard-feature-unavailable (rn/use-callback
33+
#(rf/dispatch [:keycard/feature-unavailable-show]))]
3134
[rn/safe-area-view {:flex 1}
3235
[gesture/scroll-view {:style style/container}
3336
[rn/view style/page-container
@@ -59,7 +62,9 @@
5962
(i18n/label :t/cancel)]
6063
[quo/button
6164
{:accessibility-label :join-community-button
62-
:on-press #(join-community-and-navigate-back id)
65+
:on-press (if keycard?
66+
keycard-feature-unavailable
67+
#(join-community-and-navigate-back id))
6368
:container-style {:flex 1}
6469
:inner-style {:background-color (colors/resolve-color color theme)}}
6570
(i18n/label :t/request-to-join)]]

src/status_im/contexts/communities/overview/view.cljs

+30-22
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,14 @@
106106
[quo/text (i18n/label :t/network-not-supported)])
107107

108108
(defn- request-access-button
109-
[id color]
109+
[id color keycard? keycard-feature-unavailable]
110110
[quo/button
111-
{:on-press (if config/community-accounts-selection-enabled?
112-
#(rf/dispatch [:open-modal :community-account-selection-sheet
113-
{:community-id id}])
114-
#(rf/dispatch [:open-modal :community-requests-to-join {:id id}]))
111+
{:on-press (if keycard?
112+
keycard-feature-unavailable
113+
(if config/community-accounts-selection-enabled?
114+
#(rf/dispatch [:open-modal :community-account-selection-sheet
115+
{:community-id id}])
116+
#(rf/dispatch [:open-modal :community-requests-to-join {:id id}])))
115117
:accessibility-label :show-request-to-join-screen-button
116118
:customization-color color
117119
:container-style {:margin-bottom 12}
@@ -126,35 +128,41 @@
126128

127129
(defn- token-requirements
128130
[{:keys [id color role-permissions?]}]
129-
(let [{:keys [can-request-access? no-member-permission? networks-not-supported?
130-
highest-permission-role
131-
tokens]} (rf/sub [:community/token-gated-overview id])
132-
highest-role-text (i18n/label
133-
(communities.utils/role->translation-key highest-permission-role :t/member))
134-
on-press (rn/use-callback
135-
(fn []
136-
(if config/community-accounts-selection-enabled?
137-
(rf/dispatch [:open-modal :community-account-selection-sheet
138-
{:community-id id}])
139-
(rf/dispatch [:open-modal :community-requests-to-join
140-
{:id id}])))
141-
[id])
142-
on-press-info #(rf/dispatch
143-
[:show-bottom-sheet {:content token-gated-communities-info}])]
131+
(let
132+
[{:keys [can-request-access? no-member-permission? networks-not-supported?
133+
highest-permission-role
134+
tokens]} (rf/sub [:community/token-gated-overview id])
135+
highest-role-text (i18n/label
136+
(communities.utils/role->translation-key highest-permission-role
137+
:t/member))
138+
on-press (rn/use-callback
139+
(fn []
140+
(if config/community-accounts-selection-enabled?
141+
(rf/dispatch [:open-modal :community-account-selection-sheet
142+
{:community-id id}])
143+
(rf/dispatch [:open-modal :community-requests-to-join
144+
{:id id}])))
145+
[id])
146+
on-press-info #(rf/dispatch
147+
[:show-bottom-sheet {:content token-gated-communities-info}])
148+
keycard? (rf/sub [:keycard/keycard-profile?])
149+
keycard-feature-unavailable (rn/use-callback
150+
#(rf/dispatch [:keycard/feature-unavailable-show]))]
151+
144152
(cond
145153
networks-not-supported?
146154
[network-not-supported]
147155

148156
(or (not role-permissions?) no-member-permission?)
149-
[request-access-button id color]
157+
[request-access-button id color keycard? keycard-feature-unavailable]
150158

151159
:else
152160
[quo/community-token-gating
153161
{:role highest-role-text
154162
:tokens tokens
155163
:community-color color
156164
:satisfied? can-request-access?
157-
:on-press on-press
165+
:on-press (if keycard? keycard-feature-unavailable on-press)
158166
:on-press-info on-press-info}])))
159167

160168
(defn- join-community

0 commit comments

Comments
 (0)