quoted-status.ts 537 B

123456789101112131415161718192021222324
  1. import { Component, Input } from "@angular/core";
  2. import { PhotoViewer } from "@ionic-native/photo-viewer";
  3. @Component({
  4. selector: "quoted-status",
  5. templateUrl: "quoted-status.html"
  6. })
  7. export class QuotedStatusComponent {
  8. @Input()
  9. data: any[];
  10. constructor(private photoViewer: PhotoViewer) {}
  11. get hasPhoto() {
  12. return (
  13. this.data["entities"]["media"] &&
  14. this.data["entities"]["media"][0]["type"] == "photo"
  15. );
  16. }
  17. showPhoto(url: string) {
  18. this.photoViewer.show(url, null, { share: true });
  19. }
  20. }