Skip to content

Commit 4b64471

Browse files
committed
feat: make footer logos configurable (done)
1 parent 6a40156 commit 4b64471

File tree

5 files changed

+20
-11
lines changed

5 files changed

+20
-11
lines changed

apps/frontend/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
VITE_API_URL=http://localhost:3000
22
VITE_THEME_COLOR=quassel
33
VITE_TITLE=Quassel
4-
VITE_LOGOS=
4+
VITE_LOGOS='[{"path": "/logos/uzh-logo.svg", "alt": "University of Zurich Logo", "url": "https://uzh.ch"}, {"path": "/logos/weltentdecker-logo.png", "alt": "Kleine Weltentdecker Logo", "url": "https://www.psychologie.uzh.ch/de/bereiche/dev/devpsy/Weltentdecker.html"}]'

apps/frontend/src/routes/__root.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ const messages = i18n("RootRoute", {
3434
title: "Home",
3535
});
3636

37+
const logos = JSON.parse(C.env.logos);
38+
3739
function Root() {
3840
const n = useNavigate();
3941
const sessionStore = useStore($session);
@@ -103,7 +105,7 @@ function Root() {
103105

104106
<AppShell.Footer>
105107
<Group justify="space-between">
106-
<FooterLogos />
108+
<FooterLogos logos={logos} />
107109
Version {version}
108110
</Group>
109111
</AppShell.Footer>
Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
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+
path: string;
5+
alt: string;
6+
url: string;
7+
};
8+
9+
type Props = {
10+
logos: LogoItem[];
11+
};
12+
13+
export function FooterLogos({ logos }: Props) {
614
return (
715
<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>
16+
{logos.map((logo) => (
17+
<a href={logo.url} key={logo.path}>
18+
<img src={logo.path} alt={logo.alt} height={50} />
19+
</a>
20+
))}
1421
</Group>
1522
);
1623
}

0 commit comments

Comments
 (0)