12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- import { Component, Input } from "@angular/core";
- import { PhotoViewer } from "@ionic-native/photo-viewer";
- @Component({
- selector: "profile-header",
- templateUrl: "profile-header.html"
- })
- export class ProfileHeaderComponent {
- @Input()
- user: any;
- constructor(
- private photoViewer: PhotoViewer
- ) {}
- get banner() {
- if (this.user.profile_banner_url) {
- return this.user.profile_banner_url + "/1500x500";
- } else {
- return this.user.profile_background_image_url_https;
- }
- }
- async follow(userId) {
- // await this.twitter.createFriendship(userId);
- this.user.following = true;
- }
- async unfollow(userId) {
- // 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
- });
- }
- }
|