|
@@ -1,6 +1,7 @@
|
|
|
import { Component, Input } from '@angular/core';
|
|
|
-import { NavController } from 'ionic-angular';
|
|
|
+import { NavController, ActionSheetController } from 'ionic-angular';
|
|
|
import { ProfilePage } from '../../pages/profile/profile';
|
|
|
+import { TwitterApiProvider } from '../../providers/twitter-api/twitter-api';
|
|
|
/**
|
|
|
* Generated class for the TweetHeaderComponent component.
|
|
|
*
|
|
@@ -16,10 +17,46 @@ export class TweetHeaderComponent {
|
|
|
@Input() tweetCreatedAt: string;
|
|
|
|
|
|
constructor(
|
|
|
- public navCtrl: NavController
|
|
|
+ public navCtrl: NavController,
|
|
|
+ public actionSheetCtrl: ActionSheetController,
|
|
|
+ private twitter: TwitterApiProvider
|
|
|
) { }
|
|
|
|
|
|
showProfile(userId) {
|
|
|
this.navCtrl.push(ProfilePage, { userId });
|
|
|
}
|
|
|
+
|
|
|
+ showActions(userId) {
|
|
|
+ let actionSheet = this.actionSheetCtrl.create({
|
|
|
+ title: '@' + this.user["screen_name"],
|
|
|
+ buttons: [
|
|
|
+ {
|
|
|
+ text: 'Unfollow',
|
|
|
+ role: 'destructive',
|
|
|
+ handler: () => {
|
|
|
+ this.twitter.destroyFriendship(userId);
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ text: 'Mute',
|
|
|
+ role: 'destructive',
|
|
|
+ handler: () => {
|
|
|
+ this.twitter.muteUser(userId);
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ text: 'Block',
|
|
|
+ role: 'destructive',
|
|
|
+ handler: () => {
|
|
|
+ this.twitter.blockUser(userId);
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ text: 'Cancel',
|
|
|
+ role: 'cancel',
|
|
|
+ handler: () => {
|
|
|
+ console.log('Cancel clicked');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ });
|
|
|
+ actionSheet.present();
|
|
|
+ }
|
|
|
}
|