Skip to content

Commit

Permalink
correct version banner
Browse files Browse the repository at this point in the history
  • Loading branch information
ReneWerner87 committed Jul 9, 2023
1 parent bb89af3 commit 712c53b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/theme/DocVersionBanner/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react';
import DocVersionBanner from '@theme-original/DocVersionBanner';
import {useActivePlugin, useActiveDocContext} from "@docusaurus/plugin-content-docs/lib/client";

export default function DocVersionBannerWrapper(props) {
const plugin = useActivePlugin();

if (plugin?.pluginId !== 'default' && useActiveDocContext(plugin.pluginId)?.activeVersion?.name !== 'current') { // deactivate banner for not default
// TODO: improve banner message with the next possible version
return null;
}
return (
<>
<DocVersionBanner {...props} />
</>
);
}

0 comments on commit 712c53b

Please sign in to comment.