feat: add manage currencies page (#887)

Fixes: #152
This commit is contained in:
Karan Takalkar
2020-06-23 00:04:50 +05:30
committed by GitHub
parent 686d6dddbc
commit e01897aa66
8 changed files with 203 additions and 4 deletions
@@ -0,0 +1,49 @@
<div class="container">
<mat-card>
<div>
<form #formRef="ngForm" [formGroup]="currencyForm" fxLayout="row" fxLayoutAlign="start baseline" fxLayoutGap="20px"
fxFlex="48%" (ngSubmit)="addCurrency()">
<mat-form-field fxFlex="calc(90%-20px)">
<mat-label>Currency</mat-label>
<mat-select required formControlName="currency">
<mat-option *ngFor="let currency of currencyData" [value]="currency">
{{ currency.name }}
</mat-option>
</mat-select>
<mat-error *ngIf="currencyForm.controls.currency.hasError('required')">
Currency is <strong>required</strong>
</mat-error>
</mat-form-field>
<button mat-raised-button fxFlex color="primary"
[disabled]="!currencyForm.valid">
<fa-icon icon="plus"></fa-icon>
</button>
</form>
</div>
<mat-grid-list cols="2" rowHeight="50px">
<mat-grid-tile *ngFor="let currency of selectedCurrencies; index as i">
<input matInput [value]="currency.name">
<div fxLayout="row" fxLayoutAlign="flex-start">
<button mat-button color="warn" (click)="deleteCurrency(currency.code, i)">
<fa-icon icon="trash"></fa-icon>
</button>
</div>
</mat-grid-tile>
</mat-grid-list>
</mat-card>
</div>