Skip to content

Commit 39db9d7

Browse files
authored
Use solid router A component (#127)
The A component is aware of the baseUrl while a tag is not. This also fixes link to about page when BASE_PATH env var is set during build. Fixes #122
1 parent 4d636bf commit 39db9d7

File tree

1 file changed

+3
-3
lines changed
  • apps/class-solid/src/components

1 file changed

+3
-3
lines changed

apps/class-solid/src/components/Nav.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useLocation } from "@solidjs/router";
1+
import { A, useLocation } from "@solidjs/router";
22
import { saveToLocalStorage } from "~/lib/state";
33
import { ShareButton } from "./ShareButton";
44
import { MdiContentSave } from "./icons";
@@ -13,11 +13,11 @@ export default function Nav() {
1313
<nav class="bg-sky-800">
1414
<ul class="container flex items-center gap-4 p-3 text-gray-200">
1515
<li class={`border-b-2 ${active("/")}l`}>
16-
<a href="/">CLASS</a>
16+
<A href="/">CLASS</A>
1717
</li>
1818
<li class=" w-full" />
1919
<li class={`border-b-2 ${active("/about")}`}>
20-
<a href="/about">About</a>
20+
<A href="/about">About</A>
2121
</li>
2222
<li>
2323
<button

0 commit comments

Comments
 (0)