<ion-header>
  <ion-toolbar>
    <ion-title>发现</ion-title>
    <ion-buttons slot="end">
      <ion-button (click)="sharePost()" color="primary">
        <ion-icon name="add"></ion-icon>
      </ion-button>
    </ion-buttons>
  </ion-toolbar>
</ion-header>

<ion-content>
  <div class="spacer"></div>
  <div class="post-grid">
    <ion-card *ngFor="let post of posts" (click)="viewPost(post.id)" class="post-card">
      <ion-card-header>
        <ion-card-subtitle>{{ post.date | date:'short' }}</ion-card-subtitle>
      </ion-card-header>
      <ion-card-content>
        <img [src]="post.imageUrl" *ngIf="post.imageUrl" alt="动态图片" class="post-image" />
        <p>{{ post.text }}</p>
      </ion-card-content>
    </ion-card>
  </div>
</ion-content>
