e518bce922
Resolve all merge conflicts between our automation feature branch and current main (v0.163.0, 920 commits ahead). Conflicts resolved: - app/api/__init__.py: add automation_router alongside main's new routers (classification_rules, qr_auth, sessions, system_reset) - app/config.py: add main's new settings (dropbox_use_global_credentials, factory_reset_on_startup, enable_factory_reset) - app/models.py: add main's new models (ClassificationRuleModel, UserSession, QRLoginChallenge, SharePoint integration type) - app/utils/settings_service.py: merge automation_hooks_enabled with main's new metadata entries - docs/API.md: merge automation API docs with main's classification rules docs - docs/ConfigurationGuide.md: add factory reset settings - tests/conftest.py: import both AutomationHook and new main models Migration renumbered: - 037_add_automation_hooks → 040_add_automation_hooks - down_revision: 039_add_classification_rules (was 036_add_document_translation_fields) - Chain: 036 → 037 → 038 → 039 → 040 (automation hooks) For all non-automation files with conflicts, main's version was taken since our branch did not modify those files (conflicts were from a stale prior merge). Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com> Agent-Logs-Url: https://github.com/christianlouis/DocuElevate/sessions/cb62f012-3b69-4415-835e-3857ce3e9f45
87 lines
2.6 KiB
TypeScript
87 lines
2.6 KiB
TypeScript
/**
|
||
* Tab navigator layout for authenticated users.
|
||
*
|
||
* Registers three tabs: Upload (default), Files, and Profile.
|
||
* Push notifications are initialised here so they activate as soon as the
|
||
* user enters the authenticated area.
|
||
*/
|
||
|
||
import { Tabs } from "expo-router";
|
||
import { Ionicons } from "@expo/vector-icons";
|
||
import React from "react";
|
||
import { usePushNotifications } from "../../src/hooks/usePushNotifications";
|
||
import { useAuth } from "../../src/context/AuthContext";
|
||
import { useLocale, t } from "../../src/i18n";
|
||
|
||
export default function TabLayout() {
|
||
const { isAuthenticated } = useAuth();
|
||
usePushNotifications(isAuthenticated);
|
||
// Subscribe to language changes so tab labels re-render when the language
|
||
// is switched. The `lang` variable is intentionally unused – its only
|
||
// purpose is to make this component a consumer of LocaleContext.
|
||
useLocale();
|
||
|
||
return (
|
||
<Tabs
|
||
screenOptions={{
|
||
tabBarActiveTintColor: "#1e40af",
|
||
tabBarInactiveTintColor: "#9ca3af",
|
||
tabBarStyle: {
|
||
borderTopColor: "#e5e7eb",
|
||
backgroundColor: "#ffffff",
|
||
},
|
||
headerStyle: {
|
||
backgroundColor: "#1e40af",
|
||
},
|
||
headerTintColor: "#ffffff",
|
||
headerTitleStyle: {
|
||
fontWeight: "700",
|
||
},
|
||
}}
|
||
>
|
||
<Tabs.Screen
|
||
name="index"
|
||
options={{
|
||
title: t("tabs.upload"),
|
||
tabBarLabel: t("tabs.upload"),
|
||
tabBarIcon: ({ color, size }) => (
|
||
<Ionicons name="cloud-upload-outline" size={size} color={color} />
|
||
),
|
||
headerTitle: "DocuElevate",
|
||
}}
|
||
/>
|
||
<Tabs.Screen
|
||
name="files"
|
||
options={{
|
||
title: t("tabs.files"),
|
||
tabBarLabel: t("tabs.files"),
|
||
tabBarIcon: ({ color, size }) => (
|
||
<Ionicons name="document-text-outline" size={size} color={color} />
|
||
),
|
||
headerTitle: t("files.title"),
|
||
}}
|
||
/>
|
||
<Tabs.Screen
|
||
name="profile"
|
||
options={{
|
||
title: t("tabs.profile"),
|
||
tabBarLabel: t("tabs.profile"),
|
||
tabBarIcon: ({ color, size }) => (
|
||
<Ionicons name="person-circle-outline" size={size} color={color} />
|
||
),
|
||
headerTitle: t("tabs.profile"),
|
||
}}
|
||
/>
|
||
{/* File detail screen – hidden from tab bar, accessed via navigation */}
|
||
<Tabs.Screen
|
||
name="file-detail"
|
||
options={{
|
||
href: null,
|
||
title: t("file_detail.title"),
|
||
headerTitle: t("file_detail.title"),
|
||
}}
|
||
/>
|
||
</Tabs>
|
||
);
|
||
}
|