fix bug#7
Build & Push / Build & Push Docker Image (push) Failing after 2m50s
Test / Type Check (all packages) (push) Failing after 55s
Test / API Unit Tests (push) Has been skipped
Test / Homepage Unit Tests (push) Has been skipped
Test / Carplace Unit Tests (push) Has been skipped
Test / Admin Unit Tests (push) Has been skipped
Test / Dashboard Unit Tests (push) Has been skipped
Test / API Integration Tests (push) Has been skipped

This commit is contained in:
root
2026-07-20 01:01:21 -04:00
parent 7ce0a5adf3
commit fb7b4eefc1
33 changed files with 342 additions and 87 deletions
+3 -1
View File
@@ -1,6 +1,8 @@
import type { Locale } from '@/lib/localization/config';
import type { ThemePreference } from '@/lib/theme/config';
export function accountCreateUrl(locale: Locale): string {
export function accountCreateUrl(locale: Locale, theme?: ThemePreference): string {
const params = new URLSearchParams({ lang: locale });
if (theme === 'light' || theme === 'dark') params.set('theme', theme);
return `/dashboard/sign-up?${params.toString()}`;
}
+1 -1
View File
@@ -12,7 +12,7 @@ export type Direction = 'ltr' | 'rtl';
export type RouteId = 'home' | 'sign-in' | 'forgot-password' | 'reset-password' | 'privacy' | 'terms' | 'accessibility';
export const defaultLocale: Locale = 'en';
export const defaultMode: ThemePreference = 'system';
export const defaultMode: ThemePreference = 'dark';
export const localeCookie = 'hpc-locale';
export const localeStorageKey = 'hpc.locale';
export const localeCookieMaxAgeSeconds = 31_536_000;
@@ -4,7 +4,7 @@ export const themeBootstrapScript = `(function () {
var cookieValue = cookieMatch ? decodeURIComponent(cookieMatch[1]) : null;
var stored = null;
try { stored = localStorage.getItem("hpc.theme.preference"); } catch (_) {}
var preference = allowed[cookieValue] ? cookieValue : (allowed[stored] ? stored : "system");
var preference = allowed[cookieValue] ? cookieValue : (allowed[stored] ? stored : "dark");
var dark = window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches;
var resolved = preference === "system" ? (dark ? "dark" : "light") : preference;
var root = document.documentElement;
+1 -1
View File
@@ -40,5 +40,5 @@ export function persistTheme(preference: ThemePreference): void {
export function currentThemePreference(): ThemePreference {
const value = document.documentElement.dataset.themePreference;
return isThemePreference(value) ? value : 'system';
return isThemePreference(value) ? value : 'dark';
}