From 522649d9d3c21c15cb00740fb8c86a51a64468a4 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 20 Mar 2020 16:13:54 -0400 Subject: [PATCH] Notification improvements. - Adding a navbar notification icon for mobile. - Adding an in-app notification toast. To be improved later. - Fixes #607 --- docs/src/about_goals.md | 2 ++ ui/.eslintrc.json | 1 + ui/src/components/navbar.tsx | 48 +++++++++++++++++++++++++++++------- ui/src/utils.ts | 24 +++++++++++++++++- 4 files changed, 65 insertions(+), 10 deletions(-) diff --git a/docs/src/about_goals.md b/docs/src/about_goals.md index 1463eeb07a1..0d666f4f189 100644 --- a/docs/src/about_goals.md +++ b/docs/src/about_goals.md @@ -47,3 +47,5 @@ - https://docs.rs/activitypub/0.1.4/activitypub/ - [Activitypub vocab.](https://www.w3.org/TR/activitystreams-vocabulary/) - [Activitypub main](https://www.w3.org/TR/activitypub/) +- [Federation.md](https://github.com/dariusk/gathio/blob/7fc93dbe9d4d99457a0e85c6c532112f415b7af2/FEDERATION.md) +- [Activitypub implementers guide](https://socialhub.activitypub.rocks/t/draft-guide-for-new-activitypub-implementers/479) diff --git a/ui/.eslintrc.json b/ui/.eslintrc.json index bee9e538f45..a4aecfa0192 100644 --- a/ui/.eslintrc.json +++ b/ui/.eslintrc.json @@ -38,6 +38,7 @@ "inferno/no-direct-mutation-state": 0, "inferno/no-unknown-property": 0, "max-statements": 0, + "max-params": 0, "new-cap": 0, "no-console": 0, "no-duplicate-imports": 0, diff --git a/ui/src/components/navbar.tsx b/ui/src/components/navbar.tsx index ef3f84309e7..76930e3b59b 100644 --- a/ui/src/components/navbar.tsx +++ b/ui/src/components/navbar.tsx @@ -26,6 +26,8 @@ import { fetchLimit, isCommentType, toast, + messageToastify, + md, } from '../utils'; import { version } from '../version'; import { i18n } from '../i18next'; @@ -100,6 +102,22 @@ export class Navbar extends Component { {this.state.siteName} + {this.state.isLoggedIn && ( + + + + + {this.state.unreadCount > 0 && ( + + {this.state.unreadCount} + + )} + + )}