From f297edf843465c57b7dadcef59b22b394ece328f Mon Sep 17 00:00:00 2001 From: amirhhashemi <87268103+amirhhashemi@users.noreply.github.com> Date: Thu, 27 Mar 2025 17:25:03 +0330 Subject: [PATCH] Fix get started link --- src/ui/layout/hero.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/ui/layout/hero.tsx b/src/ui/layout/hero.tsx index d9afa07894..5bc6d02650 100644 --- a/src/ui/layout/hero.tsx +++ b/src/ui/layout/hero.tsx @@ -1,7 +1,7 @@ import { Component, Index, Match, Switch, createMemo } from "solid-js"; import { ButtonLink } from "../button-link"; import { snippetLines } from "./hero-code-snippet"; -import { useLocation, useMatch } from "@solidjs/router"; +import { useMatch } from "@solidjs/router"; import { useI18n } from "~/i18n/i18n-context"; import RenderedCode from "./hero-code-snippet"; @@ -16,21 +16,25 @@ const TrafficLightsIcon: Component<{ class: string }> = (props) => { }; export const Hero: Component = () => { - const location = useLocation(); const isStart = useMatch(() => "/solid-start/*"); const isRouter = useMatch(() => "/solid-router/*"); const isMeta = useMatch(() => "/solid-meta/*"); const buttonHref = createMemo(() => { - if (location.pathname === "/solid-start") + if (isStart()) { return "solid-start/getting-started"; - if (location.pathname === "/solid-router") + } + if (isRouter()) { return "solid-router/getting-started/installation-and-setup"; - if (location.pathname === "/solid-meta") + } + if (isMeta()) { return "solid-meta/getting-started/installation-and-setup"; + } return "/quick-start"; }); + const i18n = useI18n(); + return (