Skip to content

Commit 4a045c1

Browse files
authored
Merge branch 'develop' into cl-19226-remove-not-implemented-box
2 parents 2aab702 + 2295b01 commit 4a045c1

File tree

14 files changed

+83
-46
lines changed

14 files changed

+83
-46
lines changed

src/legacy/status_im/subs/root.cljs

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
(reg-root-key-sub :peers-count :peers-count)
2323
(reg-root-key-sub :peers-summary :peers-summary)
2424
(reg-root-key-sub :web3-node-version :web3-node-version)
25-
(reg-root-key-sub :alert-banners :alert-banners)
2625

2726
;;keycard
2827
(reg-root-key-sub :keycard :keycard)

src/status_im/common/bottom_sheet/view.cljs

+25-15
Original file line numberDiff line numberDiff line change
@@ -66,26 +66,35 @@
6666
gradient-cover? customization-color hide-handle? blur-radius]
6767
:or {border-radius 12}}]
6868
(let [theme (quo.theme/use-theme-value)
69-
sheet-height (rn/use-ref-atom 0)
70-
item-height (rn/use-ref-atom 0)
71-
set-sheet-height (rn/use-callback #(reset! sheet-height (get-layout-height %)))
72-
set-item-height (rn/use-callback #(reset! item-height (get-layout-height %)))
69+
[sheet-height set-sheet-height] (rn/use-state 0)
70+
handle-sheet-height (rn/use-callback (fn [e]
71+
(when (= sheet-height 0)
72+
(set-sheet-height
73+
(get-layout-height e))))
74+
[sheet-height])
75+
[item-height set-item-height] (rn/use-state 0)
76+
handle-item-height (rn/use-callback (fn [e]
77+
(when (= item-height 0)
78+
(set-item-height
79+
(get-layout-height e))))
80+
[item-height])
7381
{window-height :height} (rn/get-window)
7482
bg-opacity (reanimated/use-shared-value 0)
7583
translate-y (reanimated/use-shared-value window-height)
76-
sheet-gesture (get-sheet-gesture translate-y
77-
bg-opacity
78-
window-height
79-
on-close)
80-
selected-item-smaller-than-sheet? (< @item-height
84+
sheet-gesture (rn/use-memo #(get-sheet-gesture translate-y
85+
bg-opacity
86+
window-height
87+
on-close)
88+
[window-height on-close])
89+
selected-item-smaller-than-sheet? (< item-height
8190
(- window-height
82-
@sheet-height
91+
sheet-height
8392
(:top insets)
8493
(:bottom insets)
8594
bottom-margin))
86-
top (- window-height (:top insets) @sheet-height)
95+
top (- window-height (:top insets) sheet-height)
8796
bottom (if selected-item-smaller-than-sheet?
88-
(+ @sheet-height bottom-margin)
97+
(+ sheet-height bottom-margin)
8998
(:bottom insets))
9099
sheet-max-height (- window-height (:top insets))
91100
content-padding-bottom (or padding-bottom-override
@@ -123,11 +132,12 @@
123132
:overlay-color :transparent}])
124133
(when selected-item
125134
[rn/view
126-
{:on-layout set-item-height
127-
:style (style/selected-item theme top bottom selected-item-smaller-than-sheet? border-radius)}
135+
{:on-layout handle-item-height
136+
:style
137+
(style/selected-item theme top bottom selected-item-smaller-than-sheet? border-radius)}
128138
[selected-item]])
129139
[rn/view
130-
{:on-layout set-sheet-height
140+
{:on-layout handle-sheet-height
131141
:style (style/sheet-content {:theme theme
132142
:shell? shell?
133143
:padding-bottom content-padding-bottom})}

src/status_im/contexts/chat/group_details/style.cljs

+3
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,6 @@
4040
:background-color (colors/theme-colors colors/white colors/neutral-95-opa-70)
4141
:flex-direction :row})
4242

43+
(def floating-shell-button
44+
{:position :absolute
45+
:bottom 21})

src/status_im/contexts/chat/group_details/view.cljs

+10-2
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@
113113
members (rf/sub [:contacts/group-members-sections chat-id])
114114
pinned-messages (rf/sub [:chats/pinned chat-id])
115115
current-pk (rf/sub [:multiaccount/public-key])
116+
profile-color (rf/sub [:profile/customization-color])
116117
admin? (get admins current-pk)]
117118
[:<>
118119
[quo/gradient-cover
@@ -127,7 +128,6 @@
127128
group])}])}]
128129
:icon-name :i/arrow-left
129130
:on-press #(rf/dispatch [:navigate-back])}]
130-
131131
[quo/page-top
132132
{:title chat-name
133133
:avatar {:customization-color color}}]
@@ -167,4 +167,12 @@
167167
:render-section-footer-fn contacts-section-footer
168168
:render-data {:chat-id chat-id
169169
:admin? admin?}
170-
:render-fn contact-item-render}]]))
170+
:render-fn contact-item-render}]
171+
[quo/floating-shell-button
172+
{:jump-to {:on-press (fn []
173+
(rf/dispatch [:navigate-back])
174+
(rf/dispatch [:shell/navigate-to-jump-to])
175+
)
176+
:customization-color profile-color
177+
:label (i18n/label :t/jump-to)}}
178+
style/floating-shell-button]]))

src/status_im/contexts/chat/messenger/composer/utils.cljs

+2-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,8 @@
200200
[]
201201
(let [chat-input (rf/sub [:chats/current-chat-input])]
202202
{:images (seq (rf/sub [:chats/sending-image]))
203-
:link-previews? (rf/sub [:chats/link-previews?])
203+
:link-previews? (or (rf/sub [:chats/link-previews?])
204+
(rf/sub [:chats/status-link-previews?]))
204205
:audio (rf/sub [:chats/sending-audio])
205206
:reply (rf/sub [:chats/reply-message])
206207
:edit (rf/sub [:chats/edit-message])

src/status_im/contexts/chat/messenger/messages/content/style.cljs

+4
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,7 @@
3131
:opacity (if (and outgoing (= outgoing-status :sending))
3232
0.5
3333
1)})
34+
35+
(def drawer-message-container
36+
{:padding-top 4
37+
:padding-bottom 8})

src/status_im/contexts/chat/messenger/messages/content/view.cljs

+12-12
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@
7979

8080
(defn system-message-contact-request
8181
[{:keys [chat-id timestamp-str from]} type]
82-
(let [[primary-name _] (rf/sub [:contacts/contact-two-names-by-identity chat-id])
83-
contact (rf/sub [:contacts/contact-by-address chat-id])
84-
photo-path (when (seq (:images contact)) (rf/sub [:chats/photo-path chat-id]))
85-
customization-color (rf/sub [:profile/customization-color])
86-
{:keys [public-key]} (rf/sub [:profile/profile])]
82+
(let [[primary-name _] (rf/sub [:contacts/contact-two-names-by-identity chat-id])
83+
contact (rf/sub [:contacts/contact-by-address chat-id])
84+
photo-path (when (seq (:images contact)) (rf/sub [:chats/photo-path chat-id]))
85+
customization-color (rf/sub [:profile/customization-color])
86+
public-key (rf/sub [:profile/public-key])]
8787
[quo/system-message
8888
{:type type
8989
:timestamp timestamp-str
@@ -283,14 +283,14 @@
283283
(fn []
284284
[rn/view
285285
{:pointer-events :none
286-
:padding-top 4}
286+
:style style/drawer-message-container}
287287
[user-message-content
288-
{:message-data message-data
289-
:context context
290-
:keyboard-shown? keyboard-shown?
291-
:show-reactions? true
292-
:show-user-info? true
293-
:preview? true}]]))}]))
288+
{:message-data message-data
289+
:context context
290+
:keyboard-shown? keyboard-shown?
291+
:in-reaction-and-action-menu? true
292+
:show-user-info? false
293+
:show-reactions? true}]]))}]))
294294

295295
(defn system-message?
296296
[content-type]

src/status_im/contexts/communities/events.cljs

+4-4
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,10 @@
235235
[:cofx :schema.re-frame/cofx]
236236
[:args
237237
[:schema
238-
[:catn
239-
[:map
240-
[:community-id [:? :string]]
241-
[:update-last-opened-at? [:? :boolean]]]]]]]
238+
[:vector
239+
[:map {:closed true}
240+
[:community-id {:optional true} :string]
241+
[:update-last-opened-at? {:optional true} [:maybe :boolean]]]]]]]
242242
[:maybe
243243
[:map
244244
[:db map?]

src/status_im/contexts/communities/events_test.cljs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
(testing "do nothing"
2525
(is (match?
2626
nil
27-
(events/fetch-community {} []))))))
27+
(events/fetch-community {} [{}]))))))
2828

2929
(deftest community-failed-to-fetch
3030
(testing "given a community id"

src/status_im/contexts/profile/settings/events.cljs

-5
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@
3232
:params [(or preferred-name display-name name) ""]
3333
:on-success #(log/debug "sent contact update")}]]))]}))
3434

35-
(rf/reg-event-fx :profile.settings/change-preview-privacy
36-
(fn [{:keys [db]}]
37-
(let [private? (get-in db [:profile/profile :preview-privacy?])]
38-
{:fx [[:profile.settings/blank-preview-flag-changed private?]]})))
39-
4035
(rf/reg-event-fx :profile.settings/change-webview-debug
4136
(fn [_ [value]]
4237
(let [value' (boolean value)]

src/status_im/contexts/profile/settings/view.cljs

+1-2
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@
7070
:on-scroll #(scroll-handler % scroll-y)
7171
:bounces false}]
7272
[quo/floating-shell-button
73-
{:key :shell
74-
:jump-to
73+
{:jump-to
7574
{:on-press (fn []
7675
(rf/dispatch [:navigate-back])
7776
(debounce/throttle-and-dispatch [:shell/navigate-to-jump-to] 500))

src/status_im/subs/chats.cljs

+7-3
Original file line numberDiff line numberDiff line change
@@ -433,10 +433,14 @@
433433
(re-frame/reg-sub
434434
:chats/link-previews?
435435
:<- [:chats/link-previews-unfurled]
436+
(fn [previews]
437+
(boolean (seq previews))))
438+
439+
(re-frame/reg-sub
440+
:chats/status-link-previews?
436441
:<- [:chats/status-link-previews-unfurled]
437-
(fn [previews status-link-previews]
438-
(boolean (or (seq status-link-previews)
439-
(seq previews)))))
442+
(fn [status-link-previews]
443+
(boolean (seq status-link-previews))))
440444

441445
(re-frame/reg-sub
442446
:chat/check-channel-muted?

src/status_im/subs/profile.cljs

+8
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,20 @@
8282
:override-ring? override-ring?
8383
:font-file font-file}))}))))
8484

85+
;; DEPRECATED
86+
;; use `:profile/public-key` instead
8587
(re-frame/reg-sub
8688
:multiaccount/public-key
8789
:<- [:profile/profile]
8890
(fn [{:keys [public-key]}]
8991
public-key))
9092

93+
(re-frame/reg-sub
94+
:profile/public-key
95+
:<- [:profile/profile]
96+
(fn [{:keys [public-key]}]
97+
public-key))
98+
9199
(re-frame/reg-sub
92100
:profile/webview-debug
93101
:<- [:profile/profile]

src/status_im/subs/profile_test.cljs

+6
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,9 @@
112112
(testing "returns the symbol of the user's selected currency"
113113
(swap! rf-db/app-db #(assoc % :profile/profile sample-profile))
114114
(is (match? "$" (rf/sub [sub-name])))))
115+
116+
(h/deftest-sub :profile/public-key
117+
[sub-name]
118+
(testing "returns the user's public key"
119+
(swap! rf-db/app-db #(assoc % :profile/profile sample-profile))
120+
(is (match? (:public-key sample-profile) (rf/sub [sub-name])))))

0 commit comments

Comments
 (0)