Skip to content

Commit

Permalink
docs: improve version switch
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusNotheis committed Aug 23, 2024
1 parent 1923c86 commit 143b737
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .storybook/components/VersionSwitch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ addons.register(ADDON_ID, (api) => {
const { slug } = e.target.dataset;
window.location.href = `https://sap.github.io/ui5-webcomponents-react/${slug}/`;
};

const activeVersionSlug =
window.location.pathname.replace('/ui5-webcomponents-react/', '').replaceAll('/', '') || 'nightly';
const activeVersion = activeVersionSlug.at(0).toUpperCase() + activeVersionSlug.slice(1);
return (
<>
<IconButton
Expand All @@ -29,7 +33,7 @@ addons.register(ADDON_ID, (api) => {
setOpen(true);
}}
>
Version
Version: {activeVersion}
</IconButton>
<ActionSheet
placement="Bottom"
Expand Down

0 comments on commit 143b737

Please sign in to comment.