Skip to content

Commit

Permalink
web: Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tbantle22 committed Oct 19, 2023
1 parent 644eaa7 commit 2b92f70
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
11 changes: 2 additions & 9 deletions packages/web/components/DatabaseNav/utils.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
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?] {
switch (name) {
case "Database":
return [database, ref];
case "About":
return [defaultDocDefaultBranch, defaultDoc];
return [database, defaultDoc];
// case "Commit Log":
// return [database, commitLog];
// case "Releases":
Expand Down
15 changes: 12 additions & 3 deletions packages/web/components/layouts/DatabaseLayout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -40,10 +40,18 @@ export default function DatabaseLayout(props: Props) {
<Wrapper>
<DatabaseHeaderAndNav
initialTabIndex={props.initialTabIndex}
params={props.params}
params={refParams}
// breadcrumbs={props.smallHeaderBreadcrumbs}
title={props.title}
// showSmall={showSmallHeader}
// setShowSmall={setShowSmallHeader}
/>
<div className={cx(css.content, css.contentWithHeader)}>
<div
className={cx(css.content, {
[css.contentWithHeader]: !!showHeader,
// [css.contentWithSmallHeader]: showSmallHeader,
})}
>
<DatabaseTableNav
params={props.params}
initiallyOpen={props.leftNavInitiallyOpen}
Expand All @@ -65,6 +73,7 @@ export default function DatabaseLayout(props: Props) {
[css.maxWidth]: !useFullWidth,
[css.noHeader]: !showHeader,
})}
// onScroll={props.onScroll}
mobileBreakpoint={1024}
>
{props.children}
Expand Down
2 changes: 1 addition & 1 deletion packages/web/lib/urls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2b92f70

Please sign in to comment.