Skip to content

Commit

Permalink
chore: update website version dropdown (#9385)
Browse files Browse the repository at this point in the history
Updates the website version dropdown to match the new setup as we now have one more website deployment in addition

Previously:
root -> latest (1.24)
nightly - > main branch

Now:
root -> latest (2.0.0)
v1 -> long-term maintenance (1.24)
nightly - > main branch
  • Loading branch information
ilhan007 authored Jul 3, 2024
1 parent d068496 commit 1fb5822
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions packages/website/src/components/NavbarItems/VersionNavbarItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@ import {

function getVersion() {
if (ExecutionEnvironment.canUseDOM) {
if (!location.pathname.includes("nightly") ) {
if (location.pathname.includes("v1") ) {
return "v1";
}
return "Nightly";

if (location.pathname.includes("nightly") ) {
return "Nightly";
}

return "v2";
}
}

Expand Down Expand Up @@ -66,11 +71,19 @@ function VersionNavbarItemDesktop() {
onClick={() => { setVersion("Nightly") }}
className={clsx({ 'menu__link--active': version === "Nightly" })}
/>
<NavbarItem
label="v1"
<NavbarItem
label="Version 2"
isDropdownItem
target="_self"
href="https://sap.github.io/ui5-webcomponents"
onClick={() => { setVersion("v2") }}
className={clsx({ 'menu__link--active': version === "v2" })}
/>
<NavbarItem
label="Version 1"
isDropdownItem
target="_self"
href="https://sap.github.io/ui5-webcomponents/v1"
onClick={() => { setVersion("v1") }}
className={clsx({ 'menu__link--active': version === "v1" })}
/>
Expand Down

0 comments on commit 1fb5822

Please sign in to comment.