File tree Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change 1- import { Link } from "react-router"
1+ import { useSearchParams , Link } from "react-router"
22import { useCallback } from "react"
33import { Breadcrumb , BreadcrumbItem } from "@patternfly/react-core"
44
@@ -14,7 +14,13 @@ export default function PageBreadcrumbs({
1414 breadcrumb1,
1515 breadcrumb2,
1616} : PageBreadcrumbProps ) {
17- const renderHome = useCallback ( ( ) => < Link to = "/welcome" > Home</ Link > , [ ] )
17+ const [ searchParams ] = useSearchParams ( )
18+ const s = searchParams . toString ( )
19+ const search = s . length > 0 ? "?" + s : ""
20+ const renderHome = useCallback (
21+ ( ) => < Link to = { "/welcome" + search } > Home</ Link > ,
22+ [ search ] ,
23+ )
1824
1925 return (
2026 < Breadcrumb >
Original file line number Diff line number Diff line change @@ -12,9 +12,12 @@ import Demos from "./DemoNavItems"
1212import MyTraces from "./MyTracesNavItems"
1313
1414export default function Sidebar ( ) {
15- const [ searchParams ] = useSearchParams ( )
1615 const { hash, pathname : activeItem } = useLocation ( )
1716
17+ const [ searchParams ] = useSearchParams ( )
18+ const s = searchParams . toString ( )
19+ const search = ( s . length > 0 ? "?" + s : "" ) + hash
20+
1821 return (
1922 < PageSidebar isSidebarOpen = { ! ! searchParams . get ( "sidebar" ) } >
2023 < PageSidebarBody >
@@ -24,19 +27,19 @@ export default function Sidebar() {
2427 itemId = "welcome"
2528 isActive = { activeItem === "" || activeItem === "/welcome" }
2629 >
27- < Link to = "/welcome" > Welcome</ Link >
30+ < Link to = { "/welcome" + search } > Welcome</ Link >
2831 </ NavItem >
2932
3033 < NavItem itemId = "viewer" isActive = { activeItem === "/upload" } >
31- < Link to = { "/upload" + hash } > Upload a Trace</ Link >
34+ < Link to = { "/upload" + search } > Upload a Trace</ Link >
3235 </ NavItem >
3336 </ NavList >
3437
35- < MyTraces hash = { hash } activeItem = { activeItem } />
38+ < MyTraces hash = { search + hash } activeItem = { activeItem } />
3639 < Demos hash = { hash } activeItem = { activeItem } />
3740
3841 < NavItem itemId = "about" isActive = { activeItem === "/about" } >
39- < Link to = "/about" > About PDL</ Link >
42+ < Link to = { "/about" + search } > About PDL</ Link >
4043 </ NavItem >
4144 </ Nav >
4245 </ PageSidebarBody >
You can’t perform that action at this time.
0 commit comments