mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-03-12 09:42:27 +00:00
feat: add library account screens
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-buttons slot="start">
|
||||
<ion-back-button></ion-back-button>
|
||||
<ion-menu-button></ion-menu-button>
|
||||
</ion-buttons>
|
||||
<ion-title>{{
|
||||
'library.account.pages.profile.title' | translate | titlecase
|
||||
}}</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
<ion-grid *ngIf="patron">
|
||||
<ng-container *ngFor="let property of propertiesToShow">
|
||||
<ion-row *ngIf="patron[property]">
|
||||
<ion-col>
|
||||
{{
|
||||
'library.account.pages.profile.labels' + '.' + property
|
||||
| translate
|
||||
| titlecase
|
||||
}}:
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
{{ patron[property] }}
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ng-container>
|
||||
</ion-grid>
|
||||
</ion-content>
|
||||
@@ -0,0 +1,31 @@
|
||||
import {Component} from '@angular/core';
|
||||
import {LibraryAccountService} from '../library-account.service';
|
||||
import {PAIAPatron} from '../../types';
|
||||
|
||||
@Component({
|
||||
selector: 'app-profile',
|
||||
templateUrl: './profile-page.component.html',
|
||||
styleUrls: ['./profile-page.component.scss'],
|
||||
})
|
||||
export class ProfilePageComponent {
|
||||
patron: PAIAPatron;
|
||||
|
||||
propertiesToShow: (keyof PAIAPatron)[] = [
|
||||
'name',
|
||||
'email',
|
||||
'address',
|
||||
'expires',
|
||||
'note',
|
||||
];
|
||||
|
||||
constructor(private readonly libraryAccountService: LibraryAccountService) {}
|
||||
|
||||
async ionViewWillEnter(): Promise<void> {
|
||||
try {
|
||||
this.patron = await this.libraryAccountService.getProfile();
|
||||
console.log(this.patron);
|
||||
} catch {
|
||||
// TODO: error handling
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user