Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(masthead): removed version switcher #4388

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(navigation): add version swticher
andrew-ronaldson committed Nov 20, 2024
commit 8924586ea88cd97dbb3ab900f1483f471e3decc0
Original file line number Diff line number Diff line change
@@ -263,6 +263,68 @@ export const SideNavLayout = ({ children, groupedRoutes, navOpen: navOpenProp })
const SideBar = (
<PageSidebar>
<PageSidebarBody>
{hasVersionSwitcher && (
<ToolbarItem>
<Dropdown
onSelect={() => setDropdownOpen(!isDropdownOpen)}
onOpenChange={(isOpen) => setDropdownOpen(isOpen)}
isOpen={isDropdownOpen}
toggle={(toggleRef) => (
<MenuToggle
ref={toggleRef}
onClick={() => setDropdownOpen(!isDropdownOpen)}
isExpanded={isDropdownOpen}
>
Release 6.0.0
</MenuToggle>
)}
popperProps={{ position: 'right' }}
>
<DropdownGroup key="Latest" label="Latest">
<DropdownList>{getDropdownItem(latestVersion, true)}</DropdownList>
</DropdownGroup>
{previousReleases.length > 0 && (
<DropdownGroup key="Previous releases" label="Previous releases">
<DropdownList>
{previousReleases.slice(0, 3).map((version) => getDropdownItem(version))}
</DropdownList>
</DropdownGroup>
)}
<Divider key="divider1" />
<DropdownGroup key="Previous versions" label="Previous versions">
<DropdownList>
<DropdownItem
key="PatternFly 5"
className="ws-patternfly-versions"
isExternalLink
to="https://v5-archive.patternfly.org/"
itemId="patternfly-5"
>
PatternFly 5
</DropdownItem>
<DropdownItem
key="PatternFly 4"
className="ws-patternfly-versions"
isExternalLink
to="http://v4-archive.patternfly.org/v4/"
itemId="patternfly-4"
>
PatternFly 4
</DropdownItem>
<DropdownItem
key="PatternFly 3"
className="ws-patternfly-versions"
isExternalLink
to="https://pf3.patternfly.org/"
itemId="patternfly-3"
>
PatternFly 3
</DropdownItem>
</DropdownList>
</DropdownGroup>
</Dropdown>
</ToolbarItem>
)}
<SideNav navItems={sideNavItems} groupedRoutes={groupedRoutes} />
</PageSidebarBody>
</PageSidebar>