From 2724c77b554697e973a5487d746f7cc30473adc2 Mon Sep 17 00:00:00 2001 From: Evert Prants Date: Tue, 11 Jun 2024 17:01:52 +0300 Subject: [PATCH] Audit tweaks --- src/lib/components/admin/AdminAuditCard.svelte | 13 +++++++++++-- src/lib/theme-mode.ts | 8 ++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/lib/components/admin/AdminAuditCard.svelte b/src/lib/components/admin/AdminAuditCard.svelte index f890a15..ad08869 100644 --- a/src/lib/components/admin/AdminAuditCard.svelte +++ b/src/lib/components/admin/AdminAuditCard.svelte @@ -11,8 +11,8 @@
- {audit.action} - + {audit.action} +
@@ -76,6 +76,15 @@ align-items: center; justify-content: space-between; flex-grow: 1; + gap: 1rem; + } + + .audit-log-stamp { + margin-left: auto; + + @media screen and (max-width: 768px) { + display: none; + } } .audit-log.expanded :global(svg) { diff --git a/src/lib/theme-mode.ts b/src/lib/theme-mode.ts index ad786db..a1e41ad 100644 --- a/src/lib/theme-mode.ts +++ b/src/lib/theme-mode.ts @@ -12,10 +12,10 @@ export const themeMode = writable('light', (set) => { }); /** - * Send a theme to the server so that it can be saved as a cookie. - * @param theme - theme to send to server + * Save theme as a cookie. + * @param theme - theme to save */ -export const setThemeCookie = async (theme: ThemeModeType) => +export const setThemeCookie = (theme: ThemeModeType) => (document.cookie = `themeMode=${theme}; path=/; SameSite=Lax; Max-Age=${THEME_COOKIE_MAX_AGE}`); export const forwardInitialTheme = () => @@ -34,7 +34,7 @@ export const forwardInitialTheme = () => const unsubscribeForward = themeMode.subscribe(async (theme) => { document.documentElement.setAttribute('theme-base', theme); - await setThemeCookie(theme); + setThemeCookie(theme); }); uaTheme?.addEventListener?.('change', uaSetter);