From 5bb066dff8e699f274d27a6713325a2e40555361 Mon Sep 17 00:00:00 2001 From: Connor Yoh Date: Thu, 28 Aug 2025 16:28:54 +0100 Subject: [PATCH] Basic footer structure --- frontend/src/App.tsx | 5 +- frontend/src/components/shared/Footer.tsx | 149 ++++++++++++++++++++++ frontend/src/pages/HomePage.tsx | 31 +++-- 3 files changed, 171 insertions(+), 14 deletions(-) create mode 100644 frontend/src/components/shared/Footer.tsx diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index ef4d663f6..9c621b736 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1,4 +1,5 @@ import React, { Suspense } from "react"; +import { ScrollArea } from "@mantine/core"; import { RainbowThemeProvider } from "./components/shared/RainbowThemeProvider"; import { FileContextProvider } from "./contexts/FileContext"; import { NavigationProvider } from "./contexts/NavigationContext"; @@ -40,7 +41,9 @@ export default function App() { - + + + diff --git a/frontend/src/components/shared/Footer.tsx b/frontend/src/components/shared/Footer.tsx new file mode 100644 index 000000000..9441a5008 --- /dev/null +++ b/frontend/src/components/shared/Footer.tsx @@ -0,0 +1,149 @@ +import { Flex } from '@mantine/core'; +import React, { useEffect } from 'react'; +import { useTranslation } from 'react-i18next'; + +interface FooterProps { + privacyPolicy?: string; + termsAndConditions?: string; + accessibilityStatement?: string; + cookiePolicy?: string; + impressum?: string; + analyticsEnabled?: boolean; +} + +export default function Footer({ + privacyPolicy = '/privacy', + termsAndConditions = '/terms', + accessibilityStatement = 'accessibility', + cookiePolicy = 'cookie', + impressum = 'impressum', + analyticsEnabled = false +}: FooterProps) { + const { t } = useTranslation(); + + // Load cookie consent script when analytics is enabled + useEffect(() => { + if (analyticsEnabled) { + const script = document.createElement('script'); + script.type = 'module'; + script.src = '/js/thirdParty/cookieconsent-config.js'; + document.head.appendChild(script); + + return () => { + // Cleanup script when component unmounts + if (document.head.contains(script)) { + document.head.removeChild(script); + } + }; + } + }, [analyticsEnabled]); + + const handleCookiePreferences = () => { + if (typeof window !== 'undefined' && (window as any).CookieConsent) { + (window as any).CookieConsent.show(true); + } + }; + + return ( +
+ + + {t('licenses.nav', 'Licenses')} + + + {t('releases.footer', 'Releases')} + + + {t('survey.nav', 'Survey')} + + {privacyPolicy && ( + + {t('legal.privacy', 'Privacy Policy')} + + )} + {termsAndConditions && ( + + {t('legal.terms', 'Terms and Conditions')} + + )} + {accessibilityStatement && ( + + {t('legal.accessibility', 'Accessibility')} + + )} + {cookiePolicy && ( + + {t('legal.cookie', 'Cookie Preferecences')} + + )} + {analyticsEnabled && ( + + )} + + + {/* Powered by section */} + + {t('poweredBy', 'Powered by')} + + Stirling PDF + + +
+ ); +} diff --git a/frontend/src/pages/HomePage.tsx b/frontend/src/pages/HomePage.tsx index 12c1f4d7f..c132f656b 100644 --- a/frontend/src/pages/HomePage.tsx +++ b/frontend/src/pages/HomePage.tsx @@ -11,6 +11,7 @@ import Workbench from "../components/layout/Workbench"; import QuickAccessBar from "../components/shared/QuickAccessBar"; import RightRail from "../components/shared/RightRail"; import FileManager from "../components/FileManager"; +import Footer from "../components/shared/Footer"; export default function HomePage() { @@ -38,17 +39,21 @@ export default function HomePage() { // Note: File selection limits are now handled directly by individual tools return ( - - - - - - - +
+ + + + + + + +
); -} \ No newline at end of file +}