diff --git a/docs/src/about_goals.md b/docs/src/about_goals.md index 1463eeb07..0d666f4f1 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 bee9e538f..a4aecfa01 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/comment-node.tsx b/ui/src/components/comment-node.tsx index 8809c5b74..b2d041506 100644 --- a/ui/src/components/comment-node.tsx +++ b/ui/src/components/comment-node.tsx @@ -66,6 +66,7 @@ interface CommentNodeProps { viewOnly?: boolean; locked?: boolean; markable?: boolean; + showContext?: boolean; moderators: Array; admins: Array; // TODO is this necessary, can't I get it from the node itself? @@ -166,17 +167,17 @@ export class CommentNode extends Component { {this.isMod && ( -
  • +
  • {i18n.t('mod')}
  • )} {this.isAdmin && ( -
  • +
  • {i18n.t('admin')}
  • )} {this.isPostCreator && ( -
  • +
  • {i18n.t('creator')}
  • )} @@ -209,8 +210,7 @@ export class CommentNode extends Component { )} -
  • -
  • +
  • { /> )}
      + {this.props.showContext && this.linkBtn} {this.props.markable && (
    • - {this.props.markable && this.linkBtn} {!this.state.showAdvanced ? (
    • )} - {!this.props.markable && this.linkBtn} + {!this.props.showContext && this.linkBtn}
    )} {this.selects()} - {this.state.unreadType == UnreadType.All && this.all()} - {this.state.unreadType == UnreadType.Replies && this.replies()} - {this.state.unreadType == UnreadType.Mentions && this.mentions()} - {this.state.unreadType == UnreadType.Messages && this.messages()} + {this.state.messageType == MessageType.All && this.all()} + {this.state.messageType == MessageType.Replies && this.replies()} + {this.state.messageType == MessageType.Mentions && this.mentions()} + {this.state.messageType == MessageType.Messages && this.messages()} {this.paginator()} @@ -150,29 +141,103 @@ export class Inbox extends Component { ); } + unreadOrAllRadios() { + return ( +
    + + +
    + ); + } + + messageTypeRadios() { + return ( +
    + + + + +
    + ); + } + selects() { return (
    - - + {this.unreadOrAllRadios()} + {this.messageTypeRadios()} {
    {combined.map(i => isCommentType(i) ? ( - + ) : ( ) @@ -212,6 +282,7 @@ export class Inbox extends Component { nodes={commentsToFlatNodes(this.state.replies)} noIndent markable + showContext />
    ); @@ -221,7 +292,12 @@ export class Inbox extends Component { return (
    {this.state.mentions.map(mention => ( - + ))}
    ); @@ -277,8 +353,8 @@ export class Inbox extends Component { i.refetch(); } - handleUnreadTypeChange(i: Inbox, event: any) { - i.state.unreadType = Number(event.target.value); + handleMessageTypeChange(i: Inbox, event: any) { + i.state.messageType = Number(event.target.value); i.state.page = 1; i.setState(i.state); i.refetch(); diff --git a/ui/src/components/navbar.tsx b/ui/src/components/navbar.tsx index ef3f84309..ea9b619b8 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} + + )} + + )}
  • @@ -555,7 +555,7 @@ export class PostListing extends Component { <>