@@ -92,7 +92,10 @@ const App: React.FC<AppProps> = ({ children, showCardFooters }) => {
9292 } ;
9393
9494 const [ modalOpen , setModalOpen ] = React . useState < boolean > ( false ) ;
95- const onClose = ( ) => setActiveQuickStartID ( '' ) ;
95+ const onClose = ( ) => {
96+ setActiveQuickStartID ( '' ) ;
97+ setDrawerContent ( 'none' ) ;
98+ } ;
9699 const handleClose = ( activeQuickStartStatus : string | number ) => {
97100 if ( activeQuickStartStatus === QuickStartStatus . IN_PROGRESS ) {
98101 setModalOpen ( true ) ;
@@ -107,14 +110,14 @@ const App: React.FC<AppProps> = ({ children, showCardFooters }) => {
107110 } ;
108111 const onModalCancel = ( ) => setModalOpen ( false ) ;
109112
110- const [ otherDrawerOpen , setOtherDrawerOpen ] = React . useState ( false ) ;
113+ const [ drawerContent , setDrawerContent ] = React . useState ( 'none' ) ;
111114
112115 const otherDrawerPanelContent = (
113116 < DrawerPanelContent >
114117 < DrawerHead >
115- < span tabIndex = { otherDrawerOpen ? 0 : - 1 } > Drawer panel header</ span >
118+ < span tabIndex = { drawerContent === 'custom' ? 0 : - 1 } > Drawer panel header</ span >
116119 < DrawerActions >
117- < DrawerCloseButton onClick = { ( ) => setOtherDrawerOpen ( false ) } />
120+ < DrawerCloseButton onClick = { ( ) => setDrawerContent ( 'none' ) } />
118121 </ DrawerActions >
119122 </ DrawerHead >
120123 < DrawerPanelDescription > Drawer panel description</ DrawerPanelDescription >
@@ -125,10 +128,10 @@ const App: React.FC<AppProps> = ({ children, showCardFooters }) => {
125128 return (
126129 < React . Suspense fallback = { < LoadingBox /> } >
127130 < QuickStartContainer { ...containerProps } isManagedDrawer = { false } >
128- < Drawer isExpanded = { activeQuickStartID !== '' || otherDrawerOpen } isInline >
131+ < Drawer isExpanded = { drawerContent !== 'none' } isInline >
129132 < DrawerContent
130133 panelContent = {
131- activeQuickStartID !== '' ? (
134+ drawerContent === 'quickstart' || activeQuickStartID !== '' ? (
132135 < QuickStartDrawerContent handleDrawerClose = { handleClose } />
133136 ) : (
134137 otherDrawerPanelContent
@@ -139,11 +142,20 @@ const App: React.FC<AppProps> = ({ children, showCardFooters }) => {
139142 < Page masthead = { AppHeader } sidebar = { AppSidebar } isManagedSidebar >
140143 < Button
141144 variant = "secondary"
142- onClick = { ( ) => toggleQuickStart ( 'getting-started-with-quick-starts' ) }
145+ onClick = { ( ) => {
146+ toggleQuickStart ( 'getting-started-with-quick-starts' ) ;
147+ setDrawerContent ( 'quickstart' ) ;
148+ } }
143149 >
144150 Getting started with quick starts
145151 </ Button >
146- < Button variant = "secondary" onClick = { ( ) => setOtherDrawerOpen ( true ) } >
152+ < Button
153+ variant = "secondary"
154+ onClick = { ( ) => {
155+ setActiveQuickStartID ( '' ) ;
156+ setDrawerContent ( 'custom' ) ;
157+ } }
158+ >
147159 Open a different drawer
148160 </ Button >
149161 { children }
0 commit comments