Skip to content

Commit 8203f46

Browse files
committed
feat: refactor FooterLogos component to accept dynamic logo configuration and move the footer logo asset to public
1 parent 0da6f83 commit 8203f46

File tree

4 files changed

+32
-10
lines changed

4 files changed

+32
-10
lines changed
File renamed without changes.

apps/frontend/src/routes/__root.tsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,21 @@ function Root() {
102102

103103
<AppShell.Footer>
104104
<Group justify="space-between">
105-
<FooterLogos />
105+
<FooterLogos
106+
logos={[
107+
{
108+
src: "../public/uzh-logo.svg",
109+
href: "https://uzh.ch",
110+
alt: "UZH Logo",
111+
},
112+
{
113+
src: "../public/weltentdecker-logo.png",
114+
href: "https://www.psychologie.uzh.ch/de/bereiche/dev/devpsy/Weltentdecker.html",
115+
alt: "Weltentdecker Logo",
116+
height: 50,
117+
},
118+
]}
119+
/>
106120
Version {version}
107121
</Group>
108122
</AppShell.Footer>
Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
11
import { Group } from "@mantine/core";
2-
import UZHLogo from "../assets/uzh-logo.svg?react";
3-
import WeltentdeckerLogo from "../assets/weltentdecker-logo.png";
42

5-
export function FooterLogos() {
3+
type LogoItem = {
4+
src: string;
5+
href: string;
6+
alt: string;
7+
height?: number;
8+
};
9+
10+
type FooterLogosProps = {
11+
logos: LogoItem[];
12+
};
13+
14+
export function FooterLogos({ logos }: FooterLogosProps) {
615
return (
716
<Group>
8-
<a href="https://uzh.ch">
9-
<UZHLogo />
10-
</a>
11-
<a href="https://www.psychologie.uzh.ch/de/bereiche/dev/devpsy/Weltentdecker.html">
12-
<img src={WeltentdeckerLogo} height={50} />
13-
</a>
17+
{logos.map((logo, index) => (
18+
<a key={index} href={logo.href}>
19+
<img src={logo.src} alt={logo.alt} height={logo.height || 50} />
20+
</a>
21+
))}
1422
</Group>
1523
);
1624
}

0 commit comments

Comments
 (0)