Skip to content

Commit 756711c

Browse files
authored
Fix get started link (#1144)
1 parent 2abcfb2 commit 756711c

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/ui/layout/hero.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Component, Index, Match, Switch, createMemo } from "solid-js";
22
import { ButtonLink } from "../button-link";
33
import { snippetLines } from "./hero-code-snippet";
4-
import { useLocation, useMatch } from "@solidjs/router";
4+
import { useMatch } from "@solidjs/router";
55
import { useI18n } from "~/i18n/i18n-context";
66
import RenderedCode from "./hero-code-snippet";
77

@@ -16,21 +16,25 @@ const TrafficLightsIcon: Component<{ class: string }> = (props) => {
1616
};
1717

1818
export const Hero: Component = () => {
19-
const location = useLocation();
2019
const isStart = useMatch(() => "/solid-start/*");
2120
const isRouter = useMatch(() => "/solid-router/*");
2221
const isMeta = useMatch(() => "/solid-meta/*");
2322

2423
const buttonHref = createMemo(() => {
25-
if (location.pathname === "/solid-start")
24+
if (isStart()) {
2625
return "solid-start/getting-started";
27-
if (location.pathname === "/solid-router")
26+
}
27+
if (isRouter()) {
2828
return "solid-router/getting-started/installation-and-setup";
29-
if (location.pathname === "/solid-meta")
29+
}
30+
if (isMeta()) {
3031
return "solid-meta/getting-started/installation-and-setup";
32+
}
3133
return "/quick-start";
3234
});
35+
3336
const i18n = useI18n();
37+
3438
return (
3539
<div class="overflow-hidden bg-sky-100/80 border border-sky-200 dark:border-none dark:bg-slate-900 mb-10 ">
3640
<div class="py-10 sm:px-2 lg:relative">

0 commit comments

Comments
 (0)