Retified attachments call list at event-details

This commit is contained in:
Tiago Kayaya
2020-09-08 09:40:25 +01:00
parent 4689b71b3a
commit 70833168f7
4 changed files with 35 additions and 45 deletions
@@ -1,7 +1,7 @@
<ion-header>
<ion-toolbar>
<ion-buttons slot="start">
<ion-back-button (click)="navigateBack()" defaultHref="" icon="chevron-back"></ion-back-button>
<ion-back-button (click)="close()" defaultHref="" icon="chevron-back"></ion-back-button>
</ion-buttons>
<ion-title>Anexos do evento</ion-title>
</ion-toolbar>
@@ -24,20 +24,7 @@
</div>
<!-- Skeleton screen -->
<div *ngIf="!loadedEventAttachments">
<div class="ion-padding custom-skeleton">
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
<ion-skeleton-text animated></ion-skeleton-text>
<ion-skeleton-text animated style="width: 88%"></ion-skeleton-text>
<ion-skeleton-text animated style="width: 70%"></ion-skeleton-text>
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
</div>
<ion-list>
<ion-list-header>
<ion-label>
<ion-skeleton-text animated style="width: 20%"></ion-skeleton-text>
</ion-label>
</ion-list-header>
<ion-item>
<ion-avatar slot="start">
<ion-skeleton-text animated></ion-skeleton-text>
@@ -55,23 +42,9 @@
</ion-label>
</ion-item>
<ion-item>
<ion-thumbnail slot="start">
<ion-avatar slot="start">
<ion-skeleton-text animated></ion-skeleton-text>
</ion-thumbnail>
<ion-label>
<h3>
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
</h3>
<p>
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
</p>
<p>
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
</p>
</ion-label>
</ion-item>
<ion-item>
<ion-skeleton-text animated style="width: 27px; height: 27px" slot="start"></ion-skeleton-text>
</ion-avatar>
<ion-label>
<h3>
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
@@ -3,6 +3,7 @@ import { AttachmentsService } from 'src/app/services/attachments.service';
import { Attachment } from 'src/app/models/attachment.model';
import { ActivatedRoute, Router } from '@angular/router';
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { ModalController, NavParams } from '@ionic/angular';
@Component({
selector: 'app-attachments',
@@ -16,19 +17,12 @@ export class AttachmentsPage implements OnInit {
constructor(
private attachamentsService: AttachmentsService,
private activatedRoute: ActivatedRoute,
private iab: InAppBrowser,
private route: Router) { }
private modalCtrl: ModalController,
private navParams: NavParams) { }
ngOnInit() {
/* Emit new data when something changes */
this.activatedRoute.paramMap.subscribe(paramMap =>{
if(!paramMap.has('eventId')){
//Redirect
return;
}
this.loadAttachments(paramMap.get('eventId'));
});
this.loadAttachments(this.navParams.get('eventId'));
}
loadAttachments(eventid:string)
@@ -45,9 +39,8 @@ export class AttachmentsPage implements OnInit {
const browser = this.iab.create(url,"_blank");
browser.show();
}
navigateBack(){
this.route.navigate(['/home/events',this.pageId]);
close(){
this.modalCtrl.dismiss(null);
}