Compare commits

...
Author SHA1 Message Date
Omar Basem fc5e7f5534 formatting 2022-12-27 12:38:50 +04:00
Omar Basem 66c1de7dea reformatting 2022-12-24 07:37:35 +04:00
Omar Basem 68080de402 refactor 2022-12-23 19:17:17 +04:00
Omar Basem 99e163f881 refactor 2022-12-23 18:50:26 +04:00
Omar Basem 0469be8fad reverting some files 2022-12-23 18:42:20 +04:00
Omar Basem ddab358b46 revert 2022-12-23 18:39:18 +04:00
Omar Basem 0aca296547 rebase 2022-12-23 18:39:17 +04:00
Omar Basem f629e9fca4 rebase 2022-12-23 18:39:17 +04:00
Omar Basem fcf8c17df5 qa fixes 2022-12-23 18:39:17 +04:00
Omar Basem 0abd32fd6f rebase 2022-12-23 18:39:15 +04:00
Omar Basem 7f27b8237a refactor 2022-12-23 18:39:13 +04:00
Omar Basem cb37a7c6cc refactor 2022-12-23 18:39:13 +04:00
Omar Basem 96e6f1f905 lint 2022-12-23 18:39:12 +04:00
Omar Basem 5d74999e5d status-go version
https://github.com/status-im/status-go/compare/684e9654...b4bdfd3d
2022-12-23 18:39:12 +04:00
Omar Basem 11c69b6fbc lint 2022-12-23 18:39:12 +04:00
Omar Basem ddae301c63 qa fixes
https://github.com/status-im/status-go/compare/684e9654...b4bdfd3d
2022-12-23 18:39:09 +04:00
Omar Basem 82cd2dc862 rebase 2022-12-23 18:39:08 +04:00
Omar Basem 503977843e refactor 2022-12-23 18:39:07 +04:00
Omar Basem e0d882d5f7 qa fixes 2022-12-23 18:39:07 +04:00
Omar Basem b86dfdb8b7 lint
https://github.com/status-im/status-go/compare/684e9654...b4bdfd3d
2022-12-23 18:39:07 +04:00
Omar Basem aaf17339ac refactor
https://github.com/status-im/status-go/compare/684e9654...b4bdfd3d
2022-12-23 18:39:07 +04:00
Omar Basem 0b796dd525 refactor 2022-12-23 18:39:06 +04:00
Omar Basem 161784ac12 refactor 2022-12-23 18:39:06 +04:00
Omar Basem 37706d92df tests 2022-12-23 18:39:06 +04:00
Omar Basem 440c5a1f6e tests 2022-12-23 18:39:05 +04:00
Omar Basem 0ee1ff5d05 refactor 2022-12-23 18:39:05 +04:00
Omar Basem ca992c6cd8 update status-go version
https://github.com/status-im/status-go/compare/684e9654...b4bdfd3d
2022-12-23 18:39:05 +04:00
Omar Basem 6264533e90 refactor 2022-12-23 18:39:05 +04:00
Omar Basem 46cd151cfd refactor
https://github.com/status-im/status-go/compare/684e9654...b4bdfd3d
2022-12-23 18:39:04 +04:00
Omar Basem 2e7934fba7 refactor
https://github.com/status-im/status-go/compare/684e9654...b4bdfd3d
2022-12-23 18:39:04 +04:00
Omar Basem e94996d4c2 refactor
https://github.com/status-im/status-go/compare/684e9654...b4bdfd3d
2022-12-23 18:39:04 +04:00
Omar Basem c017771051 refactor 2022-12-23 18:39:03 +04:00
Omar Basem ce266d27fc lint 2022-12-23 18:39:03 +04:00
Omar Basem 632546f595 group details screen 3 2022-12-23 18:39:01 +04:00
48 changed files with 689 additions and 565 deletions
@@ -24,7 +24,9 @@
:align-items :center
:justify-content :center
:border-radius (/ container-size 2)
:background-color (colors/custom-color-by-theme color 50 60)}
;:background-color (colors/custom-color-by-theme color 50 60) ; TODO: this is temporary only.
;Issue: https://github.com/status-im/status-mobile/issues/14566
:background-color color}
[icon/icon :i/group
{:size icon-size
:color colors/white-opa-70}]])))
@@ -5,24 +5,24 @@
(defn render-button
([options label]
(rtl/render (reagent/as-element [button/button options label]))))
(rtl/render (reagent/as-element [button/button options label]))))
(js/global.test "default render of button component"
(fn []
(render-button {:accessibility-label "test-button"} "")
(-> (js/expect (rtl/screen.getByLabelText "test-button"))
(-> (js/expect (rtl/screen.getByLabelText "test-button"))
(.toBeTruthy))))
(js/global.test "button renders with a label"
(fn []
(render-button {} "test-label")
(-> (js/expect (rtl/screen.getByText "test-label"))
(-> (js/expect (rtl/screen.getByText "test-label"))
(.toBeTruthy))))
(js/global.test "button on-press works"
(let [event (js/jest.fn)]
(fn []
(render-button {:on-press event} "test-label")
(rtl/fireEvent.press (rtl/screen.getByText "test-label"))
(-> (js/expect event)
(rtl/fireEvent.press (rtl/screen.getByText "test-label"))
(-> (js/expect event)
(.toHaveBeenCalledTimes 1)))))
@@ -7,39 +7,39 @@
([]
(render-divider-label {}))
([opts]
(rtl/render (reagent/as-element [divider-label/divider-label opts]))))
(rtl/render (reagent/as-element [divider-label/divider-label opts]))))
(js/global.test "default render of divider-label component"
(fn []
(render-divider-label)
(-> (js/expect (rtl/screen.getByLabelText "divider-label"))
(-> (js/expect (rtl/screen.getByLabelText "divider-label"))
(.toBeTruthy))))
(js/global.test "render divider-label component with a label"
(fn []
(render-divider-label {:label :hello})
(-> (js/expect (rtl/screen.getByText "hello"))
(-> (js/expect (rtl/screen.getByText "hello"))
(.toBeTruthy))))
(js/global.test "render divider-label component with a counter-value"
(fn []
(render-divider-label {:label :hello
(render-divider-label {:label :hello
:counter-value "1"})
(-> (js/expect (rtl/screen.getByText "1"))
(-> (js/expect (rtl/screen.getByText "1"))
(.toBeTruthy))))
(js/global.test "divider-label chevron icon renders to the left when set"
(fn []
(render-divider-label {:label :hello
:counter-value "1"
(render-divider-label {:label :hello
:counter-value "1"
:chevron-position :left})
(-> (js/expect (rtl/screen.getByTestId "divider-label-icon-left"))
(-> (js/expect (rtl/screen.getByTestId "divider-label-icon-left"))
(.toBeTruthy))))
(js/global.test "divider-label chevron icon renders to the right when set"
(fn []
(render-divider-label {:label :hello
:counter-value "1"
(render-divider-label {:label :hello
:counter-value "1"
:chevron-position :right})
(-> (js/expect (rtl/screen.getByTestId "divider-label-icon-right"))
(-> (js/expect (rtl/screen.getByTestId "divider-label-icon-right"))
(.toBeTruthy))))
+13 -10
View File
@@ -4,15 +4,18 @@
[quo2.foundations.colors :as colors]
[react-native.core :as rn]))
(defn date [value]
[rn/view {:margin-vertical 8
:padding-right 20
:padding-left 60}
[text/text {:weight :medium
:accessibility-label :divider-date-text
:size :label
:style {:color (colors/theme-colors colors/neutral-50 colors/neutral-40)
:text-transform :capitalize
:margin-bottom 4}}
(defn date
[value]
[rn/view
{:margin-vertical 8
:padding-right 20
:padding-left 60}
[text/text
{:weight :medium
:accessibility-label :divider-date-text
:size :label
:style {:color (colors/theme-colors colors/neutral-50 colors/neutral-40)
:text-transform :capitalize
:margin-bottom 4}}
value]
[separator/separator]])
+19 -15
View File
@@ -15,22 +15,26 @@
increase-padding-top? -> boolean
blur? -> boolean"
[{:keys [label chevron-position counter-value increase-padding-top? blur?]}]
(let [dark? (colors/dark?)
border-and-counter-bg-color (if dark? (if blur? colors/white-opa-5 colors/neutral-70) colors/neutral-10)
padding-top (if increase-padding-top? 16 8)
text-and-icon-color (if dark? colors/neutral-40 colors/neutral-50)
counter-text-color (if dark? colors/white colors/neutral-100)]
[rn/view {:accessible true
:accessibility-label :divider-label
:style {:border-top-width 1
:border-top-color border-and-counter-bg-color
:padding-top padding-top
:padding-horizontal 16
:align-items :center
:flex-direction :row}}
(let [dark? (colors/dark?)
border-and-counter-bg-color (if dark?
(if blur? colors/white-opa-5 colors/neutral-70)
colors/neutral-10)
padding-top (if increase-padding-top? 16 8)
text-and-icon-color (if dark? colors/neutral-40 colors/neutral-50)
counter-text-color (if dark? colors/white colors/neutral-100)]
[rn/view
{:accessible true
:accessibility-label :divider-label
:style {:border-top-width 1
:border-top-color border-and-counter-bg-color
:padding-top padding-top
:padding-horizontal 16
:align-items :center
:flex-direction :row}}
(when (= chevron-position :left)
[rn/view {:test-ID :divider-label-icon-left
:style {:margin-right 4}}
[rn/view
{:test-ID :divider-label-icon-left
:style {:margin-right 4}}
[icons/icon
:main-icons/chevron-down
{:color text-and-icon-color
@@ -5,10 +5,10 @@
(defn render-text
([options value]
(rtl/render (reagent/as-element [text/text options value]))))
(rtl/render (reagent/as-element [text/text options value]))))
(js/global.test "text renders with text"
(fn []
(render-text {} "hello")
(-> (js/expect (rtl/screen.getByText "hello"))
(-> (js/expect (rtl/screen.getByText "hello"))
(.toBeTruthy))))
@@ -93,8 +93,8 @@
:style style/middle-dot-chat-key}
middle-dot])
[text/text
{:monospace true
:size :paragraph-2
{:monospace true
:size :paragraph-2
:accessibility-label :message-timestamp
:style (style/time-text ens?)}
:style (style/time-text ens?)}
time-str]]))])
+9 -7
View File
@@ -27,12 +27,14 @@
{:on-press on-press
:accessibility-label accessibility-label
:style (style/reaction neutral?)}
[icons/icon emoji {:no-color true
:size 16}]
[text/text {:size :paragraph-2
:weight :semi-bold
:flex-direction :row
:align-items :center
:justify-content :center}
[icons/icon emoji
{:no-color true
:size 16}]
[text/text
{:size :paragraph-2
:weight :semi-bold
:flex-direction :row
:align-items :center
:justify-content :center}
(when (pos? numeric-value)
(str " " numeric-value))]]))
+11 -8
View File
@@ -9,20 +9,23 @@
:border-radius 8
:height 24})
(defn add-reaction []
(defn add-reaction
[]
(merge reaction-styling
{:padding-horizontal 9
:border-width 1
:border-color (colors/theme-colors colors/neutral-30 colors/neutral-70)}))
(defn reaction [neutral?]
(defn reaction
[neutral?]
(merge reaction-styling
(cond-> {:background-color (colors/theme-colors (if neutral?
colors/neutral-30
:transparent)
(if neutral?
colors/neutral-70
:transparent))}
(cond->
{:background-color (colors/theme-colors (if neutral?
colors/neutral-30
:transparent)
(if neutral?
colors/neutral-70
:transparent))}
(and (colors/dark?) (not neutral?))
(assoc :border-color colors/neutral-70
:border-width 1)
+5 -5
View File
@@ -67,13 +67,13 @@
icon-color (colors/theme-colors colors/neutral-50 colors/neutral-40)]
[base-tag (assoc-in params [:style :padding-left] 3)
[rn/image
{:style {:width 20
:border-radius 10
:background-color :white
:height 20}
{:style {:width 20
:border-radius 10
:background-color :white
:height 20}
:source photo}]
[rn/view
{:style {:align-items :center
{:style {:align-items :center
:flex-direction :row}}
[text/text text-params (str " " name)]
(when channel-name
+7 -8
View File
@@ -1,9 +1,8 @@
(ns quo2.core-spec
(:require
[quo2.components.banners.--tests--.banner-component-spec]
[quo2.components.buttons.--tests--.buttons-component-spec]
[quo2.components.counter.--tests--.counter-component-spec]
[quo2.components.dividers.--tests--.divider-label-component-spec]
[quo2.components.drawers.--tests--.action-drawers-component-spec]
[quo2.components.markdown.--tests--.text-component-spec]
[quo2.components.selectors.--tests--.selectors-component-spec]))
(:require [quo2.components.banners.--tests--.banner-component-spec]
[quo2.components.buttons.--tests--.buttons-component-spec]
[quo2.components.counter.--tests--.counter-component-spec]
[quo2.components.dividers.--tests--.divider-label-component-spec]
[quo2.components.drawers.--tests--.action-drawers-component-spec]
[quo2.components.markdown.--tests--.text-component-spec]
[quo2.components.selectors.--tests--.selectors-component-spec]))
+2 -2
View File
@@ -601,8 +601,8 @@
(get-in db [:chats/mentions chat-id :mentions])
new-text (or new-text text)]
(log/debug "[mentions] calculate suggestions"
"state"
state)
"state"
state)
(if-not (seq at-idxs)
{:db (-> db
(assoc-in [:chats/mention-suggestions chat-id] nil)
+32 -8
View File
@@ -39,7 +39,16 @@
{:json-rpc/call [{:method "wakuext_removeMemberFromGroupChat"
:params [nil chat-id member]
:js-response true
:on-success #(re-frame/dispatch [:chat-updated % do-not-navigate?])}]})
:on-success #(re-frame/dispatch [:chat-updated % true])}]})
(fx/defn remove-members
{:events [:group-chats.ui/remove-members-pressed]}
[{{:keys [current-chat-id] :group-chat/keys [deselected-members]} :db :as cofx}]
{:json-rpc/call [{:method "wakuext_removeMembersFromGroupChat"
:params [nil current-chat-id deselected-members]
:js-response true
:on-success #(re-frame/dispatch [:chat-updated % true])
:on-error #()}]})
(fx/defn join-chat
{:events [:group-chats.ui/join-pressed]}
@@ -79,11 +88,11 @@
(fx/defn add-members
"Add members to a group chat"
{:events [:group-chats.ui/add-members-pressed]}
[{{:keys [current-chat-id selected-participants]} :db :as cofx}]
[{{:keys [current-chat-id] :group-chat/keys [selected-participants]} :db :as cofx}]
{:json-rpc/call [{:method "wakuext_addMembersToGroupChat"
:params [nil current-chat-id selected-participants]
:js-response true
:on-success #(re-frame/dispatch [:chat-updated %])}]})
:on-success #(re-frame/dispatch [:chat-updated % true])}]})
(fx/defn add-members-from-invitation
"Add members to a group chat"
@@ -179,6 +188,16 @@
:type
(= constants/invitation-state-removed)))
(fx/defn deselect-member
{:events [:deselect-member]}
[{:keys [db]} id]
{:db (update db :group-chat/deselected-members conj id)})
(fx/defn undo-deselect-member
{:events [:undo-deselect-member]}
[{:keys [db]} id]
{:db (update db :group-chat/deselected-members disj id)})
(fx/defn deselect-contact
{:events [:deselect-contact]}
[{:keys [db]} id]
@@ -192,17 +211,22 @@
(fx/defn deselect-participant
{:events [:deselect-participant]}
[{:keys [db]} id]
{:db (update db :selected-participants disj id)})
{:db (update db :group-chat/selected-participants disj id)})
(fx/defn select-participant
{:events [:select-participant]}
[{:keys [db]} id]
{:db (update db :selected-participants conj id)})
{:db (update db :group-chat/selected-participants conj id)})
(fx/defn add-participants-toggle-list
{:events [:group/add-participants-toggle-list]}
(fx/defn clear-added-participants
{:events [:group/clear-added-participants]}
[{db :db}]
{:db (assoc db :selected-participants #{})})
{:db (assoc db :group-chat/selected-participants #{})})
(fx/defn clear-removed-members
{:events [:group/clear-removed-members]}
[{db :db}]
{:db (assoc db :group-chat/deselected-members #{})})
(fx/defn show-group-chat-profile
{:events [:show-group-chat-profile]}
+173 -166
View File
@@ -87,111 +87,114 @@
(rf-test/run-test-async
(rf/dispatch [:setup/app-started])
(rf-test/wait-for
;; use initialize-view because it has the longest avg. time and
;; is dispatched by initialize-multiaccounts (last non-view event)
[:setup/initialize-view]
(assert-app-initialized))))
;; use initialize-view because it has the longest avg. time and
;; is dispatched by initialize-multiaccounts (last non-view event)
[:setup/initialize-view]
(assert-app-initialized))))
(deftest create-account-test
(log/info "====== create-account-test ==================")
(rf-test/run-test-async
(initialize-app!) ; initialize app
(rf-test/wait-for
[:setup/initialize-view]
(generate-and-derive-addresses!) ; generate 5 new keys
(rf-test/wait-for
[:multiaccount-generate-and-derive-addresses-success] ; wait for the keys
(assert-multiaccount-loaded) ; assert keys are generated
(create-multiaccount!) ; create a multiaccount
(rf-test/wait-for ; wait for login
[::transport/messenger-started]
(assert-messenger-started)
(logout!)
(rf-test/wait-for [::logout/logout-method] ; we need to logout to make sure the node is not in an
; inconsistent state between tests
(assert-logout)))))))
[:setup/initialize-view]
(generate-and-derive-addresses!) ; generate 5 new keys
(rf-test/wait-for
[:multiaccount-generate-and-derive-addresses-success] ; wait for the keys
(assert-multiaccount-loaded) ; assert keys are generated
(create-multiaccount!) ; create a multiaccount
(rf-test/wait-for ; wait for login
[::transport/messenger-started]
(assert-messenger-started)
(logout!)
(rf-test/wait-for [::logout/logout-method] ; we need to logout to make sure the node is not in
; an
; inconsistent state between tests
(assert-logout)))))))
(deftest create-community-test
(log/info "====== create-community-test ==================")
(rf-test/run-test-async
(initialize-app!) ; initialize app
(rf-test/wait-for
[:setup/initialize-view]
(generate-and-derive-addresses!) ; generate 5 new keys
(rf-test/wait-for
[:multiaccount-generate-and-derive-addresses-success]
(assert-multiaccount-loaded) ; assert keys are generated
(create-multiaccount!) ; create a multiaccount
(rf-test/wait-for ; wait for login
[::transport/messenger-started]
(assert-messenger-started)
(rf/dispatch-sync [:status-im.communities.core/open-create-community])
(doseq [[k v] (dissoc community :membership)]
(rf/dispatch-sync [:status-im.communities.core/create-field k v]))
(rf/dispatch [:status-im.communities.core/create-confirmation-pressed])
(rf-test/wait-for
[:status-im.communities.core/community-created]
(assert-community-created)
(logout!)
(rf-test/wait-for [::logout/logout-method]
(assert-logout))))))))
[:setup/initialize-view]
(generate-and-derive-addresses!) ; generate 5 new keys
(rf-test/wait-for
[:multiaccount-generate-and-derive-addresses-success]
(assert-multiaccount-loaded) ; assert keys are generated
(create-multiaccount!) ; create a multiaccount
(rf-test/wait-for ; wait for login
[::transport/messenger-started]
(assert-messenger-started)
(rf/dispatch-sync [:status-im.communities.core/open-create-community])
(doseq [[k v] (dissoc community :membership)]
(rf/dispatch-sync [:status-im.communities.core/create-field k v]))
(rf/dispatch [:status-im.communities.core/create-confirmation-pressed])
(rf-test/wait-for
[:status-im.communities.core/community-created]
(assert-community-created)
(logout!)
(rf-test/wait-for [::logout/logout-method]
(assert-logout))))))))
(deftest create-wallet-account-test
(log/info "====== create-wallet-account-test ==================")
(rf-test/run-test-async
(initialize-app!)
(rf-test/wait-for
[:setup/initialize-view]
(generate-and-derive-addresses!) ; generate 5 new keys
(rf-test/wait-for
[:multiaccount-generate-and-derive-addresses-success]
(assert-multiaccount-loaded) ; assert keys are generated
(create-multiaccount!) ; create a multiaccount
(rf-test/wait-for ; wait for login
[::transport/messenger-started]
(assert-messenger-started)
(create-new-account!) ; create a new account
(rf-test/wait-for
[:wallet.accounts/account-stored]
(assert-new-account-created) ; assert account was created
(logout!)
(rf-test/wait-for [::logout/logout-method] ; we need to logout to make sure the node is not in an
; inconsistent state between tests
(assert-logout))))))))
[:setup/initialize-view]
(generate-and-derive-addresses!) ; generate 5 new keys
(rf-test/wait-for
[:multiaccount-generate-and-derive-addresses-success]
(assert-multiaccount-loaded) ; assert keys are generated
(create-multiaccount!) ; create a multiaccount
(rf-test/wait-for ; wait for login
[::transport/messenger-started]
(assert-messenger-started)
(create-new-account!) ; create a new account
(rf-test/wait-for
[:wallet.accounts/account-stored]
(assert-new-account-created) ; assert account was created
(logout!)
(rf-test/wait-for [::logout/logout-method] ; we need to logout to make sure the node is not in
; an
; inconsistent state between tests
(assert-logout))))))))
(deftest back-up-seed-phrase-test
(log/info "========= back-up-seed-phrase-test ==================")
(rf-test/run-test-async
(initialize-app!)
(rf-test/wait-for
[:setup/initialize-view]
(generate-and-derive-addresses!)
(rf-test/wait-for
[:multiaccount-generate-and-derive-addresses-success]
(assert-multiaccount-loaded)
(create-multiaccount!)
[:setup/initialize-view]
(generate-and-derive-addresses!)
(rf-test/wait-for
[::transport/messenger-started]
(assert-messenger-started)
(rf/dispatch-sync [:set-in [:my-profile/seed :step] :12-words]) ; display seed phrase to user
(rf/dispatch-sync [:my-profile/enter-two-random-words]) ; begin prompting user for seed words
(let [ma @(rf/subscribe [:multiaccount])
seed @(rf/subscribe [:my-profile/seed])
word1 (second (:first-word seed))
word2 (second (:second-word seed))]
(is (= 12 (count (string/split (:mnemonic ma) #" ")))) ; assert 12-word seed phrase
(rf/dispatch-sync [:set-in [:my-profile/seed :word] word1])
(rf/dispatch-sync [:my-profile/set-step :second-word])
(rf/dispatch-sync [:set-in [:my-profile/seed :word] word2])
;; TODO: refactor (defn next-handler) & (defn enter-word) to improve test coverage?
(rf/dispatch [:my-profile/finish])
(rf-test/wait-for
[:my-profile/finish-success]
(is (nil? @(rf/subscribe [:mnemonic]))) ; assert seed phrase has been removed
(logout!)
(rf-test/wait-for [::logout/logout-method] ; we need to logout to make sure the node is not in
; an inconsistent state between tests
(assert-logout)))))))))
[:multiaccount-generate-and-derive-addresses-success]
(assert-multiaccount-loaded)
(create-multiaccount!)
(rf-test/wait-for
[::transport/messenger-started]
(assert-messenger-started)
(rf/dispatch-sync [:set-in [:my-profile/seed :step] :12-words]) ; display seed phrase to user
(rf/dispatch-sync [:my-profile/enter-two-random-words]) ; begin prompting user for seed words
(let [ma @(rf/subscribe [:multiaccount])
seed @(rf/subscribe [:my-profile/seed])
word1 (second (:first-word seed))
word2 (second (:second-word seed))]
(is (= 12 (count (string/split (:mnemonic ma) #" ")))) ; assert 12-word seed phrase
(rf/dispatch-sync [:set-in [:my-profile/seed :word] word1])
(rf/dispatch-sync [:my-profile/set-step :second-word])
(rf/dispatch-sync [:set-in [:my-profile/seed :word] word2])
;; TODO: refactor (defn next-handler) & (defn enter-word) to improve test coverage?
(rf/dispatch [:my-profile/finish])
(rf-test/wait-for
[:my-profile/finish-success]
(is (nil? @(rf/subscribe [:mnemonic]))) ; assert seed phrase has been removed
(logout!)
(rf-test/wait-for [::logout/logout-method] ; we need to logout to make sure the node is not
; in
; an inconsistent state between tests
(assert-logout)))))))))
(def multiaccount-name "Narrow Frail Lemming")
(def multiaccount-mnemonic
@@ -203,29 +206,30 @@
(rf-test/run-test-async
(initialize-app!)
(rf-test/wait-for
[:setup/initialize-view]
(rf/dispatch-sync [:init-root :onboarding])
(rf/dispatch-sync [:multiaccounts.recover.ui/recover-multiaccount-button-pressed])
(rf/dispatch-sync [:status-im.multiaccounts.recover.core/enter-phrase-pressed])
(rf/dispatch-sync [:multiaccounts.recover/enter-phrase-input-changed
(security/mask-data multiaccount-mnemonic)])
(rf/dispatch [:multiaccounts.recover/enter-phrase-next-pressed])
(rf-test/wait-for
[:status-im.multiaccounts.recover.core/import-multiaccount-success]
(rf/dispatch-sync [:multiaccounts.recover/re-encrypt-pressed])
(rf/dispatch [:multiaccounts.recover/enter-password-next-pressed password])
[:setup/initialize-view]
(rf/dispatch-sync [:init-root :onboarding])
(rf/dispatch-sync [:multiaccounts.recover.ui/recover-multiaccount-button-pressed])
(rf/dispatch-sync [:status-im.multiaccounts.recover.core/enter-phrase-pressed])
(rf/dispatch-sync [:multiaccounts.recover/enter-phrase-input-changed
(security/mask-data multiaccount-mnemonic)])
(rf/dispatch [:multiaccounts.recover/enter-phrase-next-pressed])
(rf-test/wait-for
[:status-im.multiaccounts.recover.core/store-multiaccount-success]
(let [multiaccount @(rf/subscribe [:multiaccount])] ; assert multiaccount is recovered
(is (= multiaccount-key-uid (:key-uid multiaccount)))
(is (= multiaccount-name (:name multiaccount))))
(rf-test/wait-for ; wait for login
[::transport/messenger-started]
(assert-messenger-started)
(logout!)
(rf-test/wait-for [::logout/logout-method] ; we need to logout to make sure the node is not in an
; inconsistent state between tests
(assert-logout))))))))
[:status-im.multiaccounts.recover.core/import-multiaccount-success]
(rf/dispatch-sync [:multiaccounts.recover/re-encrypt-pressed])
(rf/dispatch [:multiaccounts.recover/enter-password-next-pressed password])
(rf-test/wait-for
[:status-im.multiaccounts.recover.core/store-multiaccount-success]
(let [multiaccount @(rf/subscribe [:multiaccount])] ; assert multiaccount is recovered
(is (= multiaccount-key-uid (:key-uid multiaccount)))
(is (= multiaccount-name (:name multiaccount))))
(rf-test/wait-for ; wait for login
[::transport/messenger-started]
(assert-messenger-started)
(logout!)
(rf-test/wait-for [::logout/logout-method] ; we need to logout to make sure the node is not in
; an
; inconsistent state between tests
(assert-logout))))))))
(def chat-id
"0x0402905bed83f0bbf993cee8239012ccb1a8bc86907ead834c1e38476a0eda71414eed0e25f525f270592a2eebb01c9119a4ed6429ba114e51f5cb0a28dae1adfd")
@@ -235,88 +239,91 @@
(rf-test/run-test-async
(initialize-app!)
(rf-test/wait-for
[:setup/initialize-view]
(generate-and-derive-addresses!)
(rf-test/wait-for
[:multiaccount-generate-and-derive-addresses-success] ; wait for the keys
(assert-multiaccount-loaded)
(create-multiaccount!)
[:setup/initialize-view]
(generate-and-derive-addresses!)
(rf-test/wait-for
[::transport/messenger-started]
(assert-messenger-started)
(rf/dispatch-sync [:chat.ui/start-chat chat-id]) ;; start a new chat
(rf-test/wait-for
[:status-im.chat.models/one-to-one-chat-created]
(rf/dispatch-sync [:chat.ui/navigate-to-chat chat-id])
(is (= chat-id @(rf/subscribe [:chats/current-chat-id])))
(logout!)
(rf-test/wait-for [::logout/logout-method] ; we need to logout to make sure the node is not in an
; inconsistent state between tests
(assert-logout))))))))
[:multiaccount-generate-and-derive-addresses-success] ; wait for the keys
(assert-multiaccount-loaded)
(create-multiaccount!)
(rf-test/wait-for
[::transport/messenger-started]
(assert-messenger-started)
(rf/dispatch-sync [:chat.ui/start-chat chat-id]) ;; start a new chat
(rf-test/wait-for
[:status-im.chat.models/one-to-one-chat-created]
(rf/dispatch-sync [:chat.ui/navigate-to-chat chat-id])
(is (= chat-id @(rf/subscribe [:chats/current-chat-id])))
(logout!)
(rf-test/wait-for [::logout/logout-method] ; we need to logout to make sure the node is not in
; an
; inconsistent state between tests
(assert-logout))))))))
(deftest delete-chat-test
(log/info "========= delete-chat-test ==================")
(rf-test/run-test-async
(initialize-app!)
(rf-test/wait-for
[:setup/initialize-view]
(generate-and-derive-addresses!)
(rf-test/wait-for
[:multiaccount-generate-and-derive-addresses-success] ; wait for the keys
(assert-multiaccount-loaded)
(create-multiaccount!)
[:setup/initialize-view]
(generate-and-derive-addresses!)
(rf-test/wait-for
[::transport/messenger-started]
(assert-messenger-started)
(rf/dispatch-sync [:chat.ui/start-chat chat-id]) ;; start a new chat
(rf-test/wait-for
[:status-im.chat.models/one-to-one-chat-created]
(rf/dispatch-sync [:chat.ui/navigate-to-chat chat-id])
(is (= chat-id @(rf/subscribe [:chats/current-chat-id])))
(is @(rf/subscribe [:chats/chat chat-id]))
(rf/dispatch-sync [:chat.ui/remove-chat-pressed chat-id])
(rf/dispatch-sync [:chat.ui/remove-chat chat-id])
[:multiaccount-generate-and-derive-addresses-success] ; wait for the keys
(assert-multiaccount-loaded)
(create-multiaccount!)
(rf-test/wait-for
[::chat.models/chat-deactivated]
(is (not @(rf/subscribe [:chats/chat chat-id])))
(logout!)
(rf-test/wait-for [::logout/logout-method] ; we need to logout to make sure the node is not in an
; inconsistent state between tests
(assert-logout)))))))))
[::transport/messenger-started]
(assert-messenger-started)
(rf/dispatch-sync [:chat.ui/start-chat chat-id]) ;; start a new chat
(rf-test/wait-for
[:status-im.chat.models/one-to-one-chat-created]
(rf/dispatch-sync [:chat.ui/navigate-to-chat chat-id])
(is (= chat-id @(rf/subscribe [:chats/current-chat-id])))
(is @(rf/subscribe [:chats/chat chat-id]))
(rf/dispatch-sync [:chat.ui/remove-chat-pressed chat-id])
(rf/dispatch-sync [:chat.ui/remove-chat chat-id])
(rf-test/wait-for
[::chat.models/chat-deactivated]
(is (not @(rf/subscribe [:chats/chat chat-id])))
(logout!)
(rf-test/wait-for [::logout/logout-method] ; we need to logout to make sure the node is not
; in an
; inconsistent state between tests
(assert-logout)))))))))
(deftest mute-chat-test
(log/info "========= mute-chat-test ==================")
(rf-test/run-test-async
(initialize-app!)
(rf-test/wait-for
[:setup/initialize-view]
(generate-and-derive-addresses!)
(rf-test/wait-for
[:multiaccount-generate-and-derive-addresses-success] ; wait for the keys
(assert-multiaccount-loaded)
(create-multiaccount!)
[:setup/initialize-view]
(generate-and-derive-addresses!)
(rf-test/wait-for
[::transport/messenger-started]
(assert-messenger-started)
(rf/dispatch-sync [:chat.ui/start-chat chat-id]) ;; start a new chat
(rf-test/wait-for
[:status-im.chat.models/one-to-one-chat-created]
(rf/dispatch-sync [:chat.ui/navigate-to-chat chat-id])
(is (= chat-id @(rf/subscribe [:chats/current-chat-id])))
(is @(rf/subscribe [:chats/chat chat-id]))
(rf/dispatch-sync [::chat.models/mute-chat-toggled chat-id true])
[:multiaccount-generate-and-derive-addresses-success] ; wait for the keys
(assert-multiaccount-loaded)
(create-multiaccount!)
(rf-test/wait-for
[::chat.models/mute-chat-toggled-successfully]
(is @(rf/subscribe [:chats/muted chat-id]))
(rf/dispatch-sync [::chat.models/mute-chat-toggled chat-id false])
(rf-test/wait-for
[::chat.models/mute-chat-toggled-successfully]
[::transport/messenger-started]
(assert-messenger-started)
(rf/dispatch-sync [:chat.ui/start-chat chat-id]) ;; start a new chat
(rf-test/wait-for
[:status-im.chat.models/one-to-one-chat-created]
(rf/dispatch-sync [:chat.ui/navigate-to-chat chat-id])
(is (= chat-id @(rf/subscribe [:chats/current-chat-id])))
(is @(rf/subscribe [:chats/chat chat-id]))
(rf/dispatch-sync [::chat.models/mute-chat-toggled chat-id true])
(rf-test/wait-for
[::chat.models/mute-chat-toggled-successfully]
(is @(rf/subscribe [:chats/muted chat-id]))
(rf/dispatch-sync [::chat.models/mute-chat-toggled chat-id false])
(rf-test/wait-for
[::chat.models/mute-chat-toggled-successfully]
(is (not @(rf/subscribe [:chats/muted chat-id])))
(logout!)
(rf-test/wait-for [::logout/logout-method] ; we need to logout to make sure the node is not in
; an inconsistent state between tests
(assert-logout))))))))))
(is (not @(rf/subscribe [:chats/muted chat-id])))
(logout!)
(rf-test/wait-for [::logout/logout-method] ; we need to logout to make sure the node is
; not in
; an inconsistent state between tests
(assert-logout))))))))))
(comment
(run-tests))
@@ -48,8 +48,8 @@
(defn message-status-text
[]
{:font-size 10
:line-height 10
{:font-size 10
:line-height 10
:border-color :red
:border-width 1
:color :red})
@@ -105,7 +105,8 @@
{:flex-direction :row
:margin-top 1})
(defn pinned-by-text []
(defn pinned-by-text
[]
{:margin-left 5})
(def message-author-touchable
@@ -1,29 +1,30 @@
(ns status-im.ui.screens.communities.community
(:require [i18n.i18n :as i18n]
[quo.core :as quo]
[quo.design-system.colors :as colors]
[quo2.components.community.style :as styles] ;; TODO reimplement with quo2 library and new
;; designs
[quo2.components.navigation.floating-shell-button :as floating-shell-button]
[react-native.core :as rn]
[status-im.chat.models.link-preview :as link-preview]
[status-im.communities.core :as communities]
[status-im.constants :as constants]
[status-im.react-native.resources :as resources]
[status-im.ui.components.accordion :as accordion]
[status-im.ui.components.chat-icon.screen :as chat-icon.screen]
[status-im.ui.components.icons.icons :as icons]
[status-im.ui.components.list.views :as list]
[status-im.ui.components.plus-button :as components.plus-button]
[status-im.ui.components.react :as react]
[status-im.ui.components.toolbar :as toolbar]
[status-im.ui.components.topbar :as topbar]
[status-im.ui.screens.chat.photos :as photos]
[status-im.ui.screens.chat.sheets :as sheets]
[status-im.ui.screens.home.views.inner-item :as inner-item]
[status-im.utils.core :as utils]
[status-im.utils.datetime :as datetime]
[utils.re-frame :as rf]))
(:require ;; TODO reimplement with quo2 library and new
;; designs
[i18n.i18n :as i18n]
[quo.core :as quo]
[quo.design-system.colors :as colors]
[quo2.components.community.style :as styles] ;; TODO reimplement with quo2 library and new
[quo2.components.navigation.floating-shell-button :as floating-shell-button]
[react-native.core :as rn]
[status-im.chat.models.link-preview :as link-preview]
[status-im.communities.core :as communities]
[status-im.constants :as constants]
[status-im.react-native.resources :as resources]
[status-im.ui.components.accordion :as accordion]
[status-im.ui.components.chat-icon.screen :as chat-icon.screen]
[status-im.ui.components.icons.icons :as icons]
[status-im.ui.components.list.views :as list]
[status-im.ui.components.plus-button :as components.plus-button]
[status-im.ui.components.react :as react]
[status-im.ui.components.toolbar :as toolbar]
[status-im.ui.components.topbar :as topbar]
[status-im.ui.screens.chat.photos :as photos]
[status-im.ui.screens.chat.sheets :as sheets]
[status-im.ui.screens.home.views.inner-item :as inner-item]
[status-im.utils.core :as utils]
[status-im.utils.datetime :as datetime]
[utils.re-frame :as rf]))
(def request-cooldown-ms (* 24 60 60 1000))
@@ -17,11 +17,11 @@
[status-im.ui2.screens.chat.composer.style :as style]
[status-im.ui2.screens.chat.photo-selector.view :as photo-selector]
[status-im.utils.handlers :refer [<sub]]
[status-im.utils.utils :as utils]
[utils.re-frame :as rf]
[status-im2.contexts.chat.messages.list.view :refer [scroll-to-bottom]]
[status-im.utils.platform :as platform]
[status-im2.common.not-implemented :as not-implemented]))
[status-im.utils.utils :as utils]
[status-im2.common.not-implemented :as not-implemented]
[status-im2.contexts.chat.messages.list.view :refer [scroll-to-bottom]]
[utils.re-frame :as rf]))
(defn calculate-y
[context min-y max-y added-value chat-id set-bg-opacity]
@@ -57,7 +57,8 @@
mentions-height)]
(when (or (< y max-y) should-translate?) mentions-translate-value)))
(defn get-y-value [context min-y max-y added-value max-height chat-id suggestions reply edit images set-bg-opacity]
(defn get-y-value
[context min-y max-y added-value max-height chat-id suggestions reply edit images set-bg-opacity]
(let [y (calculate-y context min-y max-y added-value chat-id set-bg-opacity)
y-with-mentions (calculate-y-with-mentions y max-y max-height chat-id suggestions reply)]
(+ y (when (seq suggestions) y-with-mentions) (when (seq images) 80) (when edit 38))))
@@ -67,9 +68,11 @@
(clean-and-minimize-composer context chat-id refs min-y false))
([context chat-id refs min-y edit?]
(input/clear-input chat-id refs)
(swap! context assoc :y (if edit?
(- min-y 38)
min-y))
(swap! context assoc
:y
(if edit?
(- min-y 38)
min-y))
(swap! context assoc :clear true :state :min)))
(defn get-bottom-sheet-gesture
@@ -106,7 +109,9 @@
(set-bg-opacity 0)
(rf/dispatch [:dismiss-keyboard]))))))))
(defn get-input-content-change [context translate-y shared-height max-height set-bg-opacity keyboard-shown min-y max-y blank-composer? initial-value]
(defn get-input-content-change
[context translate-y shared-height max-height set-bg-opacity keyboard-shown min-y max-y blank-composer?
initial-value]
(fn [evt]
(when-not (or blank-composer? (some? initial-value))
(swap! context assoc :clear false))
@@ -120,7 +125,9 @@
(set-bg-opacity 0))
(when (not= (:state @context) :max)
(let [offset-value (if platform/ios? 22 40)
new-y (+ min-y (- (max (oget evt "nativeEvent" "contentSize" "height") offset-value) offset-value))]
new-y (+ min-y
(- (max (oget evt "nativeEvent" "contentSize" "height") offset-value)
offset-value))]
(if (< new-y max-y)
(do
(if (> (- max-y new-y) 120)
@@ -157,7 +164,8 @@
:min-y min-y ;minimum y value
:dy 0 ;used for gesture
:pdy 0 ;used for gesture
:state :min ;:min, :custom-chat-available, :custom-chat-unavailable, :max
:state :min ;:min, :custom-chat-available,
;:custom-chat-unavailable, :max
:clear false
:minimized-from-handlebar? false})
keyboard-was-shown? (atom false)
@@ -309,16 +317,18 @@
:size 32} :i/reaction]]
[rn/view {:flex 1}]
;;SEND button
[rn/view {:ref send-ref
:style (when (seq images)
{:width 0
:right -100})}
[quo2.button/button {:icon true
:size 32
:accessibility-label :send-message-button
:on-press #(do (clean-and-minimize-composer-fn false)
(scroll-to-bottom)
(rf/dispatch [:chat.ui/send-current-message]))}
[rn/view
{:ref send-ref
:style (when (seq images)
{:width 0
:right -100})}
[quo2.button/button
{:icon true
:size 32
:accessibility-label :send-message-button
:on-press #(do (clean-and-minimize-composer-fn false)
(scroll-to-bottom)
(rf/dispatch [:chat.ui/send-current-message]))}
:i/arrow-up]]])
;black background
[reanimated/view
@@ -1,5 +1,6 @@
(ns status-im.ui2.screens.chat.group-details.style
(:require [quo2.foundations.colors :as colors]))
(:require [quo2.foundations.colors :as colors]
[react-native.platform :as platform]))
(defn actions-view
[]
@@ -33,12 +34,15 @@
:align-items :center
:margin-bottom 24})
(def bottom-container
{:position :absolute
(defn bottom-container
[safe-area]
{;:position :absolute
:padding-horizontal 20
:padding-vertical 12
:padding-bottom 33
:padding-bottom (+ 33 (if platform/ios? (:bottom safe-area) 0))
:width "100%"
:background-color colors/white
:flex-direction :row
:bottom 0})
;:padding-bottom (if platform/ios? (:bottom safe-area) 0)
:margin-bottom (if platform/ios? 0 70)
})
@@ -1,11 +1,9 @@
(ns status-im.ui2.screens.chat.group-details.view
(:require [i18n.i18n :as i18n]
[oops.core :refer [oget]]
[quo.components.safe-area :as safe-area]
[quo2.core :as quo2]
[quo2.foundations.colors :as colors]
[react-native.core :as rn]
[reagent.core :as reagent]
[status-im.chat.models :as chat.models]
[status-im.ui2.screens.chat.group-details.style :as style]
[status-im.ui2.screens.common.contact-list.view :as contact-list]
@@ -46,8 +44,10 @@
[back-button] [options-button]])
(defn count-container
[count]
[rn/view {:style (style/count-container)}
[count accessibility-label]
[rn/view
{:style (style/count-container)
:accessibility-label accessibility-label}
[quo2/text
{:size :label
:weight :medium
@@ -66,44 +66,41 @@
:weight :medium
:style {:color (colors/theme-colors colors/neutral-50 colors/neutral-40)}} title]])
(def added (reagent/atom ()))
(defn contact-requests-sheet
[group]
(let [added (reagent/atom ())]
(fn []
[:f>
(fn []
(let [{window-height :height} (rn/use-window-dimensions)
safe-area (safe-area/use-safe-area)]
[rn/view {:style {:height (- window-height (:top safe-area))}}
[rn/touchable-opacity
{:on-press #(rf/dispatch [:bottom-sheet/hide])
:style (style/close-icon)}
[quo2/icon :i/close {:color (colors/theme-colors colors/neutral-100 colors/white)}]]
[quo2/text
{:size :heading-1
:weight :semi-bold
:style {:margin-left 20}}
(i18n/label :t/add-members)]
[rn/text-input
{:placeholder (str (i18n/label :t/search) "...")
:style {:height 32
:padding-horizontal 20
:margin-vertical 12}
:on-change (fn [e]
(rf/dispatch [:contacts/set-search-query (oget e "nativeEvent.text")]))}]
[contact-list/contact-list
{:icon :check
:group group
:added added
:search? true}]
[rn/view {:style style/bottom-container}
[quo2/button
{:style {:flex 1}
:on-press #(rf/dispatch [:bottom-sheet/hide])
:disabled (zero? (count @added))}
(i18n/label :t/save)]]]))])))
(defn add-members-sheet
[group admin?]
[:f>
(fn []
(let [{window-height :height} (rn/use-window-dimensions)
safe-area (safe-area/use-safe-area)
selected-participants (rf/sub [:group-chat/selected-participants])
deselected-members (rf/sub [:group-chat/deselected-members])]
[rn/view {:style {:height (- window-height (:top safe-area))}}
[rn/touchable-opacity
{:on-press #(rf/dispatch [:bottom-sheet/hide])
:accessibility-label :close-manage-members
:style (style/close-icon)}
[quo2/icon :i/close {:color (colors/theme-colors colors/neutral-100 colors/white)}]]
[quo2/text
{:size :heading-1
:weight :semi-bold
:style {:margin-left 20}}
(i18n/label (if admin? :t/manage-members :t/add-members))]
[contact-list/contact-list
{:icon :check
:group group
:search? true}]
[rn/view {:style (style/bottom-container safe-area)}
[quo2/button
{:style {:flex 1}
:accessibility-label :save
:on-press (fn []
(rf/dispatch [:group-chats.ui/add-members-pressed])
(js/setTimeout #(rf/dispatch [:group-chats.ui/remove-members-pressed])
500)
(rf/dispatch [:bottom-sheet/hide]))
:disabled (and (zero? (count selected-participants))
(zero? (count deselected-members)))}
(i18n/label :t/save)]]]))])
(defn group-details
[]
@@ -136,33 +133,39 @@
{:size 20 :color (colors/theme-colors colors/neutral-50 colors/neutral-40)}]]]
[rn/view {:style (style/actions-view)}
[rn/touchable-opacity
{:style (style/action-container color)
:on-press (fn []
(rf/dispatch [:bottom-sheet/show-sheet :pinned-messages-list chat-id]))}
{:style (style/action-container color)
:accessibility-label :pinned-messages
:on-press (fn []
(rf/dispatch [:bottom-sheet/show-sheet :pinned-messages-list chat-id]))}
[rn/view
{:style {:flex-direction :row
:justify-content :space-between}}
[quo2/icon :i/pin {:size 20 :color (colors/theme-colors colors/neutral-100 colors/white)}]
[count-container (count pinned-messages)]]
[count-container (count pinned-messages) :pinned-count]]
[quo2/text {:style {:margin-top 16} :size :paragraph-1 :weight :medium}
(i18n/label :t/pinned-messages)]]
[rn/touchable-opacity
{:style (style/action-container color)
:on-press #(rf/dispatch [::chat.models/mute-chat-toggled chat-id (not muted)])}
{:style (style/action-container color)
:accessibility-label :toggle-mute
:on-press #(rf/dispatch [::chat.models/mute-chat-toggled chat-id (not muted)])}
[quo2/icon (if muted :i/muted :i/activity-center)
{:size 20 :color (colors/theme-colors colors/neutral-100 colors/white)}]
[quo2/text {:style {:margin-top 16} :size :paragraph-1 :weight :medium}
(i18n/label (if muted :unmute-group :mute-group))]]
[rn/touchable-opacity
{:style (style/action-container color)
:on-press #(rf/dispatch
[:bottom-sheet/show-sheet
{:content (fn [] [contact-requests-sheet group])}])}
{:style (style/action-container color)
:accessibility-label :manage-members
:on-press (fn []
(rf/dispatch [:group/clear-added-participants])
(rf/dispatch [:group/clear-removed-members])
(rf/dispatch
[:bottom-sheet/show-sheet
{:content (fn [] [add-members-sheet group admin?])}]))}
[rn/view
{:style {:flex-direction :row
:justify-content :space-between}}
[quo2/icon :i/add-user {:size 20 :color (colors/theme-colors colors/neutral-100 colors/white)}]
[count-container (count contacts)]]
[count-container (count contacts) :members-count]]
[quo2/text {:style {:margin-top 16} :size :paragraph-1 :weight :medium}
(i18n/label (if admin? :t/manage-members :t/add-members))]]]
[rn/section-list
@@ -4,6 +4,7 @@
[quo2.components.avatars.user-avatar :as user-avatar]
[quo2.components.icon :as icons]
[quo2.components.markdown.text :as text]
[quo2.core :as quo]
[quo2.foundations.colors :as colors]
[quo2.foundations.typography :as typography]
[re-frame.core :as re-frame]
@@ -29,8 +30,7 @@
[status-im2.contexts.chat.home.chat-list-item.view :as home.chat-list-item]
[status-im2.contexts.chat.messages.delete-message-for-me.events]
[status-im2.contexts.chat.messages.delete-message.events]
[utils.re-frame :as rf]
[quo2.core :as quo])
[utils.re-frame :as rf])
(:require-macros [status-im.utils.views :refer [defview letsubs]]))
(def edited-at-text (str " ⌫ " (i18n/label :t/edited)))
@@ -133,10 +133,10 @@
[rn/view {:flex-direction :row}
[rn/text {:style (style/message-status-text)}
(str "["
(if edited-at
"edited"
(or outgoing-status ""))
" DEBUG]")]]))
(if edited-at
"edited"
(or outgoing-status ""))
" DEBUG]")]]))
(defn quoted-message
[{:keys [message-id chat-id]} reply pin?]
@@ -10,12 +10,14 @@
(defn contact-list
[data]
(let [contacts (rf/sub [:contacts/filtered-active-sections])]
(let [contacts (if (:group data)
(rf/sub [:contacts/add-members-sections])
(rf/sub [:contacts/filtered-active-sections]))]
[rn/section-list
{:key-fn :title
:sticky-section-headers-enabled false
:sections contacts
:render-section-header-fn contacts-section-header
:content-container-style {:padding-bottom 120}
:content-container-style {:padding-bottom 20}
:render-data data
:render-fn contact-list-item/contact-list-item}]))
@@ -19,9 +19,11 @@
(rf/dispatch [:search/home-filter-changed nil]))))
(defn action-icon
[{:keys [public-key] :as item} {:keys [icon group added] :as extra-data}]
(let [{:keys [contacts]} group
member? (contains? contacts public-key)]
[{:keys [public-key] :as item} {:keys [icon group] :as extra-data}]
(let [{:keys [contacts admins]} group
member? (contains? contacts public-key)
current-pk (rf/sub [:multiaccount/public-key])
admin? (get admins current-pk)]
[rn/touchable-opacity
{:on-press #(rf/dispatch [:bottom-sheet/show-sheet
{:content (fn [] [actions/actions item extra-data])}])
@@ -30,11 +32,17 @@
(if (= icon :options)
[quo/icon :i/options {:size 20 :color (colors/theme-colors colors/neutral-50 colors/neutral-40)}]
[quo/checkbox
{:default-checked? member?
:on-change (fn [selected]
(if selected
(swap! added conj public-key)
(reset! added (remove #(= % public-key) @added))))}])]))
{:default-checked? member?
:accessibility-label :contact-toggle-check
:disabled? (and member? (not admin?))
:on-change (fn [selected]
(if-not member?
(if selected
(rf/dispatch [:select-participant public-key true])
(rf/dispatch [:deselect-participant public-key true]))
(if selected
(rf/dispatch [:undo-deselect-member public-key true])
(rf/dispatch [:deselect-member public-key true]))))}])]))
(defn contact-list-item
[item _ _ extra-data]
@@ -44,18 +52,21 @@
public-key]))
photo-path (when (seq images)
(rf/sub [:chats/photo-path public-key]))
current-pk (rf/sub [:multiaccount/public-key])]
current-pk (rf/sub [:multiaccount/public-key])
online? (rf/sub [:visibility-status-updates/online?
public-key])]
[rn/touchable-opacity
(merge {:style (style/container)
:active-opacity 1
:on-press #(open-chat public-key)
:on-long-press #(rf/dispatch [:bottom-sheet/show-sheet
{:content (fn [] [actions/actions item extra-data])}])})
(merge {:style (style/container)
:accessibility-label :contact
:active-opacity 1
:on-press #(open-chat public-key)
:on-long-press #(rf/dispatch [:bottom-sheet/show-sheet
{:content (fn [] [actions/actions item extra-data])}])})
[quo/user-avatar
{:full-name display-name
:profile-picture photo-path
:status-indicator? true
:online? true
:online? online?
:size :small
:ring? false}]
[rn/view {:style {:margin-left 8}}
+12 -9
View File
@@ -1,11 +1,12 @@
(ns status-im2.common.home.actions.view
(:require [i18n.i18n :as i18n]
[quo2.components.drawers.action-drawers :as drawer]
[status-im.chat.models :as chat.models]
[status-im2.common.confirmation-drawer.view :as confirmation-drawer] ;;TODO move to
;;status-im2
[status-im2.common.constants :as constants]
[utils.re-frame :as rf]))
(:require ;;TODO move to
;;status-im2
[i18n.i18n :as i18n]
[quo2.components.drawers.action-drawers :as drawer]
[status-im.chat.models :as chat.models]
[status-im2.common.confirmation-drawer.view :as confirmation-drawer] ;;TODO move to
[status-im2.common.constants :as constants]
[utils.re-frame :as rf]))
(defn- entry
[{:keys [icon label on-press danger? sub-label chevron? add-divider?]}]
@@ -368,8 +369,10 @@
(defn group-actions
[{:keys [chat-id admins]} inside-chat?]
(let [current-pub-key (rf/sub [:multiaccount/public-key])
admin? (get admins current-pub-key)]
[(group-details-entry chat-id)
admin? (get admins current-pub-key)
removed? (rf/sub [:group-chat/removed-from-current-chat?])]
[(when-not removed?
(group-details-entry chat-id))
(when inside-chat?
(if admin?
(manage-members-entry)
+2 -1
View File
@@ -1,6 +1,7 @@
(ns status-im2.common.not-implemented
(:require [react-native.core :as rn]))
(defn not-implemented [content]
(defn not-implemented
[content]
[rn/view {:border-color :red :border-width 1}
content])
@@ -1,8 +1,9 @@
(ns status-im2.contexts.chat.messages.content.deleted.view
(:require [quo2.core :as quo]
[i18n.i18n :as i18n]))
(:require [i18n.i18n :as i18n]
[quo2.core :as quo]))
(defn deleted-message [{:keys [deleted? deleted-undoable-till timestamp-str deleted-for-me-undoable-till]}]
(defn deleted-message
[{:keys [deleted? deleted-undoable-till timestamp-str deleted-for-me-undoable-till]}]
[quo/system-message
{:type :deleted
:label (if deleted? :message-deleted :message-deleted-for-you)
@@ -1,45 +1,53 @@
(ns status-im2.contexts.chat.messages.content.pin.view
(:require [react-native.core :as rn]
[status-im2.contexts.chat.messages.content.pin.style :as style]
(:require [i18n.i18n :as i18n]
[quo2.core :as quo]
[quo2.foundations.colors :as colors]
[utils.re-frame :as rf]
[i18n.i18n :as i18n]
[react-native.core :as rn]
[status-im.ui.screens.chat.styles.message.message :as old-style]
[status-im.ui2.screens.chat.messages.message :as old-message]
[status-im.ui.screens.chat.styles.message.message :as old-style]))
[status-im2.contexts.chat.messages.content.pin.style :as style]
[utils.re-frame :as rf]))
(defn pinned-by-view [pinned-by]
(defn pinned-by-view
[pinned-by]
(let [{:keys [public-key]} (rf/sub [:multiaccount/contact])
contact-names (rf/sub [:contacts/contact-two-names-by-identity pinned-by])
author-name (if (= pinned-by public-key) (i18n/label :t/You) (first contact-names))]
[rn/view {:style style/pin-indicator-container
:accessibility-label :pinned-by}
contact-names (rf/sub [:contacts/contact-two-names-by-identity pinned-by])
author-name (if (= pinned-by public-key) (i18n/label :t/You) (first contact-names))]
[rn/view
{:style style/pin-indicator-container
:accessibility-label :pinned-by}
[quo/icon :i/pin {:color colors/primary-50 :size 16}]
[quo/text {:size :label
:weight :medium
:style style/pin-author-text}
[quo/text
{:size :label
:weight :medium
:style style/pin-author-text}
author-name]]))
(defn system-message [{:keys [from in-popover? timestamp-str chat-id] :as message}]
(let [response-to (:response-to (:content message))
(defn system-message
[{:keys [from in-popover? timestamp-str chat-id] :as message}]
(let [response-to (:response-to (:content message))
default-size 36]
[rn/touchable-opacity {:on-press #(rf/dispatch [:bottom-sheet/show-sheet :pinned-messages-list chat-id])
:active-opacity 1
:style (merge {:flex-direction :row :margin-vertical 8} (old-style/message-wrapper message))}
[rn/view {:style {:width default-size
:height default-size
:margin-right 16
:border-radius default-size
:justify-content :center
:align-items :center
:background-color colors/primary-50-opa-10}
:accessibility-label :content-type-pin-icon}
[rn/touchable-opacity
{:on-press #(rf/dispatch [:bottom-sheet/show-sheet :pinned-messages-list chat-id])
:active-opacity 1
:style (merge {:flex-direction :row :margin-vertical 8}
(old-style/message-wrapper message))}
[rn/view
{:style {:width default-size
:height default-size
:margin-right 16
:border-radius default-size
:justify-content :center
:align-items :center
:background-color colors/primary-50-opa-10}
:accessibility-label :content-type-pin-icon}
[quo/icon :i/pin {:color colors/primary-50 :size 16}]]
[rn/view
[rn/view {:style {:flex-direction :row :align-items :center}}
[rn/touchable-opacity {:style old-style/message-author-touchable
:disabled in-popover?
:on-press #(rf/dispatch [:chat.ui/show-profile from])}
[rn/touchable-opacity
{:style old-style/message-author-touchable
:disabled in-popover?
:on-press #(rf/dispatch [:chat.ui/show-profile from])}
[old-message/message-author-name from {} 20]]
[rn/text {:style {:font-size 13}} (str " " (i18n/label :t/pinned-a-message))]
[rn/text
@@ -49,4 +57,5 @@
(old-style/message-timestamp-text))
:accessibility-label :message-timestamp}
timestamp-str]]
[old-message/quoted-message {:message-id response-to :chat-id chat-id} (:quoted-message message) true]]]))
[old-message/quoted-message {:message-id response-to :chat-id chat-id} (:quoted-message message)
true]]]))
@@ -1,28 +1,31 @@
(ns status-im2.contexts.chat.messages.content.reactions.view
(:require [status-im2.common.constants :as constants]
[quo2.core :as quo]
(:require [quo2.core :as quo]
[react-native.core :as rn]
[utils.re-frame :as rf]
[status-im2.contexts.chat.messages.drawers.view :as drawers]))
[status-im2.common.constants :as constants]
[status-im2.contexts.chat.messages.drawers.view :as drawers]
[utils.re-frame :as rf]))
(defn message-reactions-row [chat-id message-id]
(defn message-reactions-row
[chat-id message-id]
(let [reactions (rf/sub [:chats/message-reactions message-id chat-id])]
(when (seq reactions)
[rn/view {:margin-left 52 :margin-bottom 12 :flex-direction :row}
(for [{:keys [own emoji-id quantity emoji-reaction-id] :as emoji-reaction} reactions]
^{:key (str emoji-reaction)}
[rn/view {:style {:margin-right 6}}
[quo/reaction {:emoji (get constants/reactions emoji-id)
:neutral? own
:clicks quantity
:on-press (if own
#(rf/dispatch [:models.reactions/send-emoji-reaction-retraction
{:message-id message-id
:emoji-id emoji-id
:emoji-reaction-id emoji-reaction-id}])
#(rf/dispatch [:models.reactions/send-emoji-reaction
{:message-id message-id
:emoji-id emoji-id}]))
:accessibility-label (str "emoji-reaction-" emoji-id)}]])
[quo/add-reaction {:on-press #(rf/dispatch [:bottom-sheet/show-sheet
{:content (fn [] [drawers/reactions chat-id message-id])}])}]])))
[quo/reaction
{:emoji (get constants/reactions emoji-id)
:neutral? own
:clicks quantity
:on-press (if own
#(rf/dispatch [:models.reactions/send-emoji-reaction-retraction
{:message-id message-id
:emoji-id emoji-id
:emoji-reaction-id emoji-reaction-id}])
#(rf/dispatch [:models.reactions/send-emoji-reaction
{:message-id message-id
:emoji-id emoji-id}]))
:accessibility-label (str "emoji-reaction-" emoji-id)}]])
[quo/add-reaction
{:on-press #(rf/dispatch [:bottom-sheet/show-sheet
{:content (fn [] [drawers/reactions chat-id message-id])}])}]])))
@@ -1,5 +1,6 @@
(ns status-im2.contexts.chat.messages.content.status.view
(:require [status-im.ui2.screens.chat.messages.message :as old-message]))
(defn status [message-data]
(defn status
[message-data]
[old-message/message-status message-data])
@@ -1,7 +1,8 @@
(ns status-im2.contexts.chat.messages.content.style
(:require [quo2.foundations.colors :as colors]))
(defn message-container [in-pinned-view? pinned mentioned last-in-group?]
(defn message-container
[in-pinned-view? pinned mentioned last-in-group?]
(merge (when (and (not in-pinned-view?) (or mentioned pinned))
{:background-color colors/primary-50-opa-5
:margin-bottom 4})
@@ -2,6 +2,7 @@
(:require [react-native.core :as rn]
[status-im.ui2.screens.chat.messages.message :as old-message]))
(defn text-content [message-data]
(defn text-content
[message-data]
[rn/view {:accessibility-label :chat-item}
[old-message/render-parsed-text message-data]])
@@ -1,5 +1,6 @@
(ns status-im2.contexts.chat.messages.content.text.view
(:require [status-im.ui2.screens.chat.messages.message :as old-message]))
(defn text-content [message-data]
(defn text-content
[message-data]
[old-message/render-parsed-text message-data])
@@ -1,20 +1,20 @@
(ns status-im2.contexts.chat.messages.content.view
(:require [react-native.core :as rn]
(:require [quo2.core :as quo]
[quo2.foundations.colors :as colors]
[status-im2.contexts.chat.messages.content.style :as style]
[status-im2.contexts.chat.messages.content.pin.view :as pin]
[react-native.core :as rn]
[status-im.ui2.screens.chat.messages.message :as old-message]
[status-im.utils.datetime :as time]
[status-im2.common.constants :as constants]
[status-im2.contexts.chat.messages.content.unknown.view :as content.unknown]
[status-im2.contexts.chat.messages.content.text.view :as content.text]
[status-im2.contexts.chat.messages.drawers.view :as drawers]
[status-im2.common.not-implemented :as not-implemented]
[status-im2.contexts.chat.messages.content.pin.view :as pin]
[status-im2.contexts.chat.messages.content.reactions.view :as reactions]
[status-im2.contexts.chat.messages.content.status.view :as status]
[status-im2.contexts.chat.messages.content.style :as style]
[status-im2.contexts.chat.messages.content.system.text.view :as system.text]
[quo2.core :as quo]
[utils.re-frame :as rf]
[status-im.utils.datetime :as time]
[status-im.ui2.screens.chat.messages.message :as old-message]
[status-im2.common.not-implemented :as not-implemented]))
[status-im2.contexts.chat.messages.content.text.view :as content.text]
[status-im2.contexts.chat.messages.content.unknown.view :as content.unknown]
[status-im2.contexts.chat.messages.drawers.view :as drawers]
[utils.re-frame :as rf]))
(defn avatar
[{:keys [response-to last-in-group? pinned quoted-message from]}]
@@ -51,11 +51,14 @@
[not-implemented/not-implemented [pin/system-message message-data]]
(case content-type
constants/content-type-system-text [not-implemented/not-implemented [system.text/text-content message-data]]
constants/content-type-system-text [not-implemented/not-implemented
[system.text/text-content message-data]]
constants/content-type-community [not-implemented/not-implemented [old-message/community message-data]]
constants/content-type-community [not-implemented/not-implemented
[old-message/community message-data]]
constants/content-type-contact-request [not-implemented/not-implemented [old-message/system-contact-request message-data]])))
constants/content-type-contact-request [not-implemented/not-implemented
[old-message/system-contact-request message-data]])))
(defn user-message-content
[{:keys [content-type quoted-message content] :as message-data}
@@ -76,15 +79,20 @@
[author message-data]
(case content-type
constants/content-type-text [not-implemented/not-implemented [content.text/text-content message-data]]
constants/content-type-text [not-implemented/not-implemented
[content.text/text-content message-data]]
constants/content-type-emoji [not-implemented/not-implemented [old-message/emoji message-data]]
constants/content-type-emoji [not-implemented/not-implemented
[old-message/emoji message-data]]
constants/content-type-sticker [not-implemented/not-implemented [old-message/sticker message-data]]
constants/content-type-sticker [not-implemented/not-implemented
[old-message/sticker message-data]]
constants/content-type-image [not-implemented/not-implemented [old-message/message-content-image message-data]]
constants/content-type-image [not-implemented/not-implemented
[old-message/message-content-image message-data]]
constants/content-type-audio [not-implemented/not-implemented [old-message/audio message-data]]
constants/content-type-audio [not-implemented/not-implemented
[old-message/audio message-data]]
[not-implemented/not-implemented [content.unknown/unknown-content message-data]])
[status/status message-data]]]]]))
@@ -1,13 +1,13 @@
(ns status-im2.contexts.chat.messages.drawers.view
(:require [react-native.core :as rn]
[status-im2.common.constants :as constants]
[utils.re-frame :as rf]
(:require [i18n.i18n :as i18n]
[quo2.core :as quo]
[i18n.i18n :as i18n]
[status-im2.setup.config :as config]
[react-native.core :as rn]
[status-im.ui.components.react :as react]
[status-im.ui2.screens.chat.components.reply :as components.reply]
[status-im2.common.not-implemented :as not-implemented]))
[status-im2.common.constants :as constants]
[status-im2.common.not-implemented :as not-implemented]
[status-im2.setup.config :as config]
[utils.re-frame :as rf]))
(defn pin-message
[{:keys [chat-id pinned] :as message-data}]
@@ -8,13 +8,13 @@
[react-native.platform :as platform]
[reagent.core :as reagent]
[status-im.ui.screens.chat.group :as chat.group]
[status-im.ui.screens.chat.state :as state]
[status-im2.contexts.chat.messages.content.view :as message]
[status-im2.common.constants :as constants]
[utils.re-frame :as rf]
[status-im2.contexts.chat.messages.content.deleted.view :as content.deleted]
[status-im.ui.screens.chat.message.gap :as message.gap]
[status-im2.common.not-implemented :as not-implemented]))
[status-im.ui.screens.chat.state :as state]
[status-im2.common.constants :as constants]
[status-im2.common.not-implemented :as not-implemented]
[status-im2.contexts.chat.messages.content.deleted.view :as content.deleted]
[status-im2.contexts.chat.messages.content.view :as message]
[utils.re-frame :as rf]))
(defonce messages-list-ref (atom nil))
@@ -114,7 +114,8 @@
[rn/view {:style (when platform/android? {:scaleY -1})}
[chat.group/group-chat-footer chat-id invitation-admin]]))
(defn render-fn [{:keys [type value deleted? deleted-for-me? content-type] :as message-data} _ _ context]
(defn render-fn
[{:keys [type value deleted? deleted-for-me? content-type] :as message-data} _ _ context]
[rn/view {:style (when platform/android? {:scaleY -1})}
(if (= type :datemark)
[quo/divider-date value]
@@ -126,9 +127,10 @@
[content.deleted/deleted-message message-data]
[message/message-with-reactions message-data context])]))])
(defn messages-list [{:keys [chat
pan-responder
show-input?]}]
(defn messages-list
[{:keys [chat
pan-responder
show-input?]}]
(let [{:keys [group-chat chat-type chat-id public? community-id admins]} chat
mutual-contact-requests-enabled? (rf/sub [:mutual-contact-requests/enabled?])
messages (rf/sub [:chats/raw-chat-messages-stream chat-id])
@@ -3,9 +3,9 @@
[quo2.core :as quo]
[quo2.foundations.colors :as colors]
[react-native.core :as rn]
[status-im.utils.datetime :as time]
[status-im2.contexts.chat.messages.content.view :as message]
[utils.re-frame :as rf]
[status-im.utils.datetime :as time]))
[utils.re-frame :as rf]))
(def list-key-fn #(or (:message-id %) (:value %)))
@@ -27,10 +27,11 @@
:timestamp-str (time/timestamp->time whisper-timestamp)
:edit-enabled edit-enabled}])
(defn pinned-messages-list [chat-id]
(defn pinned-messages-list
[chat-id]
(let [pinned-messages (vec (vals (rf/sub [:chats/pinned chat-id])))
current-chat (rf/sub [:chats/current-chat])
community (rf/sub [:communities/community (:community-id current-chat)])]
current-chat (rf/sub [:chats/current-chat])
community (rf/sub [:communities/community (:community-id current-chat)])]
[rn/view {:accessibility-label :pinned-messages-list}
;; TODO (flexsurfer) this should be a component in quo2
;; https://github.com/status-im/status-mobile/issues/14529
@@ -6,12 +6,12 @@
[status-im.ui2.screens.chat.composer.view :as composer]
[status-im.ui2.screens.chat.pin-limit-popover.view :as pin-limit-popover]
[status-im2.common.constants :as constants]
[status-im2.common.not-implemented :as not-implemented]
[status-im2.contexts.chat.messages.list.view :as messages.list]
[status-im2.contexts.chat.messages.pin.banner.view :as pin.banner] ;;TODO move to status-im2
[status-im2.navigation.state :as navigation.state]
[utils.debounce :as debounce]
[utils.re-frame :as rf]
[status-im2.common.not-implemented :as not-implemented]))
[utils.re-frame :as rf]))
(defn navigate-back-handler
[]
@@ -53,13 +53,16 @@
:right-section-buttons
[{:on-press #()
:style {:border-width 1 :border-color :red}
:style {:border-width 1 :border-color :red}
:icon :i/options
:accessibility-label :options-button}]}]))
(defn chat-render []
(defn chat-render
[]
(let [;;NOTE: we want to react only on these fields, do not use full chat map here
{:keys [chat-id show-input?] :as chat} (rf/sub [:chats/current-chat-chat-view])]
show-input? (not (rf/sub [:group-chat/removed-from-current-chat?]))
{:keys [chat-id] :as chat} (rf/sub [:chats/current-chat-chat-view])]
[rn/keyboard-avoiding-view {:style {:flex 1}}
[page-nav]
[not-implemented/not-implemented
@@ -1,21 +1,22 @@
(ns status-im2.contexts.communities.overview.view
(:require [i18n.i18n :as i18n]
[oops.core :as oops]
[quo2.core :as quo]
[quo2.foundations.colors :as colors]
[react-native.core :as rn]
[react-native.platform :as platform]
[reagent.core :as reagent]
[status-im.react-native.resources :as resources]
[status-im.ui.screens.communities.icon :as communities.icon]
[status-im.utils.utils :as utils]
[status-im2.common.constants :as constants]
[status-im2.common.scroll-page.view :as scroll-page]
[status-im2.contexts.communities.home.actions.view :as home.actions]
[status-im2.contexts.communities.overview.style :as style] ;; TODO move to status-im2 when
;; reimplemented
[status-im2.contexts.communities.requests.actions.view :as requests.actions]
[utils.re-frame :as rf]))
(:require ;; TODO move to status-im2 when
;; reimplemented
[i18n.i18n :as i18n]
[oops.core :as oops]
[quo2.core :as quo]
[quo2.foundations.colors :as colors]
[react-native.core :as rn]
[react-native.platform :as platform]
[reagent.core :as reagent]
[status-im.react-native.resources :as resources]
[status-im.ui.screens.communities.icon :as communities.icon]
[status-im.utils.utils :as utils]
[status-im2.common.constants :as constants]
[status-im2.common.scroll-page.view :as scroll-page]
[status-im2.contexts.communities.home.actions.view :as home.actions]
[status-im2.contexts.communities.overview.style :as style] ;; TODO move to status-im2 when
[status-im2.contexts.communities.requests.actions.view :as requests.actions]
[utils.re-frame :as rf]))
(def knc-token-img (js/require "../resources/images/tokens/mainnet/KNC.png"))
(def mana-token-img (js/require "../resources/images/tokens/mainnet/MANA.png"))
@@ -23,7 +23,7 @@
(fn [c]
{:key c
:value c})
(keys colors/customization))}])
["#ff0000" "#0000ff"])}]) ; TODO: this is temporary only. Issue: https://github.com/status-im/status-mobile/issues/14566
(defn cool-preview
[]
@@ -42,9 +42,9 @@
(defn cool-preview
[]
(let [state (reagent/atom {:label "Name"
(let [state (reagent/atom {:label "Name"
:channel-name "Channel"
:type :group-avatar})]
:type :group-avatar})]
(fn []
(let [contacts {example-pk {:public-key example-pk
:names {:three-words-name
@@ -93,7 +93,8 @@
:justify-content :center}
(case (:type @state)
:context-tag
[quo2/context-tag group-avatar-default-params {:uri example-photo2} (:label @state) (:channel-name @state)]
[quo2/context-tag group-avatar-default-params {:uri example-photo2} (:label @state)
(:channel-name @state)]
:group-avatar
[quo2/group-avatar-tag (:label @state) group-avatar-default-params]
:public-key
+19 -18
View File
@@ -1,22 +1,23 @@
(ns status-im2.navigation.view
(:require [oops.core :refer [oget]]
[quo2.foundations.colors :as colors]
[re-frame.core :as re-frame]
[react-native.core :as rn]
[react-native.safe-area :as safe-area]
[reagent.core :as reagent]
[status-im.keycard.test-menu :as keycard.test-menu]
[status-im.ui.screens.bottom-sheets.views :as bottom-sheets]
[status-im.ui.screens.popover.views :as popover]
[status-im.ui.screens.profile.visibility-status.views :as visibility-status-views]
[status-im.ui.screens.signing.views :as signing]
[status-im.ui.screens.wallet-connect.session-proposal.views :as wallet-connect]
[status-im.ui.screens.wallet.send.views :as wallet.send.views]
[status-im2.common.toasts.view :as toasts] ;; TODO (14/11/22 flexsurfer) move to status-im2
;; namespace
[status-im2.navigation.screens :as screens]
[status-im2.setup.config :as config]
[status-im2.setup.hot-reload :as reloader]))
(:require ;; TODO (14/11/22 flexsurfer) move to status-im2
;; namespace
[oops.core :refer [oget]]
[quo2.foundations.colors :as colors]
[re-frame.core :as re-frame]
[react-native.core :as rn]
[react-native.safe-area :as safe-area]
[reagent.core :as reagent]
[status-im.keycard.test-menu :as keycard.test-menu]
[status-im.ui.screens.bottom-sheets.views :as bottom-sheets]
[status-im.ui.screens.popover.views :as popover]
[status-im.ui.screens.profile.visibility-status.views :as visibility-status-views]
[status-im.ui.screens.signing.views :as signing]
[status-im.ui.screens.wallet-connect.session-proposal.views :as wallet-connect]
[status-im.ui.screens.wallet.send.views :as wallet.send.views]
[status-im2.common.toasts.view :as toasts] ;; TODO (14/11/22 flexsurfer) move to status-im2
[status-im2.navigation.screens :as screens]
[status-im2.setup.config :as config]
[status-im2.setup.hot-reload :as reloader]))
(defn get-screens
[]
+6 -5
View File
@@ -1,9 +1,10 @@
(ns status-im2.setup.config
(:require [clojure.string :as string]
[react-native.config :as react-native-config] ;; TODO (14/11/22 flexsurfer move to status-im2
;; namespace
[status-im.ethereum.core :as ethereum]
[status-im.ethereum.ens :as ens]))
(:require ;; TODO (14/11/22 flexsurfer move to status-im2
;; namespace
[clojure.string :as string]
[react-native.config :as react-native-config] ;; TODO (14/11/22 flexsurfer move to status-im2
[status-im.ethereum.core :as ethereum]
[status-im.ethereum.ens :as ens]))
(def get-config react-native-config/get-config)
+25 -24
View File
@@ -1,28 +1,29 @@
(ns status-im2.setup.core
(:require [i18n.i18n :as i18n]
[re-frame.core :as re-frame]
[re-frame.interop :as interop]
[react-native.core :as rn]
[react-native.languages :as react-native-languages]
[react-native.platform :as platform]
[react-native.shake :as react-native-shake]
[reagent.impl.batching :as batching]
[status-im.async-storage.core :as async-storage]
status-im.events
[status-im.native-module.core :as status]
[status-im.notifications.local :as notifications]
[status-im.utils.universal-links.core :as utils.universal-links]
[status-im2.contexts.shell.animation :as animation] ;; TODO (14/11/22 flexsurfer move to
;; status-im2 namespace
status-im2.contexts.syncing.events
status-im2.navigation.core
[status-im2.setup.config :as config]
[status-im2.setup.dev :as dev]
status-im2.setup.events
[status-im2.setup.global-error :as global-error]
[status-im2.setup.i18n-resources :as i18n-resources]
[status-im2.setup.log :as log]
status-im2.subs.root))
(:require ;; TODO (14/11/22 flexsurfer move to
;; status-im2 namespace
[i18n.i18n :as i18n]
[re-frame.core :as re-frame]
[re-frame.interop :as interop]
[react-native.core :as rn]
[react-native.languages :as react-native-languages]
[react-native.platform :as platform]
[react-native.shake :as react-native-shake]
[reagent.impl.batching :as batching]
[status-im.async-storage.core :as async-storage]
status-im.events
[status-im.native-module.core :as status]
[status-im.notifications.local :as notifications]
[status-im.utils.universal-links.core :as utils.universal-links]
[status-im2.contexts.shell.animation :as animation] ;; TODO (14/11/22 flexsurfer move to
status-im2.contexts.syncing.events
status-im2.navigation.core
[status-im2.setup.config :as config]
[status-im2.setup.dev :as dev]
status-im2.setup.events
[status-im2.setup.global-error :as global-error]
[status-im2.setup.i18n-resources :as i18n-resources]
[status-im2.setup.log :as log]
status-im2.subs.root))
;;;; re-frame RN setup
(set! interop/next-tick js/setTimeout)
+2 -1
View File
@@ -10,7 +10,8 @@
:group/selected-contacts #{}
:chats {}
:current-chat-id nil
:selected-participants #{}
:group-chat/selected-participants #{}
:group-chat/deselected-members #{}
:sync-state :done
:link-previews-whitelist []
:app-state "active"
-1
View File
@@ -294,4 +294,3 @@
(seq offline) (assoc :offline {:title (i18n/label :t/offline) :data offline}))))))
+1 -1
View File
@@ -217,7 +217,7 @@
(re-frame/reg-sub
:is-participant-selected?
:<- [:selected-participants]
:<- [:group-chat/selected-participants]
(fn [selected-participants [_ element]]
(-> selected-participants
(contains? element))))
+2 -1
View File
@@ -98,7 +98,8 @@
(reg-root-key-sub :new-chat-name :new-chat-name)
(reg-root-key-sub :group-chat-profile/editing? :group-chat-profile/editing?)
(reg-root-key-sub :group-chat-profile/profile :group-chat-profile/profile)
(reg-root-key-sub :selected-participants :selected-participants)
(reg-root-key-sub :group-chat/selected-participants :group-chat/selected-participants)
(reg-root-key-sub :group-chat/deselected-members :group-chat/deselected-members)
(reg-root-key-sub :chat/inputs :chat/inputs)
(reg-root-key-sub :chat/memberships :chat/memberships)
(reg-root-key-sub :camera-roll/photos :camera-roll/photos)
+6
View File
@@ -14,3 +14,9 @@
Similar to group-by except that the map values are single objects (depends on key uniqueness)."
[key coll]
(into {} (map #(vector (key %) %) coll)))
(defn distinct-by
"Given a key and a collection returns a unique collection by that key"
[key coll]
(let [groups (group-by key coll)]
(map #(first (groups %)) (distinct (map key coll)))))
+2 -1
View File
@@ -1912,5 +1912,6 @@
"instruction-after-qr-generated": "On your other device, navigate to the Syncing screen and select “Scan sync”",
"show-existing-keys": "Show Existing Keys",
"scan-sync-code": "Scan Sync Code",
"confirm-selection": "Confirm selection"
"confirm-selection": "Confirm selection",
"online": "Online"
}