added following account notification infos #55

This commit is contained in:
Nicolas Constant 2019-04-01 23:54:08 -04:00
parent e6237ca0d3
commit 4541b7b092
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
3 changed files with 58 additions and 7 deletions

View File

@ -23,16 +23,21 @@
<fa-icon class="followed" [icon]="faUserPlus"></fa-icon>
</div>
<div class="stream__notification--label">
<a href class="stream__link">{{ notification.account.display_name }}</a> followed you!
<a href class="stream__link"
(click)="openAccount(notification.account)">{{ notification.account.display_name }}</a> followed
you!
</div>
<a href (click)="openAccount(notification.account)" class="follow-account" title="{{notification.account.acct}}">
<img class="follow-account__avatar" src="{{ notification.account.avatar }}" />
<span class="follow-account__display-name" >{{ notification.account.display_name }}</span>
<span class="follow-account__acct">@{{ notification.account.acct }}</span>
</a>
</div>
<app-status *ngIf="notification.status" class="stream__status"
[statusWrapper]="notification.status"
[notificationAccount]="notification.account"
[notificationType]="notification.type"
(browseAccountEvent)="browseAccount($event)"
(browseHashtagEvent)="browseHashtag($event)"
<app-status *ngIf="notification.status" class="stream__status" [statusWrapper]="notification.status"
[notificationAccount]="notification.account" [notificationType]="notification.type"
(browseAccountEvent)="browseAccount($event)" (browseHashtagEvent)="browseHashtag($event)"
(browseThreadEvent)="browseThread($event)"></app-status>
</div>

View File

@ -49,4 +49,42 @@
.followed {
color: $boost-color;
}
.follow-account {
padding: 5px;
height: 60px;
width: calc(100%);
overflow: hidden;
display: block;
position: relative;
text-decoration: none;
&__avatar {
float: left;
margin: 0 0 0 10px;
width: 45px;
height: 45px;
border-radius: 2px;
}
$acccount-info-left: 70px;
&__display-name {
position: absolute;
top: 7px;
left: $acccount-info-left;
color: whitesmoke;
}
&:hover &__display-name {
text-decoration: underline;
}
&__acct {
position: absolute;
top: 27px;
left: $acccount-info-left;
font-size: 13px;
color: $status-links-color;
}
}

View File

@ -117,7 +117,15 @@ export class NotificationsComponent implements OnInit, OnDestroy {
this.isLoading = false;
});
}
openAccount(account: Account): boolean {
let accountName = account.acct;
if (!accountName.includes('@'))
accountName += `@${account.url.replace('https://', '').split('/')[0]}`;
this.browseAccountEvent.next(accountName);
return false;
}
browseAccount(accountName: string): void {
this.browseAccountEvent.next(accountName);