Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: notification center blur #19861

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/quo/components/notifications/activity_log/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
[quo.components.notifications.activity-log.style :as style]
[quo.components.tags.status-tags :as status-tags]
[quo.foundations.colors :as colors]
[quo.theme]
[react-native.core :as rn]
[utils.i18n :as i18n]))

Expand Down Expand Up @@ -144,12 +145,13 @@
label]))

(defmethod footer-item-view :status
[{:keys [label subtype blur?]} _ _]
[status-tags/status-tag
{:size :small
:label label
:status {:type subtype}
:blur? blur?}])
[{:keys [label subtype blur? theme]} _ _]
[quo.theme/provider theme
[status-tags/status-tag
{:size :small
:label label
:status {:type subtype}
:blur? blur?}]])

(defn- footer
[{:keys [replying? items] :as props}]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
child)))

(defn- outgoing-contact-request-view
[{:keys [notification set-swipeable-height customization-color]}]
[{:keys [notification set-swipeable-height customization-color]} theme]
(let [{:keys [chat-id message last-message accepted]} notification
{:keys [contact-request-state] :as message} (or message last-message)]
(if accepted
Expand Down Expand Up @@ -89,19 +89,20 @@
:subtype :pending
:key :status-pending
:blur? true
:label (i18n/label :t/pending)}]
:label (i18n/label :t/pending)
:theme theme}]

constants/contact-request-message-state-declined
[{:type :status
:subtype :pending
:key :status-pending
:blur? true
:label (i18n/label :t/pending)}]

:label (i18n/label :t/pending)
:theme theme}]
nil)}])))

(defn- incoming-contact-request-view
[{:keys [notification set-swipeable-height customization-color]}]
[{:keys [notification set-swipeable-height customization-color]} theme]
(let [{:keys [id author message last-message]} notification
message (or message last-message)]
[quo/activity-log
Expand All @@ -122,14 +123,16 @@
:subtype :positive
:key :status-accepted
:blur? true
:label (i18n/label :t/accepted)}]
:label (i18n/label :t/accepted)
:theme theme}]

constants/contact-request-message-state-declined
[{:type :status
:subtype :negative
:key :status-declined
:blur? true
:label (i18n/label :t/declined)}]
:label (i18n/label :t/declined)
:theme theme}]

constants/contact-request-message-state-pending
[{:type :button
Expand All @@ -151,18 +154,19 @@
[{:keys [notification] :as props}]
(let [{:keys [author message last-message]} notification
{:keys [public-key]} (rf/sub [:multiaccount/contact])
{:keys [contact-request-state]} (or message last-message)]
{:keys [contact-request-state]} (or message last-message)
app-theme (rf/sub [:theme])]
[swipeable props
(cond
(= public-key author)
[outgoing-contact-request-view props]
[outgoing-contact-request-view props app-theme]

(= contact-request-state constants/contact-request-message-state-accepted)
[gesture/touchable-without-feedback
{:on-press (fn []
(rf/dispatch [:hide-popover])
(rf/dispatch [:chat.ui/start-chat author]))}
[incoming-contact-request-view props]]
[incoming-contact-request-view props app-theme]]

:else
[incoming-contact-request-view props])]))
[incoming-contact-request-view props app-theme])]))
2 changes: 1 addition & 1 deletion src/status_im/contexts/shell/activity_center/style.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@

(def blur
{:style {:position :absolute :top 0 :left 0 :right 0 :bottom 0}
:overlayColor colors/neutral-80-opa-80
:overlayColor colors/neutral-80-opa-80-blur
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

:blur-amount 20})
29 changes: 15 additions & 14 deletions src/status_im/contexts/shell/activity_center/view.cljs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(ns status-im.contexts.shell.activity-center.view
(:require
[oops.core :as oops]
[react-native.blur :as blur]
[quo.core :as quo]
[react-native.core :as rn]
[react-native.navigation :as navigation]
[status-im.contexts.shell.activity-center.header.view :as header]
Expand Down Expand Up @@ -67,16 +67,17 @@
(fn []
(let [notifications (rf/sub [:activity-center/notifications])
customization-color (rf/sub [:profile/customization-color])]
[rn/view {:flex 1 :padding-top (navigation/status-bar-height)}
[blur/view style/blur]
[header/header]
[rn/flat-list
{:data notifications
:render-data {:active-swipeable active-swipeable
:customization-color customization-color}
:content-container-style {:flex-grow 1}
:empty-component [empty-tab/empty-tab]
:key-fn :id
:on-scroll-to-index-failed identity
:on-end-reached #(rf/dispatch [:activity-center.notifications/fetch-next-page])
:render-fn notification-component}]]))))
[quo/overlay {:type :shell}
[rn/view {:flex 1 :padding-top (navigation/status-bar-height)}
[header/header]
[rn/flat-list
{:data notifications
:render-data {:active-swipeable active-swipeable
:customization-color customization-color}
:content-container-style {:flex-grow 1}
:empty-component [empty-tab/empty-tab]
:key-fn :id
:on-scroll-to-index-failed identity
:on-end-reached #(rf/dispatch [:activity-center.notifications/fetch-next-page])
:render-fn notification-component}]]
]))))