project setup

This commit is contained in:
Sone
2025-11-02 10:08:56 +01:00
commit 568838003e
174 changed files with 27100 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
import { usePathname } from "expo-router";
import { useEffect } from "react";
import { Platform } from "react-native";
export const useDocumentTitle = () => {
const pathname = usePathname();
const getSectionFromPath = (path: string): string => {
if (path.includes("/dashboard") || path === "/(tabs)" || path === "/") {
return "Dashboard";
} else if (path.includes("/accounts")) {
return "Accounts";
} else if (path.includes("/logs")) {
return "Logs";
} else if (path.includes("/reports")) {
return "Reports";
} else if (path.includes("/data-protection")) {
return "Data Protection";
} else if (path.includes("/settings")) {
return "Settings";
} else {
return "Project Athena";
}
};
const currentSection = getSectionFromPath(pathname);
useEffect(() => {
if (Platform.OS === "web") {
document.title = `${currentSection} | Project Athena`;
}
}, [currentSection, pathname]);
return currentSection;
};