Skip to content

Commit 0da6f83

Browse files
committed
feat: add logo URL configuration and update Brand component and its usage
1 parent de63f8a commit 0da6f83

File tree

8 files changed

+12
-6
lines changed

8 files changed

+12
-6
lines changed

apps/frontend/.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
VITE_API_URL=http://localhost:3000
22
VITE_THEME_COLOR=quassel
33
VITE_TITLE=Quassel
4+
VITE_LOGO_URL=../public/logo.svg

apps/frontend/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
window.env = {
2525
apiUrl: '$API_URL',
2626
themeColor: '$THEME_COLOR',
27-
title: '$TITLE'
27+
title: '$TITLE',
28+
logoUrl: '$LOGO_URL',
2829
};
2930
</script>
3031
</head>
File renamed without changes.

apps/frontend/src/configuration.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export const C = {
1010
apiUrl: getEnv("apiUrl") || import.meta.env.VITE_API_URL,
1111
themeColor: getEnv("themeColor") || import.meta.env.VITE_THEME_COLOR,
1212
title: getEnv("title") || import.meta.env.VITE_TITLE,
13+
logoUrl: getEnv("logoUrl") || import.meta.env.VITE_LOGO_URL,
1314
},
1415
ui: {
1516
maxDropdownHeight: 800,

apps/frontend/src/routes/__root.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function Root() {
6767
<AppShell.Header>
6868
<Group justify="space-between">
6969
<Link to="/">
70-
<Brand title={C.env.title} />
70+
<Brand title={C.env.title} logoUrl={C.env.logoUrl} />
7171
</Link>
7272
{sessionStore.email && (
7373
<Group>

apps/frontend/src/types.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ declare global {
2727
apiUrl?: string;
2828
themeColor?: string;
2929
title?: string;
30+
logoUrl?: string;
3031
};
3132
}
3233
}

examples/public/docker-compose.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ services:
7777
API_URL: https://api.test.example.com
7878
THEME_COLOR: uzhGold
7979
TITLE: LEMON
80+
volumes:
81+
- LOGO_URL: ../public/logo.svg
8082
labels:
8183
- "com.centurylinklabs.watchtower.enable=true"
8284
- "traefik.enable=true"

libs/ui/src/components/Brand.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import { Group, Stack, Title } from "@mantine/core";
2-
import Logo from "../assets/logo.svg?react";
1+
import { Group, Stack, Title, Image } from "@mantine/core";
32

43
type Props = {
54
title: string;
5+
logoUrl: string;
66
};
77

8-
export function Brand({ title }: Props) {
8+
export function Brand({ title, logoUrl }: Props) {
99
return (
1010
<Group className="quassel-Brand" gap="md">
11-
<Logo className="quassel-Logo" />
11+
<Image src={logoUrl} className="quassel-Logo" />
1212
<Stack gap={0}>
1313
<Title order={2} c="black">
1414
{title}

0 commit comments

Comments
 (0)