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

@@ -6,9 +6,11 @@ import RegisterPage from "@/pages/register";
import DashboardPage from "@/pages/dashboard";
import Layout from "@/components/layout";
import { useSync } from "@/lib/sync";
import { useMobileStatusBar } from "@/hooks/use-mobile-status-bar";
function App() {
useSync();
useMobileStatusBar();
return (
<Routes>

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]);
};

View File

@@ -121,5 +121,9 @@
body {
@apply bg-background text-foreground;
padding-top: env(safe-area-inset-top);
padding-bottom: env(safe-area-inset-bottom);
padding-left: env(safe-area-inset-left);
padding-right: env(safe-area-inset-right);
}
}