From f9b8b01954c0a3a7795415c627a90a9c8501ad69 Mon Sep 17 00:00:00 2001 From: Markus Tacker Date: Tue, 27 Feb 2024 01:00:39 +0100 Subject: [PATCH] fix(navigation): include base --- src/context/Navigation.tsx | 4 ++-- vite.config.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/context/Navigation.tsx b/src/context/Navigation.tsx index ddd8cf1..69314e3 100644 --- a/src/context/Navigation.tsx +++ b/src/context/Navigation.tsx @@ -29,7 +29,7 @@ export const NavigationProvider = (props: ParentProps) => { } const link = (next: Navigation) => new URL( - `/#${encode({ + `${BASE_URL}/#${encode({ ...location(), ...next, })}`, @@ -90,7 +90,7 @@ export const NavigationContext = createContext<{ navigateHome: () => undefined, navigateWithSearchTerm: () => undefined, linkToHome: () => - new URL(`/#${encode(Home)}`, document.location.href).toString(), + new URL(`${BASE_URL}/#${encode(Home)}`, document.location.href).toString(), link: () => '/#', linkWithoutSearchTerm: () => '/#', linkToSearch: () => '/#', diff --git a/vite.config.ts b/vite.config.ts index 6018643..2db3381 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -14,7 +14,7 @@ const { registryEndpoint } = fromEnv({ registryEndpoint: 'REGISTRY_ENDPOINT', })(process.env) -const base = trimTrailingSlash(process.env.BASE_URL ?? '') +const base = trimTrailingSlash(process.env.BASE_URL ?? '/map/') // https://vitejs.dev/config/ export default defineConfig({