Sengi-Windows-MacOS-Linux/src/app/components/stream/status/action-bar/action-bar.component.ts

56 lines
1.4 KiB
TypeScript
Raw Normal View History

import { Component, OnInit, Input } from '@angular/core';
2018-10-02 06:19:11 +02:00
import { Store } from '@ngxs/store';
import { StatusWrapper } from '../../stream.component';
2018-10-02 06:19:11 +02:00
import { MastodonService } from '../../../../services/mastodon.service';
import { AccountInfo } from '../../../../states/accounts.state';
@Component({
selector: 'app-action-bar',
templateUrl: './action-bar.component.html',
styleUrls: ['./action-bar.component.scss']
})
export class ActionBarComponent implements OnInit {
@Input() statusWrapper: StatusWrapper;
isFavorited: boolean;
isBoosted: boolean;
2018-10-02 06:19:11 +02:00
isBoostLocked: boolean;
isLocked: boolean;
2018-10-02 06:19:11 +02:00
constructor(
private readonly store: Store,
private readonly mastodonService: MastodonService) { }
2018-10-02 06:19:11 +02:00
ngOnInit() {
}
reply(): boolean {
console.warn('reply');
return false;
}
boost(): boolean {
console.warn('boost');
this.isBoosted = !this.isBoosted;
return false;
}
favorite(): boolean {
console.warn('favorite');
this.isFavorited = !this.isFavorited;
return false;
}
more(): boolean {
console.warn('more');
return false;
}
2018-10-02 06:19:11 +02:00
private getSelectedAccounts(): AccountInfo[] {
var regAccounts = <AccountInfo[]>this.store.snapshot().registeredaccounts.accounts;
return regAccounts.filter(x => x.isSelected);
}
}