fix: remove hole view code with error (#17164)
This commit is contained in:
parent
857c9c2f74
commit
72455877bd
|
@ -5,33 +5,8 @@
|
||||||
[quo2.components.counter.counter.view :as counter]
|
[quo2.components.counter.counter.view :as counter]
|
||||||
[quo2.components.navigation.top-nav.style :as style]
|
[quo2.components.navigation.top-nav.style :as style]
|
||||||
[quo2.theme :as quo.theme]
|
[quo2.theme :as quo.theme]
|
||||||
[react-native.hole-view :as hole-view]
|
|
||||||
[quo2.components.common.notification-dot.view :as notification-dot]))
|
[quo2.components.common.notification-dot.view :as notification-dot]))
|
||||||
|
|
||||||
(def notification-dot-hole
|
|
||||||
[{:x 37
|
|
||||||
:y -2
|
|
||||||
:width 9
|
|
||||||
:height 9
|
|
||||||
:borderRadius 4}])
|
|
||||||
|
|
||||||
(defn unread-counter-hole
|
|
||||||
[notification-count]
|
|
||||||
(let [x (case (count (str notification-count))
|
|
||||||
(1 2) 33
|
|
||||||
29)
|
|
||||||
width (case (count (str notification-count))
|
|
||||||
1 16
|
|
||||||
2 20
|
|
||||||
28)]
|
|
||||||
(if (pos? (js/Number notification-count))
|
|
||||||
[{:x x
|
|
||||||
:y -5
|
|
||||||
:width width
|
|
||||||
:height 16
|
|
||||||
:borderRadius 6}]
|
|
||||||
nil)))
|
|
||||||
|
|
||||||
(defn- get-button-common-props
|
(defn- get-button-common-props
|
||||||
[{:keys [jump-to? theme blur?]}]
|
[{:keys [jump-to? theme blur?]}]
|
||||||
{:icon-only? true
|
{:icon-only? true
|
||||||
|
@ -90,8 +65,6 @@
|
||||||
[{:keys [theme
|
[{:keys [theme
|
||||||
jump-to?
|
jump-to?
|
||||||
blur?
|
blur?
|
||||||
notification
|
|
||||||
notification-count
|
|
||||||
activity-center-on-press
|
activity-center-on-press
|
||||||
scan-on-press
|
scan-on-press
|
||||||
qr-code-on-press
|
qr-code-on-press
|
||||||
|
@ -122,17 +95,12 @@
|
||||||
:on-press qr-code-on-press})
|
:on-press qr-code-on-press})
|
||||||
:i/qr-code]
|
:i/qr-code]
|
||||||
[rn/view
|
[rn/view
|
||||||
[hole-view/hole-view
|
[button/button
|
||||||
{:holes (case notification
|
(merge button-common-props
|
||||||
(:seen :notification) notification-dot-hole
|
{:accessibility-label :open-activity-center-button
|
||||||
(:mention :mention-seen) (unread-counter-hole notification-count)
|
:on-press activity-center-on-press})
|
||||||
nil)}
|
:i/activity-center]]
|
||||||
[button/button
|
[notification-highlight props]]))
|
||||||
(merge button-common-props
|
|
||||||
{:accessibility-label :open-activity-center-button
|
|
||||||
:on-press activity-center-on-press})
|
|
||||||
:i/activity-center]]
|
|
||||||
[notification-highlight props]]]))
|
|
||||||
|
|
||||||
(defn view-internal
|
(defn view-internal
|
||||||
[{:keys [avatar-on-press avatar-props customization-color container-style] :as props}]
|
[{:keys [avatar-on-press avatar-props customization-color container-style] :as props}]
|
||||||
|
|
Loading…
Reference in New Issue