fix(Layout): refactor to sidebar layout component

This commit is contained in:
iCrawl
2022-07-24 18:28:32 +02:00
parent 200ab91f52
commit 41e4e10b48
3 changed files with 23 additions and 18 deletions

View File

@@ -2,21 +2,7 @@ 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 (
<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>
);
return <Component {...pageProps} />;
}