Skip to content

Commit

Permalink
Update Footer component to accept links as props
Browse files Browse the repository at this point in the history
  • Loading branch information
HendrikSchmidt committed May 2, 2024
1 parent ae3ae39 commit 85dcb37
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
14 changes: 1 addition & 13 deletions packages/shared/components/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import bmiLogo from "public/img/bmi-logo.png";
import { Link } from "react-router-dom";
import {
PATH_A11Y,
PATH_IMPRINT,
PATH_PRIVACY,
} from "../../tool-finder/src/routes";
import { A11Y_MESSAGE_NEW_WINDOW } from "./Aria";
import Container from "./Container";
import Image from "./Image";
Expand All @@ -26,15 +21,8 @@ const paragraphs = [
"Im Auftrag des [Bundesministerium des Innern und für Heimat](https://www.bmi.bund.de/)",
},
];
const links = [
{ url: PATH_IMPRINT, text: "Impressum" },
{ url: PATH_PRIVACY, text: "Datenschutzerklärung" },
// { url: PATH_COOKIE, text: "Cookie-Einstellungen" },
{ url: PATH_A11Y, text: "Barrierefreiheit" },
// { url: PATH_OSS, text: "Open Source Code" },
];

export default function Footer() {
export default function Footer({ links }: { links: LinkProps[] }) {
const linksMiddleIndex = Math.ceil(links.length / 2);
const linksFirstColumn: typeof links = links.slice(0, linksMiddleIndex);
const linksSecondColumn: typeof links = links.slice(linksMiddleIndex);
Expand Down
10 changes: 9 additions & 1 deletion packages/tool-finder/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,14 @@ function App() {
},
];

const footerLinks = [
{ url: PATH_IMPRINT, text: "Impressum" },
{ url: PATH_PRIVACY, text: "Datenschutzerklärung" },
// { url: PATH_COOKIE, text: "Cookie-Einstellungen" },
{ url: PATH_A11Y, text: "Barrierefreiheit" },
// { url: PATH_OSS, text: "Open Source Code" },
];

return (
<div className="flex flex-col min-h-screen">
<ScrollToTop />
Expand All @@ -165,7 +173,7 @@ function App() {
</div>
<FeedbackBanner />
</main>
<Footer />
<Footer links={footerLinks} />
<Aria />
</div>
);
Expand Down

0 comments on commit 85dcb37

Please sign in to comment.