From d67ef4aaf2696182d9333d809cb264ac1dd22e38 Mon Sep 17 00:00:00 2001 From: Nicolas Constant Date: Fri, 2 Oct 2020 23:58:43 -0400 Subject: [PATCH] creation of follow-request UI --- .../notification/notification.component.html | 31 +++++++++++++ .../notification/notification.component.scss | 43 ++++++++++++++++++- .../notification/notification.component.ts | 15 ++++++- .../notifications/notifications.component.ts | 2 +- .../stream-notifications.component.ts | 2 + .../services/models/mastodon.interfaces.ts | 2 +- 6 files changed, 90 insertions(+), 5 deletions(-) diff --git a/src/app/components/floating-column/manage-account/notifications/notification/notification.component.html b/src/app/components/floating-column/manage-account/notifications/notification/notification.component.html index bc3f23ea..3eaa2c41 100644 --- a/src/app/components/floating-column/manage-account/notifications/notification/notification.component.html +++ b/src/app/components/floating-column/manage-account/notifications/notification/notification.component.html @@ -1,4 +1,35 @@
+
+
+ +
+
+ + submited a follow request +
+ + + + +
+ +
diff --git a/src/app/components/floating-column/manage-account/notifications/notification/notification.component.scss b/src/app/components/floating-column/manage-account/notifications/notification/notification.component.scss index 0b156f04..b33d4130 100644 --- a/src/app/components/floating-column/manage-account/notifications/notification/notification.component.scss +++ b/src/app/components/floating-column/manage-account/notifications/notification/notification.component.scss @@ -46,6 +46,7 @@ color: $boost-color; } +$acccount-info-left: 70px; .follow-account { padding: 5px; height: 60px; @@ -62,8 +63,7 @@ height: 45px; border-radius: 2px; } - - $acccount-info-left: 70px; + &__display-name { position: absolute; top: 7px; @@ -81,5 +81,44 @@ left: $acccount-info-left; font-size: 13px; color: $status-links-color; + + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + + width: calc(100% - #{$acccount-info-left}); + } +} + +.follow_request { + width: calc(100% - #{$acccount-info-left}); + margin-left: $acccount-info-left; + + &__link { + display: inline-block; + width: calc(50%); + padding: 2px; + + text-align: center; + color: rgb(219, 219, 219); + transition: all .2s; + + // outline: 1px dotted greenyellow; + + &--check { + &:hover { + color: greenyellow; + } + } + + &--cross { + &:hover { + color: orangered; + } + } + } + + &__icon { + text-align: center; } } \ No newline at end of file diff --git a/src/app/components/floating-column/manage-account/notifications/notification/notification.component.ts b/src/app/components/floating-column/manage-account/notifications/notification/notification.component.ts index 48505220..48f623ed 100644 --- a/src/app/components/floating-column/manage-account/notifications/notification/notification.component.ts +++ b/src/app/components/floating-column/manage-account/notifications/notification/notification.component.ts @@ -1,5 +1,5 @@ import { Component, Input } from '@angular/core'; -import { faUserPlus } from "@fortawesome/free-solid-svg-icons"; +import { faUserPlus, faUserClock, faCheck, faTimes } from "@fortawesome/free-solid-svg-icons"; import { NotificationWrapper } from '../notifications.component'; import { ToolsService } from '../../../../../services/tools.service'; @@ -13,6 +13,9 @@ import { BrowseBase } from '../../../../../components/common/browse-base'; }) export class NotificationComponent extends BrowseBase { faUserPlus = faUserPlus; + faUserClock = faUserClock; + faCheck = faCheck; + faTimes = faTimes; @Input() notification: NotificationWrapper; @@ -36,4 +39,14 @@ export class NotificationComponent extends BrowseBase { window.open(url, '_blank'); return false; } + + acceptFollowRequest(): boolean{ + + return false; + } + + refuseFollowRequest(): boolean{ + + return false; + } } diff --git a/src/app/components/floating-column/manage-account/notifications/notifications.component.ts b/src/app/components/floating-column/manage-account/notifications/notifications.component.ts index c9ab4157..360ea905 100644 --- a/src/app/components/floating-column/manage-account/notifications/notifications.component.ts +++ b/src/app/components/floating-column/manage-account/notifications/notifications.component.ts @@ -164,5 +164,5 @@ export class NotificationWrapper { wrapperId: string; account: Account; status: StatusWrapper; - type: 'mention' | 'reblog' | 'favourite' | 'follow' | 'poll'; + type: 'mention' | 'reblog' | 'favourite' | 'follow' | 'poll' | 'follow_request'; } \ No newline at end of file diff --git a/src/app/components/stream/stream-notifications/stream-notifications.component.ts b/src/app/components/stream/stream-notifications/stream-notifications.component.ts index d31e9306..266d15ec 100644 --- a/src/app/components/stream/stream-notifications/stream-notifications.component.ts +++ b/src/app/components/stream/stream-notifications/stream-notifications.component.ts @@ -128,6 +128,8 @@ export class StreamNotificationsComponent extends BrowseBase { this.mastodonService.getNotifications(this.account, null, null, null, 10) .then((notifications: Notification[]) => { + console.warn(notifications); + this.isNotificationsLoading = false; this.notifications = notifications.map(x => { diff --git a/src/app/services/models/mastodon.interfaces.ts b/src/app/services/models/mastodon.interfaces.ts index 844585e6..7b56c694 100644 --- a/src/app/services/models/mastodon.interfaces.ts +++ b/src/app/services/models/mastodon.interfaces.ts @@ -130,7 +130,7 @@ export interface Mention { export interface Notification { id: string; - type: 'mention' | 'reblog' | 'favourite' | 'follow' | 'poll'; + type: 'mention' | 'reblog' | 'favourite' | 'follow' | 'poll' | 'follow_request'; created_at: string; account: Account; status?: Status;