File tree Expand file tree Collapse file tree 3 files changed +27
-4
lines changed Expand file tree Collapse file tree 3 files changed +27
-4
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ export const App: React.FunctionComponent = () => {
108108 aria-label = "Global navigation"
109109 isSidebarOpen = { isSidebarOpen }
110110 onSidebarToggle = { onSidebarToggle }
111- id = "vertical- nav-toggle"
111+ id = "nav-toggle"
112112 >
113113 < BarsIcon />
114114 </ PageToggleButton >
Original file line number Diff line number Diff line change @@ -735,10 +735,29 @@ export const NetflowTraffic: React.FC<NetflowTrafficProps> = ({
735735
736736 //update page on full screen change
737737 React . useEffect ( ( ) => {
738+ // collapse pf6 navigation for compatibility
739+ if ( model . isFullScreen && document . getElementsByClassName ( 'pf-v6-c-page__sidebar pf-m-expanded' ) . length ) {
740+ document . getElementById ( 'nav-toggle' ) ?. click ( ) ;
741+ }
742+
738743 const header = document . getElementById ( 'page-main-header' ) ;
744+ const headersV5Compat = document . getElementsByClassName ( 'pf-v5-c-masthead' ) ;
745+ const headersV6Compat = document . getElementsByClassName ( 'pf-v6-c-masthead' ) ;
746+
739747 const sideBar = document . getElementById ( 'page-sidebar' ) ;
748+ const sideBarsV5Compat = document . getElementsByClassName ( 'pf-v5-c-page__sidebar' ) ;
749+ const sideBarsV6Compat = document . getElementsByClassName ( 'pf-v6-c-page__sidebar' ) ;
750+
740751 const notification = document . getElementsByClassName ( 'co-global-notifications' ) ;
741- [ header , sideBar , ...notification ] . forEach ( e => {
752+ [
753+ header ,
754+ ...headersV5Compat ,
755+ ...headersV6Compat ,
756+ sideBar ,
757+ ...sideBarsV5Compat ,
758+ ...sideBarsV6Compat ,
759+ ...notification
760+ ] . forEach ( e => {
742761 if ( model . isFullScreen ) {
743762 e ?. classList . add ( 'hidden' ) ;
744763 } else {
Original file line number Diff line number Diff line change @@ -2,12 +2,16 @@ import * as React from 'react';
22
33export function useTheme ( ) : boolean {
44 const [ isDarkTheme , setDarkTheme ] = React . useState < boolean > (
5- document . documentElement . classList . contains ( 'pf-v5-theme-dark' )
5+ document . documentElement . classList . contains ( 'pf-v5-theme-dark' ) ||
6+ document . documentElement . classList . contains ( 'pf-v6-theme-dark' )
67 ) ;
78 const observer = new MutationObserver ( ( mutations : MutationRecord [ ] ) => {
89 mutations . forEach ( ( mutation : MutationRecord ) => {
910 if ( mutation . attributeName === 'class' ) {
10- setDarkTheme ( ( mutation . target as HTMLElement ) . classList . contains ( 'pf-v5-theme-dark' ) ) ;
11+ setDarkTheme (
12+ ( mutation . target as HTMLElement ) . classList . contains ( 'pf-v5-theme-dark' ) ||
13+ ( mutation . target as HTMLElement ) . classList . contains ( 'pf-v6-theme-dark' )
14+ ) ;
1115 }
1216 } ) ;
1317 } ) ;
You can’t perform that action at this time.
0 commit comments