Files
Convivo/apps/admin/src/App.tsx
T
5f8ded56f6 feat: add sidecar service for Sessionize sync
- Introduced a new Node HTTP service (sidecar) to sync event agendas from Sessionize into Convivo.
- Implemented two import paths: API sync and Excel import for session and speaker data.
- Added necessary database migrations for sessionize integration, including new columns and audit tables.
- Created functions for handling speaker and session imports, ensuring proper error handling and logging.
- Established row-level security and grants for new functions to restrict access to service-role only.

Co-authored-by: Stephan Charles <[email protected]>
Co-authored-by: Amelia Hernandez <[email protected]>
Co-authored-by: Markus Franz <[email protected]>
Co-authored-by: Sabrina Hota <[email protected]>
Co-authored-by: Nilüfer Doğan <[email protected]>
2026-08-24 20:47:29 +02:00

116 lines
3.4 KiB
TypeScript

import { useState } from 'react';
import { AuthProvider, useAuth } from './context/AuthContext';
import { ToastProvider } from './context/ToastContext';
import { Login } from './screens/Login';
import { Dashboard } from './views/Dashboard';
import { Contacts } from './views/Contacts';
import { Registrations } from './views/Registrations';
import { Sponsors } from './views/Sponsors';
import { Schedule } from './views/Schedule';
import { Activity } from './views/Activity';
import { Events } from './views/Events';
import { Interfaces } from './views/Interfaces';
import { Spinner } from './components/ui';
export type View =
| 'dashboard'
| 'contacts'
| 'registrations'
| 'sponsors'
| 'schedule'
| 'activity'
| 'events'
| 'interfaces';
const NAV: { id: View; label: string; ico: string }[] = [
{ id: 'dashboard', label: 'Dashboard', ico: '📊' },
{ id: 'contacts', label: 'Contacts', ico: '👥' },
{ id: 'registrations', label: 'Registrations', ico: '🎟️' },
{ id: 'sponsors', label: 'Sponsors', ico: '🤝' },
{ id: 'schedule', label: 'Schedule', ico: '🗓️' },
{ id: 'activity', label: 'Activity', ico: '⚡' },
{ id: 'events', label: 'Events', ico: '📅' },
{ id: 'interfaces', label: 'Interfaces', ico: '🔌' },
];
function Shell() {
const { contact, loading, signOut } = useAuth();
const [view, setView] = useState<View>('dashboard');
if (loading) {
return (
<div className="loading-screen">
<Spinner />
</div>
);
}
if (!contact) return <Login />;
return (
<div className="app">
<aside className="sidebar">
<div className="brand">
<div className="logo"><img src="/icon-192.png" alt="APPE" /></div>
<div>
<div className="name">APPE</div>
<div className="sub">Admin</div>
</div>
</div>
<nav className="nav">
{NAV.map((n) => (
<button
key={n.id}
className={`nav-item ${view === n.id ? 'active' : ''}`}
onClick={() => setView(n.id)}
>
<span className="ico">{n.ico}</span>
{n.label}
</button>
))}
</nav>
<div className="sidebar-foot">
<div className="admin-card">
<span className="avatar" style={{ width: 36, height: 36, fontSize: 13, background: '#d50000' }}>
{contact.full_name
.split(' ')
.map((w) => w[0])
.slice(0, 2)
.join('')
.toUpperCase()}
</span>
<div className="who">
<div className="n">{contact.full_name}</div>
<div className="e">{contact.email}</div>
</div>
</div>
<button className="signout" onClick={signOut}>
Sign out
</button>
</div>
</aside>
<main className="content">
{view === 'dashboard' && <Dashboard onNavigate={setView} />}
{view === 'contacts' && <Contacts />}
{view === 'registrations' && <Registrations />}
{view === 'sponsors' && <Sponsors />}
{view === 'schedule' && <Schedule />}
{view === 'activity' && <Activity />}
{view === 'events' && <Events />}
{view === 'interfaces' && <Interfaces />}
</main>
</div>
);
}
export function App() {
return (
<ToastProvider>
<AuthProvider>
<Shell />
</AuthProvider>
</ToastProvider>
);
}