Activity Center UI Fixes (#14244)

* [Fixes] Activity Center UI Issues

* [Chore] Lint Fixes
This commit is contained in:
Mohamed Javid 2022-10-27 17:50:03 +05:30 committed by GitHub
parent f29ed58445
commit 6d557d735a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 19 deletions

View File

@ -41,6 +41,7 @@
(re-frame/dispatch [:mark-all-activity-center-notifications-as-read]) (re-frame/dispatch [:mark-all-activity-center-notifications-as-read])
(if config/new-activity-center-enabled? (if config/new-activity-center-enabled?
(re-frame/dispatch [:show-popover {:view :activity-center (re-frame/dispatch [:show-popover {:view :activity-center
:style {:margin 0}
:disable-touchable-overlay? true :disable-touchable-overlay? true
:blur-view? true :blur-view? true
:blur-view-props {:blur-amount 20 :blur-view-props {:blur-amount 20

View File

@ -1,5 +1,6 @@
(ns status-im.ui.screens.activity-center.views (ns status-im.ui.screens.activity-center.views
(:require [quo.components.animated.pressable :as animation] (:require [quo.components.animated.pressable :as animation]
[quo.react :as react]
[quo.react-native :as rn] [quo.react-native :as rn]
[quo2.components.buttons.button :as button] [quo2.components.buttons.button :as button]
[quo2.components.markdown.text :as text] [quo2.components.markdown.text :as text]
@ -7,7 +8,6 @@
[quo2.components.tabs.tabs :as tabs] [quo2.components.tabs.tabs :as tabs]
[quo2.components.tags.context-tags :as context-tags] [quo2.components.tags.context-tags :as context-tags]
[quo2.foundations.colors :as colors] [quo2.foundations.colors :as colors]
[reagent.core :as reagent]
[status-im.constants :as constants] [status-im.constants :as constants]
[status-im.i18n.i18n :as i18n] [status-im.i18n.i18n :as i18n]
[status-im.multiaccounts.core :as multiaccounts] [status-im.multiaccounts.core :as multiaccounts]
@ -197,7 +197,7 @@
:type :blur-bg :type :blur-bg
:size 32 :size 32
:override-theme :dark :override-theme :dark
:style {:margin-vertical 12 :style {:margin-bottom 12
:margin-left screen-padding} :margin-left screen-padding}
:on-press #(>evt [:hide-popover])} :on-press #(>evt [:hide-popover])}
:main-icons2/close] :main-icons2/close]
@ -219,19 +219,20 @@
(defn activity-center (defn activity-center
[] []
(reagent/create-class [:f>
{:component-did-mount #(>evt [:activity-center.notifications/fetch-first-page]) (fn []
:reagent-render (let [notifications (<sub [:activity-center/filtered-notifications])
(fn [] window-width (<sub [:dimensions/window-width])
(let [notifications (<sub [:activity-center/filtered-notifications]) {:keys [top bottom]} (safe-area/use-safe-area)]
window-width (<sub [:dimensions/window-width])] (react/effect! #(>evt [:activity-center.notifications/fetch-first-page]))
[safe-area/view {:style {:flex 1}} [rn/view {:style {:flex 1
[rn/view {:style {:width window-width :width window-width
:flex 1}} :padding-top (if (pos? top) (+ top 12) 12)
[header] :padding-bottom bottom}}
[rn/flat-list {:content-container-style {:flex-grow 1} [header]
:data notifications [rn/flat-list {:content-container-style {:flex-grow 1}
:empty-component [empty-tab] :data notifications
:key-fn :id :empty-component [empty-tab]
:on-end-reached #(>evt [:activity-center.notifications/fetch-next-page]) :key-fn :id
:render-fn render-notification}]]]))})) :on-end-reached #(>evt [:activity-center.notifications/fetch-next-page])
:render-fn render-notification}]]))])

View File

@ -258,6 +258,7 @@
(re-frame/dispatch [:mark-all-activity-center-notifications-as-read]) (re-frame/dispatch [:mark-all-activity-center-notifications-as-read])
(if config/new-activity-center-enabled? (if config/new-activity-center-enabled?
(re-frame/dispatch [:show-popover {:view :activity-center (re-frame/dispatch [:show-popover {:view :activity-center
:style {:margin 0}
:disable-touchable-overlay? true :disable-touchable-overlay? true
:blur-view? true :blur-view? true
:blur-view-props {:blur-amount 20 :blur-view-props {:blur-amount 20

View File

@ -338,7 +338,12 @@
:on-press #(do :on-press #(do
(re-frame/dispatch [:mark-all-activity-center-notifications-as-read]) (re-frame/dispatch [:mark-all-activity-center-notifications-as-read])
(if config/new-activity-center-enabled? (if config/new-activity-center-enabled?
(re-frame/dispatch [:navigate-to :activity-center]) (re-frame/dispatch [:show-popover {:view :activity-center
:style {:margin 0}
:disable-touchable-overlay? true
:blur-view? true
:blur-view-props {:blur-amount 20
:blur-type :dark}}])
(re-frame/dispatch [:navigate-to :notifications-center])))} (re-frame/dispatch [:navigate-to :notifications-center])))}
[icons/icon :main-icons/notification2 {:color (colors/theme-colors colors/neutral-100 colors/white)}]] [icons/icon :main-icons/notification2 {:color (colors/theme-colors colors/neutral-100 colors/white)}]]
(when (pos? notif-count) (when (pos? notif-count)