From 948f8b00581e043a0eb112be6d8f24d4faebe2a2 Mon Sep 17 00:00:00 2001
From: Bram Suurd <78373894+BramSuurdje@users.noreply.github.com>
Date: Wed, 13 Nov 2024 15:16:29 +0100
Subject: [PATCH] Fix image source for script logos to ensure leading slash is
consistent for all components' paths
---
frontend/src/app/scripts/_components/ScriptAccordion.tsx | 4 ++--
frontend/src/app/scripts/_components/ScriptInfoBlocks.tsx | 8 ++++----
frontend/src/app/scripts/_components/ScriptItem.tsx | 4 ++--
frontend/src/components/CommandMenu.tsx | 4 ++--
4 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/frontend/src/app/scripts/_components/ScriptAccordion.tsx b/frontend/src/app/scripts/_components/ScriptAccordion.tsx
index 8e38dbec..96be28da 100644
--- a/frontend/src/app/scripts/_components/ScriptAccordion.tsx
+++ b/frontend/src/app/scripts/_components/ScriptAccordion.tsx
@@ -105,13 +105,13 @@ export default function ScriptAccordion({
>
((e.currentTarget as HTMLImageElement).src =
- `${basePath}/logo.png`)
+ `/${basePath}/logo.png`)
}
alt={script.name}
className="mr-1 w-4 h-4 rounded-full"
diff --git a/frontend/src/app/scripts/_components/ScriptInfoBlocks.tsx b/frontend/src/app/scripts/_components/ScriptInfoBlocks.tsx
index 1db535a1..1c418c94 100644
--- a/frontend/src/app/scripts/_components/ScriptInfoBlocks.tsx
+++ b/frontend/src/app/scripts/_components/ScriptInfoBlocks.tsx
@@ -92,14 +92,14 @@ export function LatestScripts({ items }: { items: Category[] }) {
((e.currentTarget as HTMLImageElement).src =
- `${basePath}/logo.png`)
+ `/${basePath}/logo.png`)
}
className="h-11 w-11 object-contain"
/>
@@ -165,13 +165,13 @@ export function MostViewedScripts({ items }: { items: Category[] }) {
((e.currentTarget as HTMLImageElement).src =
- `${basePath}/logo.png`)
+ `/${basePath}/logo.png`)
}
className="h-11 w-11 object-contain"
/>
diff --git a/frontend/src/app/scripts/_components/ScriptItem.tsx b/frontend/src/app/scripts/_components/ScriptItem.tsx
index f147b114..835fce57 100644
--- a/frontend/src/app/scripts/_components/ScriptItem.tsx
+++ b/frontend/src/app/scripts/_components/ScriptItem.tsx
@@ -41,11 +41,11 @@ function ScriptItem({
((e.currentTarget as HTMLImageElement).src =
- `${basePath}/logo.png`)
+ `/${basePath}/logo.png`)
}
height={400}
alt={item.name}
diff --git a/frontend/src/components/CommandMenu.tsx b/frontend/src/components/CommandMenu.tsx
index 2c18ca81..b1c8e126 100644
--- a/frontend/src/components/CommandMenu.tsx
+++ b/frontend/src/components/CommandMenu.tsx
@@ -103,10 +103,10 @@ export default function CommandMenu() {
>
setOpen(false)}>
((e.currentTarget as HTMLImageElement).src =
- `${basePath}/logo.png`)
+ `/${basePath}/logo.png`)
}
unoptimized
width={16}