Browse Source

Add platform logo to platform selector

pull/7528/head
Thomas Kaul 4 weeks ago
parent
commit
ce3b3c1d02
  1. 6
      apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.component.ts
  2. 8
      apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.html

6
apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.component.ts

@ -77,6 +77,12 @@ export class GfCreateOrUpdateAccountDialogComponent {
private readonly formBuilder = inject(FormBuilder); private readonly formBuilder = inject(FormBuilder);
private readonly userService = inject(UserService); private readonly userService = inject(UserService);
protected get selectedPlatform() {
const platform = this.accountForm.get('platformId')?.value;
return typeof platform === 'string' ? undefined : (platform as Platform);
}
public ngOnInit() { public ngOnInit() {
const { currencies } = this.dataService.fetchInfo(); const { currencies } = this.dataService.fetchInfo();
this.currencies = currencies; this.currencies = currencies;

8
apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.html

@ -46,6 +46,14 @@
<div [class.d-none]="platforms?.length < 1"> <div [class.d-none]="platforms?.length < 1">
<mat-form-field appearance="outline" class="w-100"> <mat-form-field appearance="outline" class="w-100">
<mat-label i18n>Platform</mat-label> <mat-label i18n>Platform</mat-label>
@if (selectedPlatform?.url) {
<gf-entity-logo
class="ml-3"
matPrefix
[tooltip]="selectedPlatform?.name"
[url]="selectedPlatform?.url"
/>
}
<input <input
formControlName="platformId" formControlName="platformId"
matInput matInput

Loading…
Cancel
Save