Fix Metro Warnings ⚠️ (#14389)

* fix: metro warnings ⚠️
This commit is contained in:
Omar Basem 2022-11-17 21:19:54 +04:00 committed by GitHub
parent 84da3128bf
commit 73bbfa7d31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 124 additions and 93 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -126,9 +126,7 @@
: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
[icons/icon :i/identicon-ring {:size outer-dimensions
:no-color true}])
(if profile-picture
;; display image

View File

@ -9,13 +9,24 @@
(colors/theme-colors colors/danger-50 colors/danger-60)
(colors/theme-colors colors/neutral-50 colors/neutral-40)))
(defn divider []
[rn/view {:style {:border-top-width 1
:border-top-color (colors/theme-colors colors/neutral-10 colors/neutral-80)
:margin-top 8
:margin-bottom 7
:align-items :center
:flex-direction :row}}])
(defn action [{:keys [icon
label
sub-label
right-icon
danger?
on-press] :as action-props}]
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)
@ -55,20 +66,11 @@
: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)
:margin-top 8
:margin-bottom 7
:align-items :center
:flex-direction :row}}])
:size 20}]])]]]))
(defn action-drawer [sections]
[:<> {:style
{:flex 1}}
(interpose
[divider]
[:<>
(doall
(for [actions sections]
(map action actions)))])
(doall
(map action actions))))])

View File

@ -30,4 +30,5 @@
(get-icons 12)
(get-icons 16)
(get-icons 20)
(get-icons 24)))
(get-icons 24)
(get-icons 32)))

View File

@ -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) #()))

View File

@ -8,7 +8,7 @@
[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)
@ -19,7 +19,8 @@
:on-press on-press
:danger? danger?
:sub-label sub-label
:right-icon (when chevron? :i/chevron-right)})
:right-icon (when chevron? :i/chevron-right)
:add-divider? add-divider?})
(defn hide-sheet-and-dispatch [event]
(rf/dispatch [:bottom-sheet/hide])
@ -96,7 +97,8 @@
:on-press #(mark-all-read-action chat-id)
:danger? false
:sub-label nil
:chevron? false}))
:chevron? false
:add-divider? true}))
(defn clear-history-entry [chat-id]
(entry {:icon :i/delete
@ -104,7 +106,8 @@
:on-press #(clear-history-action chat-id)
:danger? true
:sub-label nil
:chevron? false}))
:chevron? false
:add-divider? true}))
(defn delete-chat-entry [item]
(entry {:icon :i/delete
@ -208,7 +211,8 @@
:on-press #(js/alert "TODO: to be implemented, requires status-go impl.")
:danger? true
:sub-label nil
:chevron? false}))
:chevron? false
:add-divider? true}))
(defn block-user-entry [item]
(entry {:icon :i/block

View File

@ -68,9 +68,9 @@
:size :label
:weight :regular
:accessibility-label :quoted-message
:ellipsize-mode :tail
:style (merge
{:ellipsize-mode :tail
:text-transform :none
{:text-transform :none
:margin-left 4
:margin-top 2}
(when (or (= constants/content-type-image content-type)

View File

@ -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}]]))])

View File

@ -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)))

View File

@ -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]}

View File

@ -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