Skip to content

Commit

Permalink
fix(docs): Fix package page
Browse files Browse the repository at this point in the history
  • Loading branch information
clemyan committed Feb 22, 2024
1 parent 7b0290e commit 900763c
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions packages/docusaurus/src/pages/package.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import BrowserOnly from '@docusaurus/BrowserOnly';
import {useLocation} from '@docusaurus/router';
// @ts-expect-error
import {DocsSidebarProvider} from '@docusaurus/theme-common/internal';
import {HtmlClassNameProvider} from '@docusaurus/theme-common';
import Editor from '@monaco-editor/react';
import {AlertIcon, ArrowLeftIcon, CheckIcon, FileDirectoryFillIcon, FileIcon, GearIcon, GlobeIcon, HomeIcon, HourglassIcon, ListUnorderedIcon, MarkGithubIcon, PlayIcon, TagIcon} from '@primer/octicons-react';
import DocRootLayout from '@theme/DocRoot/Layout';
import Layout from '@theme/Layout';
import {normalizeRepoUrl} from '@yarnpkg/monorepo/packages/plugin-git/sources/utils/normalizeRepoUrl';
import clsx from 'clsx';
import gitUrlParse from 'git-url-parse';
Expand All @@ -16,7 +17,6 @@ import {useLocalStorage}

import {usePackageInfo, useReleaseFile, useReleaseInfo, useReleaseReadme, useResolvedVersion} from '../lib/npmTools';
import {Check, checks} from '../lib/packageChecks';
import Layout from '../theme/DocRoot/Layout/index';

import styles from './package.module.css';

Expand Down Expand Up @@ -486,11 +486,13 @@ function SidebarProvider({name, version, children}: {name: string, version: stri
function LoadingPage() {
return (
<HtmlClassNameProvider className={clsx(styles.html)}>
<DocsSidebarProvider name={`foo`} items={[]}>
<Layout title={`Package loading...`}>
Loading in progress
</Layout>
</DocsSidebarProvider>
<Layout title={`Package loading...`}>
<DocsSidebarProvider name={`foo`} items={[]}>
<DocRootLayout>
Loading in progress
</DocRootLayout>
</DocsSidebarProvider>
</Layout>
</HtmlClassNameProvider>
);
}
Expand All @@ -513,11 +515,13 @@ function PackageInfoPage() {

return (
<HtmlClassNameProvider className={clsx(styles.html, !!path && styles.fileHtml)}>
<SidebarProvider name={name} version={version}>
<Layout title={`${name}`}>
{children}
</Layout>
</SidebarProvider>
<Layout title={name}>
<SidebarProvider name={name} version={version}>
<DocRootLayout>
{children}
</DocRootLayout>
</SidebarProvider>
</Layout>
</HtmlClassNameProvider>
);
}
Expand Down

0 comments on commit 900763c

Please sign in to comment.