|
@@ -1,7 +1,7 @@
|
|
|
-import { Component, Input } from '@angular/core';
|
|
|
-import { NavController, ActionSheetController } from 'ionic-angular';
|
|
|
-import { ProfilePage } from '../../pages/profile/profile';
|
|
|
-import { TwitterApiProvider } from '../../providers/twitter-api/twitter-api';
|
|
|
+import { Component, Input } from "@angular/core";
|
|
|
+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.
|
|
|
*
|
|
@@ -9,18 +9,20 @@ import { TwitterApiProvider } from '../../providers/twitter-api/twitter-api';
|
|
|
* Components.
|
|
|
*/
|
|
|
@Component({
|
|
|
- selector: 'tweet-header',
|
|
|
- templateUrl: 'tweet-header.html'
|
|
|
+ selector: "tweet-header",
|
|
|
+ templateUrl: "tweet-header.html"
|
|
|
})
|
|
|
export class TweetHeaderComponent {
|
|
|
- @Input() user: any[];
|
|
|
- @Input() tweetCreatedAt: string;
|
|
|
+ @Input()
|
|
|
+ user: any[];
|
|
|
+ @Input()
|
|
|
+ tweetCreatedAt: string;
|
|
|
|
|
|
constructor(
|
|
|
public navCtrl: NavController,
|
|
|
public actionSheetCtrl: ActionSheetController,
|
|
|
private twitter: TwitterApiProvider
|
|
|
- ) { }
|
|
|
+ ) {}
|
|
|
|
|
|
showProfile(userId) {
|
|
|
this.navCtrl.push(ProfilePage, { userId });
|
|
@@ -28,31 +30,34 @@ export class TweetHeaderComponent {
|
|
|
|
|
|
showActions(userId) {
|
|
|
let actionSheet = this.actionSheetCtrl.create({
|
|
|
- title: '@' + this.user["screen_name"],
|
|
|
+ title: "@" + this.user["screen_name"],
|
|
|
buttons: [
|
|
|
{
|
|
|
- text: 'Unfollow',
|
|
|
- role: 'destructive',
|
|
|
+ text: "Unfollow",
|
|
|
+ role: "destructive",
|
|
|
handler: () => {
|
|
|
this.twitter.destroyFriendship(userId);
|
|
|
}
|
|
|
- }, {
|
|
|
- text: 'Mute',
|
|
|
- role: 'destructive',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: "Mute",
|
|
|
+ role: "destructive",
|
|
|
handler: () => {
|
|
|
this.twitter.muteUser(userId);
|
|
|
}
|
|
|
- }, {
|
|
|
- text: 'Block',
|
|
|
- role: 'destructive',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: "Block",
|
|
|
+ role: "destructive",
|
|
|
handler: () => {
|
|
|
this.twitter.blockUser(userId);
|
|
|
}
|
|
|
- }, {
|
|
|
- text: 'Cancel',
|
|
|
- role: 'cancel',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: "Cancel",
|
|
|
+ role: "cancel",
|
|
|
handler: () => {
|
|
|
- console.log('Cancel clicked');
|
|
|
+ console.log("Cancel clicked");
|
|
|
}
|
|
|
}
|
|
|
]
|