@@ -1,4 +1,5 @@
<!-- Generated template for the TweetBodyComponent component -->
<div>
<p [innerHTML]="text | replaceUrls: entities.urls | replaceHashtags: entities.hashtags"></p>
+ <img *ngIf="hasPhoto" src="{{ entities.media[0]['media_url_https'] }}" alt="Photo" class="photo">
</div>
@@ -1,3 +1,8 @@
tweet-body {
-
-}
+ .photo {
+ margin-top: 5px;
+ padding: 2px;
+ border-radius: 3px;
+ border: 1px solid #dfdfdf;
+ }
+}
@@ -17,4 +17,8 @@ export class TweetBodyComponent {
constructor() {}
+ get hasPhoto() {
+ return this.entities["media"] && this.entities["media"][0]["type"] == 'photo';
+
}