open avatar in lightbox
This commit is contained in:
parent
1d4c8b5dad
commit
6e2bb144fc
@ -2,11 +2,15 @@
|
|||||||
<app-waiting-animation *ngIf="isLoading" class="waiting-icon"></app-waiting-animation>
|
<app-waiting-animation *ngIf="isLoading" class="waiting-icon"></app-waiting-animation>
|
||||||
|
|
||||||
|
|
||||||
<div *ngIf="displayedAccount" class="profile-header" [ngStyle]="{'background-image':'url('+displayedAccount.header+')'}">
|
<div *ngIf="displayedAccount" class="profile-header"
|
||||||
|
[ngStyle]="{'background-image':'url('+displayedAccount.header+')'}">
|
||||||
<div class="profile-header__inner">
|
<div class="profile-header__inner">
|
||||||
|
<a href (click)="showAvatar(displayedAccount.avatar)" title="open avatar">
|
||||||
<img class="profile-header__avatar" src="{{displayedAccount.avatar}}" alt="header" />
|
<img class="profile-header__avatar" src="{{displayedAccount.avatar}}" alt="header" />
|
||||||
|
</a>
|
||||||
<h2 class="profile-header__display-name" innerHTML="{{displayedAccount | accountEmoji }}"></h2>
|
<h2 class="profile-header__display-name" innerHTML="{{displayedAccount | accountEmoji }}"></h2>
|
||||||
<h2 class="profile-header__fullhandle"><a href="{{displayedAccount.url}}" target="_blank">@{{displayedAccount.acct}}</a></h2>
|
<h2 class="profile-header__fullhandle"><a href="{{displayedAccount.url}}"
|
||||||
|
target="_blank">@{{displayedAccount.acct}}</a></h2>
|
||||||
|
|
||||||
<div class="profile-header__follow" *ngIf="relationship">
|
<div class="profile-header__follow" *ngIf="relationship">
|
||||||
<button class="profile-header__follow--button profile-header__follow--unfollowed" title="follow"
|
<button class="profile-header__follow--button profile-header__follow--unfollowed" title="follow"
|
||||||
@ -38,7 +42,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="profile-fields" *ngIf="displayedAccount && displayedAccount.fields.length > 0">
|
<div class="profile-fields" *ngIf="displayedAccount && displayedAccount.fields.length > 0">
|
||||||
<div class="profile-fields__field" *ngFor="let field of displayedAccount.fields">
|
<div class="profile-fields__field" *ngFor="let field of displayedAccount.fields">
|
||||||
<div class="profile-fields__field--value" innerHTML="{{ displayedAccount | accountEmoji:field.value}}" [ngClass]="{'profile-fields__field--validated': field.verified_at }">
|
<div class="profile-fields__field--value" innerHTML="{{ displayedAccount | accountEmoji:field.value}}"
|
||||||
|
[ngClass]="{'profile-fields__field--validated': field.verified_at }">
|
||||||
</div>
|
</div>
|
||||||
<div class="profile-fields__field--name">
|
<div class="profile-fields__field--name">
|
||||||
{{ field.name }}
|
{{ field.name }}
|
||||||
|
@ -5,13 +5,14 @@ import { faUser as faUserRegular } from "@fortawesome/free-regular-svg-icons";
|
|||||||
import { Observable, Subscription } from 'rxjs';
|
import { Observable, Subscription } from 'rxjs';
|
||||||
import { Store } from '@ngxs/store';
|
import { Store } from '@ngxs/store';
|
||||||
|
|
||||||
import { Account, Status, Relationship } from "../../../services/models/mastodon.interfaces";
|
import { Account, Status, Relationship, Attachment } from "../../../services/models/mastodon.interfaces";
|
||||||
import { MastodonService } from '../../../services/mastodon.service';
|
import { MastodonService } from '../../../services/mastodon.service';
|
||||||
import { ToolsService, OpenThreadEvent } from '../../../services/tools.service';
|
import { ToolsService, OpenThreadEvent } from '../../../services/tools.service';
|
||||||
import { NotificationService } from '../../../services/notification.service';
|
import { NotificationService } from '../../../services/notification.service';
|
||||||
import { AccountInfo } from '../../../states/accounts.state';
|
import { AccountInfo } from '../../../states/accounts.state';
|
||||||
import { StatusWrapper } from '../../../models/common.model';
|
import { StatusWrapper } from '../../../models/common.model';
|
||||||
import { EmojiConverter, EmojiTypeEnum } from '../../../tools/emoji.tools';
|
import { EmojiConverter, EmojiTypeEnum } from '../../../tools/emoji.tools';
|
||||||
|
import { NavigationService } from '../../../services/navigation.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-user-profile',
|
selector: 'app-user-profile',
|
||||||
@ -60,6 +61,7 @@ export class UserProfileComponent implements OnInit {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private readonly store: Store,
|
private readonly store: Store,
|
||||||
|
private readonly navigationService: NavigationService,
|
||||||
private readonly notificationService: NotificationService,
|
private readonly notificationService: NotificationService,
|
||||||
private readonly mastodonService: MastodonService,
|
private readonly mastodonService: MastodonService,
|
||||||
private readonly toolsService: ToolsService) {
|
private readonly toolsService: ToolsService) {
|
||||||
@ -103,7 +105,7 @@ export class UserProfileComponent implements OnInit {
|
|||||||
|
|
||||||
this.displayedAccount = account;
|
this.displayedAccount = account;
|
||||||
this.hasNote = account && account.note && account.note !== '<p></p>';
|
this.hasNote = account && account.note && account.note !== '<p></p>';
|
||||||
if(this.hasNote){
|
if (this.hasNote) {
|
||||||
this.note = this.emojiConverter.applyEmojis(account.emojis, account.note, EmojiTypeEnum.medium);
|
this.note = this.emojiConverter.applyEmojis(account.emojis, account.note, EmojiTypeEnum.medium);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -155,6 +157,26 @@ export class UserProfileComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
showAvatar(avatarUrl: string): boolean {
|
||||||
|
const att: Attachment = {
|
||||||
|
id: '',
|
||||||
|
type: 'image',
|
||||||
|
remote_url: avatarUrl,
|
||||||
|
preview_url: avatarUrl,
|
||||||
|
url: avatarUrl,
|
||||||
|
meta: null,
|
||||||
|
text_url: '',
|
||||||
|
description: ''
|
||||||
|
}
|
||||||
|
this.navigationService.openMedia({
|
||||||
|
selectedIndex: 0,
|
||||||
|
attachments: [att],
|
||||||
|
iframe: null
|
||||||
|
});
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
refresh(): any {
|
refresh(): any {
|
||||||
this.load(this.lastAccountName);
|
this.load(this.lastAccountName);
|
||||||
}
|
}
|
||||||
@ -227,7 +249,7 @@ export class UserProfileComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private loadStatus(userAccount: AccountInfo, statuses: Status[]){
|
private loadStatus(userAccount: AccountInfo, statuses: Status[]) {
|
||||||
if (statuses.length === 0) {
|
if (statuses.length === 0) {
|
||||||
this.maxReached = true;
|
this.maxReached = true;
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user