|
| 1 | +diff --git a/node_modules/@docusaurus/theme-classic/lib/theme/DocVersionSuggestions/index.js b/node_modules/@docusaurus/theme-classic/lib/theme/DocVersionSuggestions/index.js |
| 2 | +index bc8baa7..b12bebf 100644 |
| 3 | +--- a/node_modules/@docusaurus/theme-classic/lib/theme/DocVersionSuggestions/index.js |
| 4 | ++++ b/node_modules/@docusaurus/theme-classic/lib/theme/DocVersionSuggestions/index.js |
| 5 | +@@ -18,58 +18,7 @@ const getVersionMainDoc = (version) => |
| 6 | + version.docs.find((doc) => doc.id === version.mainDocId); |
| 7 | + |
| 8 | + function DocVersionSuggestions() { |
| 9 | +- const { |
| 10 | +- siteConfig: {title: siteTitle}, |
| 11 | +- } = useDocusaurusContext(); |
| 12 | +- const {pluginId} = useActivePlugin({ |
| 13 | +- failfast: true, |
| 14 | +- }); |
| 15 | +- const {savePreferredVersionName} = useDocsPreferredVersion(pluginId); |
| 16 | +- const activeVersion = useActiveVersion(pluginId); |
| 17 | +- const { |
| 18 | +- latestDocSuggestion, |
| 19 | +- latestVersionSuggestion, |
| 20 | +- } = useDocVersionSuggestions(pluginId); // No suggestion to be made |
| 21 | +- |
| 22 | +- if (!latestVersionSuggestion) { |
| 23 | +- return <></>; |
| 24 | +- } // try to link to same doc in latest version (not always possible) |
| 25 | +- // fallback to main doc of latest version |
| 26 | +- |
| 27 | +- const latestVersionSuggestedDoc = |
| 28 | +- latestDocSuggestion ?? getVersionMainDoc(latestVersionSuggestion); |
| 29 | +- return ( |
| 30 | +- <div className="alert alert--warning margin-bottom--md" role="alert"> |
| 31 | +- { |
| 32 | +- // TODO need refactoring |
| 33 | +- activeVersion.name === 'current' ? ( |
| 34 | +- <div> |
| 35 | +- This is unreleased documentation for {siteTitle}{' '} |
| 36 | +- <strong>{activeVersion.label}</strong> version. |
| 37 | +- </div> |
| 38 | +- ) : ( |
| 39 | +- <div> |
| 40 | +- This is documentation for {siteTitle}{' '} |
| 41 | +- <strong>{activeVersion.label}</strong>, which is no longer actively |
| 42 | +- maintained. |
| 43 | +- </div> |
| 44 | +- ) |
| 45 | +- } |
| 46 | +- <div className="margin-top--md"> |
| 47 | +- For up-to-date documentation, see the{' '} |
| 48 | +- <strong> |
| 49 | +- <Link |
| 50 | +- to={latestVersionSuggestedDoc.path} |
| 51 | +- onClick={() => |
| 52 | +- savePreferredVersionName(latestVersionSuggestion.name) |
| 53 | +- }> |
| 54 | +- latest version |
| 55 | +- </Link> |
| 56 | +- </strong>{' '} |
| 57 | +- ({latestVersionSuggestion.label}). |
| 58 | +- </div> |
| 59 | +- </div> |
| 60 | +- ); |
| 61 | ++ return null |
| 62 | + } |
| 63 | + |
| 64 | + export default DocVersionSuggestions; |
0 commit comments