feat(web): theme/locale preferences and improve SSR ()

This commit is contained in:
Michel Heusschen 2023-02-22 18:53:08 +01:00 committed by GitHub
parent a9a769d902
commit 10cb612fb1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 142 additions and 144 deletions
web/src/lib/components/user-settings-page

View file

@ -12,6 +12,7 @@
notificationController,
NotificationType
} from '../shared-components/notification/notification';
import { locale } from '$lib/stores/preferences.store';
let keys: APIKeyResponseDto[] = [];
@ -20,7 +21,6 @@
let deleteKey: APIKeyResponseDto | null = null;
let secret = '';
const locale = navigator.language;
const format: Intl.DateTimeFormatOptions = {
month: 'short',
day: 'numeric',
@ -154,7 +154,7 @@
>
<td class="text-sm px-4 w-1/3 text-ellipsis">{key.name}</td>
<td class="text-sm px-4 w-1/3 text-ellipsis"
>{new Date(key.createdAt).toLocaleDateString(locale, format)}
>{new Date(key.createdAt).toLocaleDateString($locale, format)}
</td>
<td class="text-sm px-4 w-1/3 text-ellipsis">
<button