added reply label
This commit is contained in:
parent
1673d8b35b
commit
5d86387ede
|
@ -20,36 +20,34 @@
|
|||
</a>
|
||||
</div>
|
||||
<div class="status__labels">
|
||||
<div class="status__labels--label status__labels--bot" title="bot"
|
||||
*ngIf="status.account.bot">
|
||||
<div class="status__labels--label status__labels--bot" title="bot" *ngIf="status.account.bot">
|
||||
bot
|
||||
</div>
|
||||
<div class="status__labels--label status__labels--xpost" title="cross-poster"
|
||||
*ngIf="isCrossPoster">
|
||||
<div class="status__labels--label status__labels--xpost" title="this status was cross-posted" *ngIf="isCrossPoster">
|
||||
x-post
|
||||
</div>
|
||||
<div class="status__labels--label status__labels--thread" title="thread"
|
||||
*ngIf="isThread">
|
||||
thread
|
||||
</div>
|
||||
<div class="status__labels--label status__labels--thread" title="thread" *ngIf="isThread">
|
||||
thread
|
||||
</div>
|
||||
<div class="status__labels--label status__labels--discuss" title="this status has a discution" *ngIf="hasReply">
|
||||
replies
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div #content class="status__content" innerHTML="{{displayedStatus.content}}"></div> -->
|
||||
|
||||
<a href class="status__content-warning" *ngIf="isContentWarned" title="show content" (click)="removeContentWarning()">
|
||||
<a href class="status__content-warning" *ngIf="isContentWarned" title="show content"
|
||||
(click)="removeContentWarning()">
|
||||
<span class="status__content-warning--title">sensitive content</span>
|
||||
{{ contentWarningText }}
|
||||
</a>
|
||||
<app-databinded-text class="status__content" *ngIf="!isContentWarned"
|
||||
[text]="displayedStatus.content"
|
||||
(accountSelected)="accountSelected($event)"
|
||||
(hashtagSelected)="hashtagSelected($event)"
|
||||
<app-databinded-text class="status__content" *ngIf="!isContentWarned" [text]="displayedStatus.content"
|
||||
(accountSelected)="accountSelected($event)" (hashtagSelected)="hashtagSelected($event)"
|
||||
(textSelected)="textSelected()"></app-databinded-text>
|
||||
<app-attachements *ngIf="!isContentWarned && hasAttachments" class="attachments" [attachments]="displayedStatus.media_attachments">
|
||||
<app-attachements *ngIf="!isContentWarned && hasAttachments" class="attachments"
|
||||
[attachments]="displayedStatus.media_attachments">
|
||||
</app-attachements>
|
||||
|
||||
<app-action-bar #appActionBar
|
||||
[statusWrapper]="statusWrapper"
|
||||
(cwIsActiveEvent)="changeCw($event)"
|
||||
<app-action-bar #appActionBar [statusWrapper]="statusWrapper" (cwIsActiveEvent)="changeCw($event)"
|
||||
(replyEvent)="openReply()"></app-action-bar>
|
||||
|
||||
<app-reply-to-status *ngIf="replyingToStatus" [statusReplyingToWrapper]="statusWrapper" (onClose)="closeReply()">
|
||||
|
|
|
@ -76,6 +76,9 @@
|
|||
background-color: rgb(0, 136, 61);
|
||||
background-color: rgb(0, 114, 51);
|
||||
}
|
||||
&--discuss {
|
||||
background-color: rgb(90, 0, 143);
|
||||
}
|
||||
}
|
||||
&__name {
|
||||
display: inline-block;
|
||||
|
|
|
@ -17,6 +17,7 @@ export class StatusComponent implements OnInit {
|
|||
isCrossPoster: boolean;
|
||||
isThread: boolean;
|
||||
isContentWarned: boolean;
|
||||
hasReply: boolean;
|
||||
contentWarningText: string;
|
||||
|
||||
@Output() browseAccountEvent = new EventEmitter<string>();
|
||||
|
@ -29,10 +30,7 @@ export class StatusComponent implements OnInit {
|
|||
@Input('statusWrapper')
|
||||
set statusWrapper(value: StatusWrapper) {
|
||||
this._statusWrapper = value;
|
||||
this.status = value.status;
|
||||
|
||||
this.checkLabels(this.status);
|
||||
this.checkContentWarning(this.status);
|
||||
this.status = value.status;
|
||||
|
||||
if (this.status.reblog) {
|
||||
this.reblog = true;
|
||||
|
@ -40,6 +38,9 @@ export class StatusComponent implements OnInit {
|
|||
} else {
|
||||
this.displayedStatus = this.status;
|
||||
}
|
||||
|
||||
this.checkLabels(this.displayedStatus);
|
||||
this.checkContentWarning(this.displayedStatus);
|
||||
|
||||
if (!this.displayedStatus.account.display_name) {
|
||||
this.displayedStatus.account.display_name = this.displayedStatus.account.username;
|
||||
|
@ -71,7 +72,7 @@ export class StatusComponent implements OnInit {
|
|||
return false;
|
||||
}
|
||||
|
||||
changeCw(cwIsActive: boolean){
|
||||
changeCw(cwIsActive: boolean) {
|
||||
this.isContentWarned = cwIsActive;
|
||||
}
|
||||
|
||||
|
@ -87,9 +88,11 @@ export class StatusComponent implements OnInit {
|
|||
}
|
||||
}
|
||||
|
||||
if (this.status.in_reply_to_account_id && this.status.in_reply_to_account_id === this.status.account.id) {
|
||||
if (status.in_reply_to_account_id && status.in_reply_to_account_id === status.account.id) {
|
||||
this.isThread = true;
|
||||
}
|
||||
|
||||
this.hasReply = status.replies_count > 0;
|
||||
}
|
||||
|
||||
openAccount(account: Account): boolean {
|
||||
|
|
|
@ -131,7 +131,8 @@ export interface Status {
|
|||
reblog: Status;
|
||||
content: string;
|
||||
created_at: string;
|
||||
reblogs_count: string;
|
||||
reblogs_count: number;
|
||||
replies_count: number;
|
||||
favourites_count: string;
|
||||
reblogged: boolean;
|
||||
favourited: boolean;
|
||||
|
|
Loading…
Reference in New Issue