diff --git a/resources/images/icons2/32x32/identicon-ring@2x.png b/resources/images/icons2/32x32/identicon-ring@2x.png new file mode 100644 index 0000000000..5142b86d37 Binary files /dev/null and b/resources/images/icons2/32x32/identicon-ring@2x.png differ diff --git a/resources/images/icons2/32x32/identicon-ring@3x.png b/resources/images/icons2/32x32/identicon-ring@3x.png new file mode 100644 index 0000000000..3da71b20f3 Binary files /dev/null and b/resources/images/icons2/32x32/identicon-ring@3x.png differ diff --git a/src/quo2/components/avatars/user_avatar.cljs b/src/quo2/components/avatars/user_avatar.cljs index 5c78b66fe5..3f2629578a 100644 --- a/src/quo2/components/avatars/user_avatar.cljs +++ b/src/quo2/components/avatars/user_avatar.cljs @@ -126,10 +126,8 @@ :height outer-dimensions :border-radius outer-dimensions}} (when (and ring? identicon?) - [icons/icon :main-icons/identicon-ring {:width outer-dimensions - :height outer-dimensions - :size outer-dimensions - :no-color true}]) + [icons/icon :i/identicon-ring {:size outer-dimensions + :no-color true}]) (if profile-picture ;; display image [fast-image/fast-image {:source {:uri profile-picture} diff --git a/src/quo2/components/drawers/action_drawers.cljs b/src/quo2/components/drawers/action_drawers.cljs index 427cf96fc9..22f8f504c5 100644 --- a/src/quo2/components/drawers/action_drawers.cljs +++ b/src/quo2/components/drawers/action_drawers.cljs @@ -9,54 +9,6 @@ (colors/theme-colors colors/danger-50 colors/danger-60) (colors/theme-colors colors/neutral-50 colors/neutral-40))) -(defn action [{:keys [icon - label - sub-label - right-icon - danger? - on-press] :as action-props}] - (when action-props - [rn/touchable-opacity {:on-press on-press} - [rn/view {:style - {:height (if sub-label 56 47) - :margin-horizontal 20 - :flex-direction :row}} - [rn/view {:style - {:height 20 - :margin-top :auto - :margin-bottom :auto - :margin-right 12 - :width 20}} - [icon/icon icon - {:color (get-icon-color danger?) - :size 20}]] - [rn/view - {:style - {:flex 1 - :justify-content :center}} - [text/text - {:size :paragraph-1 - :weight :medium - :style {:color - (when danger? - (colors/theme-colors colors/danger-50 colors/danger-60))}} - label] - (when sub-label - [text/text - {:size :paragraph-2 - :style {:color - (colors/theme-colors colors/neutral-50 colors/neutral-40)}} - sub-label])] - (when right-icon - [rn/view {:style - {:height 20 - :margin-top :auto - :margin-bottom :auto - :width 20}} - [icon/icon right-icon - {:color (get-icon-color danger?) - :size 20}]])]])) - (defn divider [] [rn/view {:style {:border-top-width 1 :border-top-color (colors/theme-colors colors/neutral-10 colors/neutral-80) @@ -65,10 +17,60 @@ :align-items :center :flex-direction :row}}]) +(defn action [{:keys [icon + label + sub-label + right-icon + danger? + on-press + add-divider?] :as action-props}] + (when action-props + [:<> {:key label} + (when add-divider? [divider]) + [rn/touchable-opacity {:on-press on-press} + [rn/view {:style + {:height (if sub-label 56 47) + :margin-horizontal 20 + :flex-direction :row}} + [rn/view {:style + {:height 20 + :margin-top :auto + :margin-bottom :auto + :margin-right 12 + :width 20}} + [icon/icon icon + {:color (get-icon-color danger?) + :size 20}]] + [rn/view + {:style + {:flex 1 + :justify-content :center}} + [text/text + {:size :paragraph-1 + :weight :medium + :style {:color + (when danger? + (colors/theme-colors colors/danger-50 colors/danger-60))}} + label] + (when sub-label + [text/text + {:size :paragraph-2 + :style {:color + (colors/theme-colors colors/neutral-50 colors/neutral-40)}} + sub-label])] + (when right-icon + [rn/view {:style + {:height 20 + :margin-top :auto + :margin-bottom :auto + :width 20}} + [icon/icon right-icon + {:color (get-icon-color danger?) + :size 20}]])]]])) + (defn action-drawer [sections] - [:<> {:style - {:flex 1}} - (interpose - [divider] + [:<> + (doall (for [actions sections] - (map action actions)))]) + (doall + (map action actions))))]) diff --git a/src/quo2/components/icons/icons.clj b/src/quo2/components/icons/icons.clj index 7fbe9b0a21..1bf6fb833a 100644 --- a/src/quo2/components/icons/icons.clj +++ b/src/quo2/components/icons/icons.clj @@ -30,4 +30,5 @@ (get-icons 12) (get-icons 16) (get-icons 20) - (get-icons 24))) + (get-icons 24) + (get-icons 32))) diff --git a/src/react_native/navigation.cljs b/src/react_native/navigation.cljs index 7e7f2d81ee..9c756455b3 100644 --- a/src/react_native/navigation.cljs +++ b/src/react_native/navigation.cljs @@ -27,6 +27,9 @@ (defn show-overlay [comp] (.showOverlay Navigation (clj->js comp))) +(defn pop-to-root [tab] + (.popToRoot Navigation (clj->js tab))) + (defn dissmiss-overlay [comp] (.catch (.dismissOverlay Navigation comp) #())) diff --git a/src/status_im/ui2/screens/chat/actions.cljs b/src/status_im/ui2/screens/chat/actions.cljs index 640a881aa7..03f5d1ec0d 100644 --- a/src/status_im/ui2/screens/chat/actions.cljs +++ b/src/status_im/ui2/screens/chat/actions.cljs @@ -8,18 +8,19 @@ [status-im.constants :as constants] [quo2.components.drawers.action-drawers :as drawer])) -(defn- entry [{:keys [icon label on-press danger? sub-label chevron?]}] +(defn- entry [{:keys [icon label on-press danger? sub-label chevron? add-divider?]}] {:pre [(keyword? icon) (string? label) (fn? on-press) (boolean? danger?) (boolean? chevron?)]} - {:icon icon - :label label - :on-press on-press - :danger? danger? - :sub-label sub-label - :right-icon (when chevron? :i/chevron-right)}) + {:icon icon + :label label + :on-press on-press + :danger? danger? + :sub-label sub-label + :right-icon (when chevron? :i/chevron-right) + :add-divider? add-divider?}) (defn hide-sheet-and-dispatch [event] (rf/dispatch [:bottom-sheet/hide]) @@ -91,20 +92,22 @@ :chevron? true}))) (defn mark-as-read-entry [chat-id] - (entry {:icon :i/correct - :label (i18n/label :t/mark-as-read) - :on-press #(mark-all-read-action chat-id) - :danger? false - :sub-label nil - :chevron? false})) + (entry {:icon :i/correct + :label (i18n/label :t/mark-as-read) + :on-press #(mark-all-read-action chat-id) + :danger? false + :sub-label nil + :chevron? false + :add-divider? true})) (defn clear-history-entry [chat-id] - (entry {:icon :i/delete - :label (i18n/label :t/clear-history) - :on-press #(clear-history-action chat-id) - :danger? true - :sub-label nil - :chevron? false})) + (entry {:icon :i/delete + :label (i18n/label :t/clear-history) + :on-press #(clear-history-action chat-id) + :danger? true + :sub-label nil + :chevron? false + :add-divider? true})) (defn delete-chat-entry [item] (entry {:icon :i/delete @@ -203,12 +206,13 @@ :chevron? false})) (defn mark-untrustworthy-entry [] - (entry {:icon :i/alert - :label (i18n/label :t/mark-untrustworthy) - :on-press #(js/alert "TODO: to be implemented, requires status-go impl.") - :danger? true - :sub-label nil - :chevron? false})) + (entry {:icon :i/alert + :label (i18n/label :t/mark-untrustworthy) + :on-press #(js/alert "TODO: to be implemented, requires status-go impl.") + :danger? true + :sub-label nil + :chevron? false + :add-divider? true})) (defn block-user-entry [item] (entry {:icon :i/block diff --git a/src/status_im/ui2/screens/chat/components/message_home_item/view.cljs b/src/status_im/ui2/screens/chat/components/message_home_item/view.cljs index 77715e6428..47074a86a2 100644 --- a/src/status_im/ui2/screens/chat/components/message_home_item/view.cljs +++ b/src/status_im/ui2/screens/chat/components/message_home_item/view.cljs @@ -91,9 +91,9 @@ (if group-chat [quo2/group-avatar {:color color :size :medium}] - [quo2/user-avatar {:full-name display-name - :profile-picture photo-path - :size :small}])) + [quo2/user-avatar {:full-name display-name + :profile-picture photo-path + :size :small}])) (defn messages-home-item [item] (let [{:keys [chat-id diff --git a/src/status_im/ui2/screens/chat/components/reply.cljs b/src/status_im/ui2/screens/chat/components/reply.cljs index 0762ecb2b5..5b9ee199d7 100644 --- a/src/status_im/ui2/screens/chat/components/reply.cljs +++ b/src/status_im/ui2/screens/chat/components/reply.cljs @@ -68,11 +68,11 @@ :size :label :weight :regular :accessibility-label :quoted-message + :ellipsize-mode :tail :style (merge - {:ellipsize-mode :tail - :text-transform :none - :margin-left 4 - :margin-top 2} + {:text-transform :none + :margin-left 4 + :margin-top 2} (when (or (= constants/content-type-image content-type) (= constants/content-type-sticker content-type) (= constants/content-type-audio content-type)) diff --git a/src/status_im/ui2/screens/chat/home.cljs b/src/status_im/ui2/screens/chat/home.cljs index bd50a9a7de..6af3939c60 100644 --- a/src/status_im/ui2/screens/chat/home.cljs +++ b/src/status_im/ui2/screens/chat/home.cljs @@ -195,7 +195,7 @@ {:id :sent :label (i18n/label :t/sent)}]}] [list/flat-list - {:key-fn :first + {:key-fn :chat-id :data (if (= @selected-requests-tab :received) received-requests sent-requests) :render-fn received-cr-item/received-cr-item}]]))]) diff --git a/src/status_im2/navigation/core.cljs b/src/status_im2/navigation/core.cljs index 24d26dea3c..df03f7651b 100644 --- a/src/status_im2/navigation/core.cljs +++ b/src/status_im2/navigation/core.cljs @@ -325,3 +325,8 @@ :change-root-status-bar-style-fx (fn [style] (navigation/merge-options "shell-stack" {:statusBar {:style style}}))) + +(re-frame/reg-fx + :pop-to-root-tab-fx + (fn [tab] + (navigation/pop-to-root tab))) diff --git a/src/status_im2/navigation/events.cljs b/src/status_im2/navigation/events.cljs index bf2e9ce0b9..249baa69d9 100644 --- a/src/status_im2/navigation/events.cljs +++ b/src/status_im2/navigation/events.cljs @@ -40,7 +40,8 @@ (rf/defn change-tab {:events [:navigate-change-tab]} [_ tab] - {:change-tab-fx tab}) + ;{:change-tab-fx tab} ; TODO: effect needs to be implemented (may not be possible: https://github.com/wix/react-native-navigation/issues/4837) + ) (rf/defn navigate-replace {:events [:navigate-replace]} diff --git a/src/status_im2/setup/dev.cljs b/src/status_im2/setup/dev.cljs index 89f75969fb..6ea9afca40 100644 --- a/src/status_im2/setup/dev.cljs +++ b/src/status_im2/setup/dev.cljs @@ -4,7 +4,24 @@ [status-im.ethereum.json-rpc :as json-rpc] ["react-native" :refer (DevSettings LogBox)])) -(.ignoreAllLogs LogBox) +;; Only ignore warnings/errors that cannot be fixed for the time being. +;; When you add a warning to be ignored explain below why it is ignored and how it can be fixed. +;; When a warning is fixed make sure to remove it from here. +(.ignoreLogs ^js LogBox (clj->js ["undefined is not an object (evaluating 'e.message')" + "Cannot read property 'message' of undefined" + "InternalError Metro has encountered an error" + "undefined Unable to resolve module `parse-svg-path`" + "group12"])) + +;; List of ignored warnings/errors: +;; 1. "evaluating 'e.message'": Not sure why this error is happening, but it is coming from here +;; @walletconnect/jsonrpc-utils/dist/esm/error.js parseConnectionError() method +;; 2. "Cannot read property 'message' of undefined": same as 1, but for Android +;; 3. "InternalError Metro has encountered an error": an error that happens when losing connection to metro, can be safely ignored +;; 4. "undefined Unable to resolve module `parse-svg-path`": an error that happens when losing connection to metro, can be safely ignored +;; 5. "group12": referring to the group-icon size 12x12. Currently, it is not available. When the design team adds it to the +;; icon set it will be added to project. + (defn setup [] (rf/set-mergeable-keys #{:filters/load-filters