@@ -13,7 +13,6 @@ import { useTranslation } from '@/languages/components/useTranslation'
1313import { Breadcrumbs } from '@/frame/components/page-header/Breadcrumbs'
1414import { VersionPicker } from '@/versions/components/VersionPicker'
1515import { SidebarNav } from '@/frame/components/sidebar/SidebarNav'
16- import { AllProductsLink } from '@/frame/components/sidebar/AllProductsLink'
1716import { SearchBarButton } from '@/search/components/input/SearchBarButton'
1817import { HeaderSearchAndWidgets } from './HeaderSearchAndWidgets'
1918import { useInnerWindowWidth } from './hooks/useInnerWindowWidth'
@@ -34,8 +33,8 @@ export const Header = () => {
3433 const { params, updateParams } = useMultiQueryParams ( )
3534 const [ scroll , setScroll ] = useState ( false )
3635 const [ isSidebarOpen , setIsSidebarOpen ] = useState ( false )
37- const openSidebar = useCallback ( ( ) => setIsSidebarOpen ( true ) , [ isSidebarOpen ] )
38- const closeSidebar = useCallback ( ( ) => setIsSidebarOpen ( false ) , [ isSidebarOpen ] )
36+ const openSidebar = useCallback ( ( ) => setIsSidebarOpen ( true ) , [ ] )
37+ const closeSidebar = useCallback ( ( ) => setIsSidebarOpen ( false ) , [ ] )
3938 const isMounted = useRef ( false )
4039 const menuButtonRef = useRef < HTMLButtonElement > ( null )
4140 const { asPath } = useRouter ( )
@@ -204,45 +203,23 @@ export const Header = () => {
204203 onClick = { openSidebar }
205204 ref = { returnFocusRef }
206205 />
207- < Dialog
208- returnFocusRef = { returnFocusRef }
209- isOpen = { isSidebarOpen }
210- onDismiss = { closeSidebar }
211- aria-labelledby = "menu-title"
212- sx = { {
213- position : 'fixed' ,
214- top : '0' ,
215- left : '0' ,
216- marginTop : '0' ,
217- maxHeight : '100vh' ,
218- width : 'auto !important' ,
219- transform : 'none' ,
220- borderRadius : '0' ,
221- borderRight :
222- '1px solid var(--borderColor-default, var(--color-border-default))' ,
223- } }
224- >
225- < Dialog . Header
226- style = { { paddingTop : '0px' , background : 'none' } }
227- id = "sidebar-overlay-header"
228- sx = { { display : 'block' } }
206+ { isSidebarOpen && (
207+ < Dialog
208+ returnFocusRef = { returnFocusRef }
209+ onClose = { closeSidebar }
210+ className = { cx ( styles . dialog , 'd-xxl-none' ) }
211+ position = "left"
212+ title = {
213+ error === '404' || ! currentProduct || isSearchResultsPage
214+ ? null
215+ : currentProductName || currentProduct . name
216+ }
217+ subtitle = { isRestPage && < ApiVersionPicker /> }
218+ width = "medium"
229219 >
230- < AllProductsLink />
231- { error === '404' || ! currentProduct || isSearchResultsPage ? null : (
232- < h2 className = "mt-3" >
233- < Link
234- data-testid = "sidebar-product-dialog"
235- href = { currentProduct . href }
236- className = "d-block pl-1 mb-2 h3 color-fg-default no-underline"
237- >
238- { currentProductName || currentProduct . name }
239- </ Link >
240- </ h2 >
241- ) }
242- { isRestPage && < ApiVersionPicker /> }
243- </ Dialog . Header >
244- < SidebarNav variant = "overlay" />
245- </ Dialog >
220+ < SidebarNav variant = "overlay" />
221+ </ Dialog >
222+ ) }
246223 </ div >
247224 ) }
248225 < div className = "mr-auto width-full" data-search = "breadcrumbs" >
0 commit comments