refactor: extract navigation elements

This commit is contained in:
Carlos Valente
2025-06-22 11:34:00 +02:00
committed by Carlos Valente
parent 7fdda1c969
commit 269091986a
26 changed files with 421 additions and 356 deletions
+2 -2
View File
@@ -20,13 +20,13 @@ export function openLink(url: string) {
* serverUrl and baseURI are used for testing
*/
export function handleLinks(
event: MouseEvent,
location: string,
event?: MouseEvent,
externalServerUrl: string = serverURL,
externalBaseURI: string = baseURI,
) {
// we handle the link manually
event.preventDefault();
event?.preventDefault();
const destination = new URL(externalServerUrl);
destination.pathname = externalBaseURI ? `${externalBaseURI}/${location}` : location;