@@ -6,7 +6,14 @@ import { usePathname, useRouter } from 'next/navigation';
66import Link from 'next/link' ;
77import { useSession } from 'next-auth/react' ;
88import {
9+ AlertGroup ,
10+ Alert ,
11+ AlertVariant ,
12+ AlertActionCloseButton ,
913 Bullseye ,
14+ Drawer ,
15+ DrawerContent ,
16+ DrawerContentBody ,
1017 Spinner ,
1118 Masthead ,
1219 MastheadMain ,
@@ -24,20 +31,17 @@ import {
2431 PageSidebar ,
2532 PageSidebarBody ,
2633 SkipToContent ,
27- Page ,
28- AlertGroup ,
29- Alert ,
30- AlertVariant ,
31- AlertActionCloseButton
34+ Page
3235} from '@patternfly/react-core' ;
3336import { BarsIcon } from '@patternfly/react-icons' ;
37+ import { useFeatureFlags } from '@/context/FeatureFlagsContext' ;
38+ import { useAlerts } from '@/context/AlertContext' ;
39+ import { useSideDrawer } from '@/context/SideDrawerContext' ;
3440import ThemePreference from '@/components/ThemePreference/ThemePreference' ;
3541import HelpDropdown from './HelpDropdown/HelpDropdown' ;
3642import UserMenu from './UserMenu/UserMenu' ;
3743
3844import '../styles/globals.scss' ;
39- import { useFeatureFlags } from '@/context/FeatureFlagsContext' ;
40- import { useAlerts } from '@/context/AlertContext' ;
4145
4246interface IAppLayout {
4347 children : React . ReactNode ;
@@ -62,6 +66,7 @@ const AppLayout: React.FunctionComponent<IAppLayout> = ({ children, className })
6266 featureFlags : { playgroundFeaturesEnabled, experimentalFeaturesEnabled }
6367 } = useFeatureFlags ( ) ;
6468 const { alerts, removeAlert } = useAlerts ( ) ;
69+ const sideDrawerContext = useSideDrawer ( ) ;
6570
6671 const router = useRouter ( ) ;
6772 const pathname = usePathname ( ) ;
@@ -183,28 +188,34 @@ const AppLayout: React.FunctionComponent<IAppLayout> = ({ children, className })
183188 const PageSkipToContent = < SkipToContent href = { `#${ pageId } ` } > Skip to Content</ SkipToContent > ;
184189
185190 return (
186- < Page
187- className = { className }
188- mainContainerId = { pageId }
189- masthead = { Header }
190- isManagedSidebar
191- sidebar = { Sidebar }
192- skipToContent = { PageSkipToContent }
193- isContentFilled
194- >
195- { children }
196- < AlertGroup isToast isLiveRegion >
197- { alerts . map ( ( alert ) => (
198- < Alert
199- variant = { alert . variant ? AlertVariant [ alert . variant ] : undefined }
200- title = { alert . title }
201- timeout = { true }
202- actionClose = { < AlertActionCloseButton title = { alert . title } onClose = { ( ) => removeAlert ( alert . key ) } /> }
203- key = { alert . key }
204- />
205- ) ) }
206- </ AlertGroup >
207- </ Page >
191+ < Drawer isExpanded = { ! ! sideDrawerContext . setSideDrawerContent } isInline >
192+ < DrawerContent panelContent = { sideDrawerContext . sideDrawerContent } >
193+ < DrawerContentBody >
194+ < Page
195+ className = { className }
196+ mainContainerId = { pageId }
197+ masthead = { Header }
198+ isManagedSidebar
199+ sidebar = { Sidebar }
200+ skipToContent = { PageSkipToContent }
201+ isContentFilled
202+ >
203+ { children }
204+ < AlertGroup isToast isLiveRegion >
205+ { alerts . map ( ( alert ) => (
206+ < Alert
207+ variant = { alert . variant ? AlertVariant [ alert . variant ] : undefined }
208+ title = { alert . title }
209+ timeout = { true }
210+ actionClose = { < AlertActionCloseButton title = { alert . title } onClose = { ( ) => removeAlert ( alert . key ) } /> }
211+ key = { alert . key }
212+ />
213+ ) ) }
214+ </ AlertGroup >
215+ </ Page >
216+ </ DrawerContentBody >
217+ </ DrawerContent >
218+ </ Drawer >
208219 ) ;
209220} ;
210221
0 commit comments