-
Notifications
You must be signed in to change notification settings - Fork 984
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Notification Centre - add Empty Content screen
resolve commit refactor folders resolve commits fix lint issue
- Loading branch information
Showing
7 changed files
with
193 additions
and
154 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
src/status_im2/contexts/shell/activity_center/drawer/view.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
(ns status-im2.contexts.shell.activity-center.drawer.view | ||
(:require [utils.re-frame :as rf] | ||
[quo2.core :as quo] | ||
[utils.i18n :as i18n] | ||
[quo2.foundations.colors :as colors])) | ||
|
||
(defn options | ||
[] | ||
(let [unread-count (rf/sub [:activity-center/unread-count])] | ||
[quo/action-drawer | ||
[[{:icon :i/mark-as-read | ||
:override-theme :dark | ||
:label (i18n/label :t/mark-all-notifications-as-read) | ||
:disabled? (zero? unread-count) | ||
:on-press (fn [] | ||
(rf/dispatch [:activity-center.notifications/mark-all-as-read-locally | ||
(fn [] | ||
{:icon :up-to-date | ||
:icon-color colors/success-50 | ||
:text (i18n/label :t/notifications-marked-as-read | ||
{:count unread-count}) | ||
:override-theme :dark})]) | ||
(rf/dispatch [:hide-bottom-sheet]))}]]])) |
53 changes: 53 additions & 0 deletions
53
src/status_im2/contexts/shell/activity_center/header/view.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
(ns status-im2.contexts.shell.activity-center.header.view | ||
(:require [react-native.core :as rn] | ||
[status-im2.contexts.shell.activity-center.style :as style] | ||
[quo2.core :as quo] | ||
[utils.re-frame :as rf] | ||
[utils.i18n :as i18n] | ||
[status-im2.contexts.shell.activity-center.tabs.view :as tabs] | ||
[status-im2.contexts.shell.activity-center.drawer.view :as drawer])) | ||
|
||
(defn filter-selector-read-toggle | ||
[] | ||
(let [unread-filter-enabled? (rf/sub [:activity-center/filter-status-unread-enabled?])] | ||
[quo/filter | ||
{:pressed? unread-filter-enabled? | ||
:blur? true | ||
:override-theme :dark | ||
:on-press-out #(rf/dispatch [:activity-center.notifications/fetch-first-page | ||
{:filter-status (if unread-filter-enabled? | ||
:all | ||
:unread)}])}])) | ||
|
||
(defn header | ||
[] | ||
[rn/view | ||
[rn/view {:style style/header-container} | ||
[quo/button | ||
{:icon true | ||
:type :blur-bg | ||
:size 32 | ||
:accessibility-label :close-activity-center | ||
:override-theme :dark | ||
:on-press #(rf/dispatch [:navigate-back])} | ||
:i/close] | ||
[quo/button | ||
{:icon true | ||
:type :blur-bg | ||
:size 32 | ||
:accessibility-label :activity-center-open-more | ||
:override-theme :dark | ||
:on-press #(rf/dispatch [:show-bottom-sheet | ||
{:content drawer/options | ||
:override-theme :dark}])} | ||
:i/options]] | ||
[quo/text | ||
{:size :heading-1 | ||
:weight :semi-bold | ||
:style style/header-heading} | ||
(i18n/label :t/notifications)] | ||
[rn/view {:style style/tabs-and-filter-container} | ||
[rn/view {:style style/tabs-container} | ||
[tabs/tabs]] | ||
[rn/view {:style style/filter-toggle-container} | ||
[filter-selector-read-toggle]]]]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/status_im2/contexts/shell/activity_center/tabs/empty_tab/view.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
(ns status-im2.contexts.shell.activity-center.tabs.empty-tab.view | ||
(:require [utils.re-frame :as rf] | ||
[react-native.core :as rn] | ||
[quo2.core :as quo] | ||
[status-im2.contexts.shell.activity-center.style :as style] | ||
[utils.i18n :as i18n] | ||
[status-im2.contexts.shell.activity-center.notification-types :as types] | ||
[status-im2.common.resources :as resources])) | ||
|
||
(def empty-tab-description | ||
{types/no-type (i18n/label :t/empty-notifications-all-tab) | ||
types/admin (i18n/label :t/empty-notifications-admin-tab) | ||
types/mention (i18n/label :t/empty-notifications-mentions-tab) | ||
types/reply (i18n/label :t/empty-notifications-replies-tab) | ||
types/contact-request (i18n/label :t/empty-notifications-contact-requests-tab) | ||
types/contact-verification (i18n/label :t/empty-notifications-identity-verification-tab) | ||
types/tx (i18n/label :t/empty-notifications-transactions-tab) | ||
types/membership (i18n/label :t/empty-notifications-membership-tab) | ||
types/system (i18n/label :t/empty-notifications-system-tab)}) | ||
|
||
(defn empty-tab | ||
[] | ||
(let [filter-type (rf/sub [:activity-center/filter-type]) | ||
description (get empty-tab-description filter-type nil)] | ||
[rn/view {:style style/empty-container} | ||
[quo/empty-state | ||
{:blur? true | ||
:image (resources/get-image :no-notifications-dark) | ||
:title (i18n/label :t/empty-notifications-title-unread) | ||
:description description}]])) |
68 changes: 68 additions & 0 deletions
68
src/status_im2/contexts/shell/activity_center/tabs/view.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
(ns status-im2.contexts.shell.activity-center.tabs.view | ||
(:require [utils.re-frame :as rf] | ||
[quo2.core :as quo] | ||
[status-im2.contexts.shell.activity-center.style :as style] | ||
[status-im2.contexts.shell.activity-center.notification-types :as types] | ||
[clojure.set :as set] | ||
[utils.i18n :as i18n])) | ||
|
||
(defn tabs | ||
[] | ||
(let [filter-type (rf/sub [:activity-center/filter-type]) | ||
types-with-unread (rf/sub [:activity-center/notification-types-with-unread]) | ||
is-mark-all-as-read-undoable? (boolean (rf/sub | ||
[:activity-center/mark-all-as-read-undoable-till]))] | ||
[quo/tabs | ||
{:size 32 | ||
:scrollable? true | ||
:blur? true | ||
:style style/tabs | ||
:fade-end-percentage 0.79 | ||
:scroll-on-press? true | ||
:fade-end? true | ||
:on-change #(rf/dispatch [:activity-center.notifications/fetch-first-page | ||
{:filter-type %}]) | ||
:default-active filter-type | ||
:data [{:id types/no-type | ||
:label (i18n/label :t/all)} | ||
{:id types/admin | ||
:label (i18n/label :t/admin) | ||
:accessibility-label :tab-admin | ||
:notification-dot? (when-not is-mark-all-as-read-undoable? | ||
(contains? types-with-unread types/admin))} | ||
{:id types/mention | ||
:label (i18n/label :t/mentions) | ||
:accessibility-label :tab-mention | ||
:notification-dot? (when-not is-mark-all-as-read-undoable? | ||
(contains? types-with-unread types/mention))} | ||
{:id types/reply | ||
:label (i18n/label :t/replies) | ||
:accessibility-label :tab-reply | ||
:notification-dot? (when-not is-mark-all-as-read-undoable? | ||
(contains? types-with-unread types/reply))} | ||
{:id types/contact-request | ||
:label (i18n/label :t/contact-requests) | ||
:accessibility-label :tab-contact-request | ||
:notification-dot? (when-not is-mark-all-as-read-undoable? | ||
(contains? types-with-unread types/contact-request))} | ||
{:id types/contact-verification | ||
:label (i18n/label :t/identity-verification) | ||
:accessibility-label :tab-contact-verification | ||
:notification-dot? (when-not is-mark-all-as-read-undoable? | ||
(contains? types-with-unread | ||
types/contact-verification))} | ||
{:id types/tx | ||
:label (i18n/label :t/transactions) | ||
:accessibility-label :tab-tx | ||
:notification-dot? (when-not is-mark-all-as-read-undoable? | ||
(contains? types-with-unread types/tx))} | ||
{:id types/membership | ||
:label (i18n/label :t/membership) | ||
:accessibility-label :tab-membership | ||
:notification-dot? (when-not is-mark-all-as-read-undoable? | ||
(set/subset? types/membership types-with-unread))} | ||
{:id types/system | ||
:label (i18n/label :t/system) | ||
:accessibility-label :tab-system | ||
:notification-dot? (when-not is-mark-all-as-read-undoable? | ||
(contains? types-with-unread types/system))}]}])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters