Skip to content

Commit

Permalink
refactor(theme-common): move useDocsPreferredVersion() to public api (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber authored Jul 6, 2022
1 parent 8a72b76 commit bc0538f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ import {
useVersions,
useActiveDocContext,
} from '@docusaurus/plugin-content-docs/client';
import {
useDocsPreferredVersion,
useDocsVersionCandidates,
} from '@docusaurus/theme-common/internal';
import {useDocsPreferredVersion} from '@docusaurus/theme-common';
import {useDocsVersionCandidates} from '@docusaurus/theme-common/internal';
import {translate} from '@docusaurus/Translate';
import DefaultNavbarItem from '@theme/NavbarItem/DefaultNavbarItem';
import DropdownNavbarItem from '@theme/NavbarItem/DropdownNavbarItem';
Expand Down
2 changes: 2 additions & 0 deletions packages/docusaurus-theme-common/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,5 @@ export {isRegexpStringMatch} from './utils/regexpUtils';
export {duplicates, uniq} from './utils/jsUtils';

export {usePrismTheme} from './hooks/usePrismTheme';

export {useDocsPreferredVersion} from './contexts/docsPreferredVersion';
1 change: 0 additions & 1 deletion packages/docusaurus-theme-common/src/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export {DocsSidebarProvider, useDocsSidebar} from './contexts/docsSidebar';
export {DocProvider, useDoc, type DocContextValue} from './contexts/doc';

export {
useDocsPreferredVersion,
useDocsPreferredVersionByPluginId,
DocsPreferredVersionContextProvider,
} from './contexts/docsPreferredVersion';
Expand Down
2 changes: 1 addition & 1 deletion website/src/components/Versions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import React, {
useRef,
type ReactNode,
} from 'react';
import {useDocsPreferredVersion} from '@docusaurus/theme-common/internal';
import {useDocsPreferredVersion} from '@docusaurus/theme-common';
import {useVersions} from '@docusaurus/plugin-content-docs/client';
import Translate from '@docusaurus/Translate';
import CodeBlock from '@theme/CodeBlock';
Expand Down

0 comments on commit bc0538f

Please sign in to comment.