diff --git a/CHANGELOG.md b/CHANGELOG.md index 32b949274..a610f56ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Added a live preview of the date and number format to the user settings - Added the country flag to the currency selector - Added a _Storybook_ story for the currency selector component diff --git a/apps/client/src/app/components/user-account-settings/user-account-settings.component.ts b/apps/client/src/app/components/user-account-settings/user-account-settings.component.ts index b48adf59d..18ce8e07c 100644 --- a/apps/client/src/app/components/user-account-settings/user-account-settings.component.ts +++ b/apps/client/src/app/components/user-account-settings/user-account-settings.component.ts @@ -22,6 +22,7 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, + computed, CUSTOM_ELEMENTS_SCHEMA, DestroyRef, inject, @@ -50,6 +51,7 @@ import { format, parseISO } from 'date-fns'; import { addIcons } from 'ionicons'; import { eyeOffOutline, eyeOutline } from 'ionicons/icons'; import ms from 'ms'; +import { DeviceDetectorService } from 'ngx-device-detector'; import { EMPTY, throwError } from 'rxjs'; import { catchError } from 'rxjs/operators'; @@ -108,10 +110,17 @@ export class GfUserAccountSettingsComponent implements OnInit { 'uk', 'zh' ]; + protected readonly previewDate = new Date().toISOString(); + protected readonly previewValue = 9999.99; protected user: User; + protected readonly deviceType = computed( + () => this.deviceDetectorService.deviceInfo().deviceType + ); + private readonly changeDetectorRef = inject(ChangeDetectorRef); private readonly dataService = inject(DataService); + private readonly deviceDetectorService = inject(DeviceDetectorService); private readonly destroyRef = inject(DestroyRef); private readonly notificationService = inject(NotificationService); private readonly settingsStorageService = inject(SettingsStorageService); diff --git a/apps/client/src/app/components/user-account-settings/user-account-settings.html b/apps/client/src/app/components/user-account-settings/user-account-settings.html index 57d3b54d7..cb39360f7 100644 --- a/apps/client/src/app/components/user-account-settings/user-account-settings.html +++ b/apps/client/src/app/components/user-account-settings/user-account-settings.html @@ -146,7 +146,7 @@ -