mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-25 11:54:39 +02:00
✨ feat(shared-auth-ui): add GuestWelcomeModal for guest onboarding
Add a unified welcome modal for guest mode that displays: - App icon, name, and description from shared-branding - Feature list of what guests can do (localized DE/EN) - Warning about local-only data storage - Login, Register, Help, and "Continue as Guest" buttons New files: - GuestWelcomeModal.svelte - The modal component - guestWelcome.ts - localStorage utilities for tracking seen state Integrated into: contacts, chat, todo, calendar, and clock apps
This commit is contained in:
parent
6402f287e8
commit
14c83cb4bd
10 changed files with 873 additions and 7 deletions
|
|
@ -70,6 +70,7 @@
|
|||
import { eventContextMenuStore } from '$lib/stores/eventContextMenu.svelte';
|
||||
import { heatmapStore } from '$lib/stores/heatmap.svelte';
|
||||
import { sessionEventsStore } from '$lib/stores/session-events.svelte';
|
||||
import { GuestWelcomeModal, shouldShowGuestWelcome } from '@manacore/shared-auth-ui';
|
||||
import type { CalendarViewType } from '@calendar/shared';
|
||||
|
||||
// App switcher items
|
||||
|
|
@ -567,6 +568,9 @@
|
|||
let showAuthGateModal = $state(false);
|
||||
let authGateAction = $state<'save' | 'sync' | 'feature'>('save');
|
||||
|
||||
// Guest welcome modal state
|
||||
let showGuestWelcome = $state(false);
|
||||
|
||||
// Show auth gate modal (can be called from child components)
|
||||
function showAuthGate(action: 'save' | 'sync' | 'feature' = 'save') {
|
||||
authGateAction = action;
|
||||
|
|
@ -587,6 +591,11 @@
|
|||
// Initialize session events for guest mode
|
||||
sessionEventsStore.initialize();
|
||||
|
||||
// Show guest welcome modal for unauthenticated users
|
||||
if (!authStore.isAuthenticated && shouldShowGuestWelcome('calendar')) {
|
||||
showGuestWelcome = true;
|
||||
}
|
||||
|
||||
// Load calendars and tags (works in both guest and authenticated mode)
|
||||
await calendarsStore.fetchCalendars();
|
||||
|
||||
|
|
@ -839,6 +848,23 @@
|
|||
action={authGateAction}
|
||||
/>
|
||||
|
||||
<!-- Guest Welcome Modal -->
|
||||
<GuestWelcomeModal
|
||||
appId="calendar"
|
||||
visible={showGuestWelcome}
|
||||
onClose={() => (showGuestWelcome = false)}
|
||||
onLogin={() => {
|
||||
showGuestWelcome = false;
|
||||
goto('/login');
|
||||
}}
|
||||
onRegister={() => {
|
||||
showGuestWelcome = false;
|
||||
goto('/register');
|
||||
}}
|
||||
helpHref="/help"
|
||||
locale={currentLocale === 'en' ? 'en' : 'de'}
|
||||
/>
|
||||
|
||||
<style>
|
||||
.layout-container {
|
||||
display: flex;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue