From bad7ffb67718faea82aca7431ddf671c6a0e9410 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Tue, 20 Sep 2022 20:27:52 +0000 Subject: [PATCH] feat: support template query param in index This adds support to navigate directly to a template from the index by using the `?template=` query param. --- site/src/pages/index.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/site/src/pages/index.tsx b/site/src/pages/index.tsx index 1a7e21fedb..dd0c84db1c 100644 --- a/site/src/pages/index.tsx +++ b/site/src/pages/index.tsx @@ -1,6 +1,13 @@ import { FC } from "react" -import { Navigate } from "react-router-dom" +import { Navigate, useSearchParams } from "react-router-dom" export const IndexPage: FC = () => { + const [searchParams, _] = useSearchParams() + const template = searchParams.get("template") + + if (template) { + return + } + return }