|
@@ -1,12 +1,7 @@
|
|
|
import { Component, Input } from "@angular/core";
|
|
|
import { TwitterApiProvider } from "../../providers/twitter-api/twitter-api";
|
|
|
+import { PhotoViewer } from "@ionic-native/photo-viewer";
|
|
|
|
|
|
-/**
|
|
|
- * Generated class for the ProfileHeaderComponent component.
|
|
|
- *
|
|
|
- * See https://angular.io/api/core/Component for more info on Angular
|
|
|
- * Components.
|
|
|
- */
|
|
|
@Component({
|
|
|
selector: "profile-header",
|
|
|
templateUrl: "profile-header.html"
|
|
@@ -15,7 +10,10 @@ export class ProfileHeaderComponent {
|
|
|
@Input()
|
|
|
user: any;
|
|
|
|
|
|
- constructor(private twitter: TwitterApiProvider) {}
|
|
|
+ constructor(
|
|
|
+ private twitter: TwitterApiProvider,
|
|
|
+ private photoViewer: PhotoViewer
|
|
|
+ ) {}
|
|
|
|
|
|
get banner() {
|
|
|
if (this.user.profile_banner_url) {
|
|
@@ -34,4 +32,14 @@ export class ProfileHeaderComponent {
|
|
|
await this.twitter.destroyFriendship(userId);
|
|
|
this.user.following = false;
|
|
|
}
|
|
|
+
|
|
|
+ showProfilePicture() {
|
|
|
+ const profilePicutreHighResUrl = this.user.profile_image_url_https.replace(
|
|
|
+ "_normal",
|
|
|
+ ""
|
|
|
+ );
|
|
|
+ this.photoViewer.show(profilePicutreHighResUrl, this.user.name, {
|
|
|
+ share: true
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|