feat: Initialize Capacitor Android project with PWA assets and update API session SameSite configuration.

This commit is contained in:
2025-12-26 16:57:45 +01:00
parent 198b324646
commit 2b8d39824a
95 changed files with 4343 additions and 55 deletions

View File

@@ -0,0 +1,33 @@
import { useEffect } from 'react';
import { StatusBar, Style } from '@capacitor/status-bar';
import { Capacitor } from '@capacitor/core';
import { useTheme } from 'next-themes';
export const useMobileStatusBar = () => {
const { resolvedTheme } = useTheme();
useEffect(() => {
// Only run on native platforms
if (Capacitor.isNativePlatform()) {
const setStatusBarStyle = async () => {
try {
// On Android, make sure the status bar overlays the WebView (transparent)
if (Capacitor.getPlatform() === 'android') {
await StatusBar.setOverlaysWebView({ overlay: true });
}
// Determine style based on theme
// If theme is dark => Use Dark style (usually white text)
// If theme is light => Use Light style (usually dark text)
const style = resolvedTheme === 'dark' ? Style.Dark : Style.Light;
await StatusBar.setStyle({ style });
} catch (e) {
console.error('Failed to configure status bar:', e);
}
};
setStatusBarStyle();
}
}, [resolvedTheme]);
};