added open accounts/status/hashtag in account

This commit is contained in:
Nicolas Constant 2019-03-31 20:24:07 -04:00
parent 72fc5bd387
commit e3d5362306
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
5 changed files with 83 additions and 15 deletions

View File

@ -10,7 +10,11 @@
</a>
</div>
<app-manage-account *ngIf="openPanel === 'manageAccount'" [account]="userAccountUsed"></app-manage-account>
<app-manage-account *ngIf="openPanel === 'manageAccount'"
[account]="userAccountUsed"
(browseAccountEvent)="browseAccount($event)"
(browseHashtagEvent)="browseHashtag($event)"
(browseThreadEvent)="browseThread($event)"></app-manage-account>
<app-add-new-status *ngIf="openPanel === 'createNewStatus'"></app-add-new-status>
<app-add-new-account *ngIf="openPanel === 'addNewAccount'"></app-add-new-account>
<app-search *ngIf="openPanel === 'search'"

View File

@ -28,9 +28,26 @@
</a>
</div>
<app-direct-messages class="account__body" *ngIf="subPanel === 'dm'" [account]="account"></app-direct-messages>
<app-favorites class="account__body" *ngIf="subPanel === 'favorites'" [account]="account"></app-favorites>
<app-mentions class="account__body" *ngIf="subPanel === 'mentions'" [account]="account"></app-mentions>
<app-my-account class="account__body" *ngIf="subPanel === 'account'" [account]="account"></app-my-account>
<app-notifications class="account__body" *ngIf="subPanel === 'notifications'" [account]="account"></app-notifications>
<app-direct-messages class="account__body" *ngIf="subPanel === 'dm'"
[account]="account"
(browseAccountEvent)="browseAccount($event)"
(browseHashtagEvent)="browseHashtag($event)"
(browseThreadEvent)="browseThread($event)"></app-direct-messages>
<app-favorites class="account__body" *ngIf="subPanel === 'favorites'"
[account]="account"
(browseAccountEvent)="browseAccount($event)"
(browseHashtagEvent)="browseHashtag($event)"
(browseThreadEvent)="browseThread($event)"></app-favorites>
<app-mentions class="account__body" *ngIf="subPanel === 'mentions'"
[account]="account"
(browseAccountEvent)="browseAccount($event)"
(browseHashtagEvent)="browseHashtag($event)"
(browseThreadEvent)="browseThread($event)"></app-mentions>
<app-my-account class="account__body" *ngIf="subPanel === 'account'"
[account]="account"></app-my-account>
<app-notifications class="account__body" *ngIf="subPanel === 'notifications'"
[account]="account"
(browseAccountEvent)="browseAccount($event)"
(browseHashtagEvent)="browseHashtag($event)"
(browseThreadEvent)="browseThread($event)"></app-notifications>
</div>

View File

@ -1,10 +1,11 @@
import { Component, OnInit, OnDestroy, Input } from '@angular/core';
import { Component, OnInit, OnDestroy, Input, Output, EventEmitter } from '@angular/core';
import { faAt, faUserPlus } from "@fortawesome/free-solid-svg-icons";
import { faBell, faEnvelope, faUser, faStar } from "@fortawesome/free-regular-svg-icons";
import { Subscription } from 'rxjs';
import { AccountWrapper } from '../../../models/account.models';
import { UserNotificationService, UserNotification } from '../../../services/user-notification.service';
import { OpenThreadEvent } from '../../../services/tools.service';
@Component({
@ -24,6 +25,10 @@ export class ManageAccountComponent implements OnInit, OnDestroy {
hasNotifications = false;
hasMentions = false;
@Output() browseAccountEvent = new EventEmitter<string>();
@Output() browseHashtagEvent = new EventEmitter<string>();
@Output() browseThreadEvent = new EventEmitter<OpenThreadEvent>();
@Input('account')
set account(acc: AccountWrapper) {
this._account = acc;
@ -65,4 +70,16 @@ export class ManageAccountComponent implements OnInit, OnDestroy {
this.subPanel = subpanel;
return false;
}
browseAccount(accountName: string): void {
this.browseAccountEvent.next(accountName);
}
browseHashtag(hashtag: string): void {
this.browseHashtagEvent.next(hashtag);
}
browseThread(openThreadEvent: OpenThreadEvent): void {
this.browseThreadEvent.next(openThreadEvent);
}
}

View File

@ -1,6 +1,5 @@
import { Component, OnInit, OnDestroy, Input, ViewChild, ElementRef } from '@angular/core';
import { Component, OnInit, OnDestroy, Input, ViewChild, ElementRef, Output, EventEmitter } from '@angular/core';
import { Subscription } from 'rxjs';
import { Store } from '@ngxs/store';
import { AccountWrapper } from '../../../../models/account.models';
import { UserNotificationService, UserNotification } from '../../../../services/user-notification.service';
@ -8,8 +7,7 @@ import { StatusWrapper } from '../../../../models/common.model';
import { Status, Notification } from '../../../../services/models/mastodon.interfaces';
import { MastodonService } from '../../../../services/mastodon.service';
import { NotificationService } from '../../../../services/notification.service';
import { AccountSettings, SettingsState } from '../../../../states/settings.state';
import { ToolsService } from '../../../../services/tools.service';
import { ToolsService, OpenThreadEvent } from '../../../../services/tools.service';
@Component({
@ -24,6 +22,10 @@ export class MentionsComponent implements OnInit, OnDestroy {
isThread = false;
hasContentWarnings = false;
@Output() browseAccountEvent = new EventEmitter<string>();
@Output() browseHashtagEvent = new EventEmitter<string>();
@Output() browseThreadEvent = new EventEmitter<OpenThreadEvent>();
@Input('account')
set account(acc: AccountWrapper) {
console.warn('account');
@ -48,8 +50,7 @@ export class MentionsComponent implements OnInit, OnDestroy {
private readonly toolsService: ToolsService,
private readonly notificationService: NotificationService,
private readonly userNotificationService: UserNotificationService,
private readonly mastodonService: MastodonService,
private readonly store: Store) {
private readonly mastodonService: MastodonService) {
}
@ -121,4 +122,16 @@ export class MentionsComponent implements OnInit, OnDestroy {
this.isLoading = false;
});
}
browseAccount(accountName: string): void {
this.browseAccountEvent.next(accountName);
}
browseHashtag(hashtag: string): void {
this.browseHashtagEvent.next(hashtag);
}
browseThread(openThreadEvent: OpenThreadEvent): void {
this.browseThreadEvent.next(openThreadEvent);
}
}

View File

@ -1,4 +1,4 @@
import { Component, OnInit, Input, ViewChild, ElementRef, OnDestroy } from '@angular/core';
import { Component, OnInit, Input, ViewChild, ElementRef, OnDestroy, Output, EventEmitter } from '@angular/core';
import { Subscription } from 'rxjs';
import { faStar, faUserPlus, faRetweet } from "@fortawesome/free-solid-svg-icons";
import { faStar as faStar2 } from "@fortawesome/free-regular-svg-icons";
@ -6,10 +6,11 @@ import { faStar as faStar2 } from "@fortawesome/free-regular-svg-icons";
import { AccountWrapper } from '../../../../models/account.models';
import { UserNotificationService, UserNotification } from '../../../../services/user-notification.service';
import { StatusWrapper } from '../../../../models/common.model';
import { Status, Notification, Account } from '../../../../services/models/mastodon.interfaces';
import { Notification, Account } from '../../../../services/models/mastodon.interfaces';
import { MastodonService } from '../../../../services/mastodon.service';
import { NotificationService } from '../../../../services/notification.service';
import { AccountInfo } from '../../../../states/accounts.state';
import { OpenThreadEvent } from '../../../../services/tools.service';
@Component({
selector: 'app-notifications',
@ -24,6 +25,10 @@ export class NotificationsComponent implements OnInit, OnDestroy {
notifications: NotificationWrapper[] = [];
isLoading = false;
@Output() browseAccountEvent = new EventEmitter<string>();
@Output() browseHashtagEvent = new EventEmitter<string>();
@Output() browseThreadEvent = new EventEmitter<OpenThreadEvent>();
@Input('account')
set account(acc: AccountWrapper) {
this._account = acc;
@ -113,6 +118,18 @@ export class NotificationsComponent implements OnInit, OnDestroy {
});
}
browseAccount(accountName: string): void {
this.browseAccountEvent.next(accountName);
}
browseHashtag(hashtag: string): void {
this.browseHashtagEvent.next(hashtag);
}
browseThread(openThreadEvent: OpenThreadEvent): void {
this.browseThreadEvent.next(openThreadEvent);
}
}
class NotificationWrapper {