We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0ca4c35 commit e9dab51Copy full SHA for e9dab51
site/src/pages/index.tsx
@@ -1,12 +1,13 @@
1
import { FC } from "react"
2
-import { Navigate } from "react-router-dom"
+import { Navigate, useSearchParams } from "react-router-dom"
3
4
export const IndexPage: FC = () => {
5
- // TODO@jsjoeio - here's what we need to do:
6
- /*
7
- 1. check query params for template
8
- 2. if none, navigate to /workspaces
9
- 3. if some, navigate to /templates/<template>
10
- */
+ const [searchParams, _] = useSearchParams();
+ const template = searchParams.get("template")
+
+ if (template) {
+ return <Navigate to={`/templates/${template}`} replace />
+ }
11
12
return <Navigate to="/workspaces" replace />
13
}
0 commit comments