mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-22 07:26:42 +02:00
✨ feat: add global start page setting across all apps
- Add GeneralSettings types (startPages, weekStartsOn, soundsEnabled) - Create app-routes.ts with available routes for 12 apps - Extend UserSettingsStore with general settings support - Update GlobalSettingsSection with start page selector UI - Add start page redirect logic to all app layouts: - Clock, Calendar, Todo, Zitare, Picture - Manadeck, Presi, Chat, Manacore - Create user-settings stores for Clock and Todo apps 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
5b3c5ff4fb
commit
bbe540c3f1
16 changed files with 602 additions and 22 deletions
19
apps/clock/apps/web/src/lib/stores/user-settings.svelte.ts
Normal file
19
apps/clock/apps/web/src/lib/stores/user-settings.svelte.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* User Settings Store for Clock
|
||||
*
|
||||
* This store syncs settings with mana-core-auth and provides:
|
||||
* - Global settings that apply to all apps
|
||||
* - Per-app overrides for customization
|
||||
* - localStorage caching for offline support
|
||||
*/
|
||||
|
||||
import { createUserSettingsStore } from '@manacore/shared-theme';
|
||||
import { authStore } from './auth.svelte';
|
||||
|
||||
const MANA_AUTH_URL = 'http://localhost:3001';
|
||||
|
||||
export const userSettings = createUserSettingsStore({
|
||||
appId: 'clock',
|
||||
authUrl: MANA_AUTH_URL,
|
||||
getAccessToken: () => authStore.getAccessToken(),
|
||||
});
|
||||
|
|
@ -1,8 +1,10 @@
|
|||
<script lang="ts">
|
||||
import { _ } from 'svelte-i18n';
|
||||
import { theme } from '$lib/stores/theme.svelte';
|
||||
import { userSettings } from '$lib/stores/user-settings.svelte';
|
||||
import { setLocale, supportedLocales } from '$lib/i18n';
|
||||
import { THEME_DEFINITIONS } from '@manacore/shared-theme';
|
||||
import { GlobalSettingsSection } from '@manacore/shared-ui';
|
||||
|
||||
// Settings state
|
||||
let clockFormat = $state<'24h' | '12h'>('24h');
|
||||
|
|
@ -29,6 +31,11 @@
|
|||
es: 'Español',
|
||||
it: 'Italiano',
|
||||
};
|
||||
|
||||
// Translation function for GlobalSettingsSection
|
||||
function translate(key: string): string {
|
||||
return $_?.(key) ?? key;
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="mx-auto max-w-2xl space-y-6">
|
||||
|
|
@ -160,4 +167,17 @@
|
|||
Töne können für einzelne Wecker und Timer in deren Einstellungen angepasst werden.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- Global Settings Section -->
|
||||
<GlobalSettingsSection
|
||||
{userSettings}
|
||||
appId="clock"
|
||||
showNavigation={false}
|
||||
showTheme={false}
|
||||
showLanguage={false}
|
||||
showGeneral={true}
|
||||
title="Globale Einstellungen"
|
||||
description="Diese Einstellungen gelten für alle Mana Apps"
|
||||
t={translate}
|
||||
/>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue