refactor: use next links (#8344)

* chore(website): use next links

* chore: fix deploy check

* chore: use ligher syntax highlighter
This commit is contained in:
Suneet Tipirneni
2022-07-24 09:14:18 -04:00
committed by GitHub
parent 8e520f946a
commit 335695c698
6 changed files with 29 additions and 21 deletions

View File

@@ -2,7 +2,21 @@ import type { AppProps } from 'next/app';
import '@unocss/reset/normalize.css';
import '../styles/unocss.css';
import '../styles/main.css';
import { ItemSidebar } from '~/components/ItemSidebar';
export default function MyApp({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />;
return (
<div className="flex flex-col lg:flex-row overflow-hidden max-w-full h-full max-h-full bg-white dark:bg-dark">
<div className="w-full lg:max-w-1/4 lg:min-w-1/4">
{/* eslint-disable-next-line @typescript-eslint/no-unsafe-member-access */}
{pageProps.packageName && pageProps.data ? (
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
<ItemSidebar packageName={pageProps.packageName} data={pageProps.data} />
) : null}
</div>
<div className="max-h-full grow overflow-auto">
<Component {...pageProps} />
</div>
</div>
);
}

View File

@@ -6,7 +6,7 @@ import type { DocFunction } from '~/DocModel/DocFunction';
import type { DocInterface } from '~/DocModel/DocInterface';
import type { DocTypeAlias } from '~/DocModel/DocTypeAlias';
import type { DocVariable } from '~/DocModel/DocVariable';
import { ItemSidebar, type ItemListProps } from '~/components/ItemSidebar';
import type { ItemListProps } from '~/components/ItemSidebar';
import { Class } from '~/components/model/Class';
import { Enum } from '~/components/model/Enum';
import { Function } from '~/components/model/Function';
@@ -106,12 +106,7 @@ export default function Slug(
) {
return props.error ? (
<div className="flex max-w-full h-full bg-white dark:bg-dark">{props.error}</div>
) : (
<div className="flex flex-col lg:flex-row overflow-hidden max-w-full h-full bg-white dark:bg-dark">
<div className="w-full lg:min-w-1/4 lg:max-w-1/4">
{props.packageName && props.data ? <ItemSidebar packageName={props.packageName} data={props.data} /> : null}
</div>
<div className="max-h-full grow overflow-auto">{props.data?.member ? member(props.data.member) : null}</div>
</div>
);
) : props.data?.member ? (
member(props.data.member)
) : null;
}