diff --git a/packages/web/components/DatabaseNav/utils.ts b/packages/web/components/DatabaseNav/utils.ts index bb832ca0..e5909f24 100644 --- a/packages/web/components/DatabaseNav/utils.ts +++ b/packages/web/components/DatabaseNav/utils.ts @@ -1,12 +1,5 @@ import { OptionalRefParams } from "@lib/params"; -import { - database, - DatabaseUrl, - defaultDoc, - defaultDocDefaultBranch, - ref, - RefUrl, -} from "@lib/urls"; +import { database, DatabaseUrl, defaultDoc, ref, RefUrl } from "@lib/urls"; import { Route } from "@lib/urlUtils"; function getUrlFromName(name: string): [DatabaseUrl, RefUrl?] { @@ -14,7 +7,7 @@ function getUrlFromName(name: string): [DatabaseUrl, RefUrl?] { case "Database": return [database, ref]; case "About": - return [defaultDocDefaultBranch, defaultDoc]; + return [database, defaultDoc]; // case "Commit Log": // return [database, commitLog]; // case "Releases": diff --git a/packages/web/components/layouts/DatabaseLayout/index.tsx b/packages/web/components/layouts/DatabaseLayout/index.tsx index b15ec693..45eb6ded 100644 --- a/packages/web/components/layouts/DatabaseLayout/index.tsx +++ b/packages/web/components/layouts/DatabaseLayout/index.tsx @@ -29,7 +29,7 @@ type Props = { }; export default function DatabaseLayout(props: Props) { - const { q, tableName } = props.params; + const { q, tableName, ...refParams } = props.params; const forDataTable = !!(q || tableName); const showHeader = forDataTable || props.showSqlConsole || props.empty; const useFullWidth = forDataTable || !!props.wide; @@ -40,10 +40,18 @@ export default function DatabaseLayout(props: Props) { -
+
{props.children} diff --git a/packages/web/lib/urls.ts b/packages/web/lib/urls.ts index 9719030f..391878c6 100644 --- a/packages/web/lib/urls.ts +++ b/packages/web/lib/urls.ts @@ -44,7 +44,7 @@ export const newBranch = (p: ps.OptionalRefParams): Route => branches(p).addStatic("new").withQuery({ refName: p.refName }); export const defaultDoc = (p: ps.RefParams): Route => - defaultDocDefaultBranch(p).addDynamic("refName", p.refName, ENCODE); + database(p).addStatic("doc").addDynamic("refName", p.refName, ENCODE); export const doc = (p: ps.DocParams): Route => defaultDoc(p).addDynamic("docName", p.docName, ENCODE);