Move app to apps/web-react in pnpm workspace layout

This commit is contained in:
Kalle
2026-08-16 09:20:33 +03:00
parent 7e365ccfcf
commit bbc8ea57af
2913 changed files with 227 additions and 250 deletions

View File

@@ -0,0 +1,19 @@
import { SETTINGS_TAB_SLUGS, type SettingsTabSlug } from "./settings-constants";
const PUBLIC_TABS = new Set<SettingsTabSlug>(["locale", "theme"]);
export function defaultTab(isLoggedIn: boolean): SettingsTabSlug {
return isLoggedIn ? "match-profile" : "theme";
}
export function resolveActiveTab(
raw: string | null,
isLoggedIn: boolean,
): SettingsTabSlug {
if (raw && (SETTINGS_TAB_SLUGS as readonly string[]).includes(raw)) {
const slug = raw as SettingsTabSlug;
if (!isLoggedIn && !PUBLIC_TABS.has(slug)) return defaultTab(false);
return slug;
}
return defaultTab(isLoggedIn);
}