From e02e125806002e760e9a418bf0b60dec15419570 Mon Sep 17 00:00:00 2001 From: Dicken Date: Wed, 27 May 2026 08:13:57 +0200 Subject: [PATCH] Dateien nach "frontend/src" hochladen --- frontend/src/App.jsx | 16 +++++++--- frontend/src/calendar.jsx | 63 ++++++++++++++++++++------------------- 2 files changed, 45 insertions(+), 34 deletions(-) diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index b36231b..10e6609 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -609,9 +609,14 @@ function Notepad({ toast }) { return (
{isOpen &&
window.matchMedia('(display-mode: standalone)').matches); + const [splash, setSplash] = useState(() => { + // Only show splash in standalone PWA mode, and only once per session + return window.matchMedia('(display-mode: standalone)').matches && !sessionStorage.getItem('splash_shown'); + }); const [user,setUser]=useState(null); const [active,setActive]=useState('dashboard'); const [toastMsg,setToastMsg]=useState({msg:'',type:'success'}); @@ -1187,7 +1195,7 @@ export default function App() { setTimeout(()=>setToastMsg({msg:'',type:'success'}),3500); },[]); - if(splash) return setSplash(false)}/>; + if(splash) return { setSplash(false); sessionStorage.setItem('splash_shown','1'); }}/>; if(!user) return setUser(u)}/>; const activeTool = TOOLS.find(t=>t.id===active); diff --git a/frontend/src/calendar.jsx b/frontend/src/calendar.jsx index a009321..05dcaa4 100644 --- a/frontend/src/calendar.jsx +++ b/frontend/src/calendar.jsx @@ -122,6 +122,9 @@ export default function CalendarWidget() { }; const refresh = () => { api('/calendar/feeds').then(f=>{ setFeeds(f); loadFeeds(f); }).catch(()=>{}); }; + // Load on mount so next event shows without opening + useEffect(() => { refresh(); }, []); + // Reload when opened useEffect(() => { if (isOpen) refresh(); }, [isOpen]); // Nächster oder aktueller Termin (für zugeklappte Ansicht) @@ -155,9 +158,27 @@ export default function CalendarWidget() { {/* Header */}
{isOpen && feeds.length > 0 && ( @@ -170,23 +191,7 @@ export default function CalendarWidget() { )}
- {/* Nächster Termin auch im zugeklappten Zustand */} - {!isOpen && nextEvent && ( -
- -
-
{nextEvent.summary}
-
- {nextEvent.allDay - ? nextEvent.dtstart.toLocaleDateString('de-DE',{weekday:'short',day:'numeric',month:'short'}) - : `${nextEvent.dtstart.toLocaleDateString('de-DE',{weekday:'short',day:'numeric',month:'short'})} ${nextEvent.dtstart.toLocaleTimeString('de-DE',{hour:'2-digit',minute:'2-digit'})}` - } -
-
-
- )} + {isOpen && (
@@ -210,20 +215,18 @@ export default function CalendarWidget() { {MONTHS[cur.m]} {cur.y} - {(cur.m !== today.getMonth() || cur.y !== today.getFullYear()) && ( - - )} +
-
+
=768 ? 'flex' : 'block', gap:16, alignItems:'flex-start' }}> {/* Kalender-Grid */} -
=768 ? 'min(320px,50%)' : '100%' }}> +
=768 ? 'min(300px,50%)' : '100%' }}> {/* Wochentage */}
@@ -268,8 +271,8 @@ export default function CalendarWidget() {
{/* Ende Kalender-Grid */} - {/* Termine – auf PC rechts, auf Mobile darunter */} -
+ {/* Termine */} +
=768 ? 0 : 10 }}> {/* Ausgewählter Tag Events */} {selected && (