11import { type FC , useCallback , useState } from 'react'
22
3- import { mdiPageLayoutSidebarRight } from '@mdi/js'
3+ import { mdiChevronDoubleLeft , mdiPageLayoutSidebarRight } from '@mdi/js'
44import classNames from 'classnames'
55
66import type { Scalars } from '@sourcegraph/shared/src/graphql-operations'
@@ -83,16 +83,6 @@ export const RepoRevisionSidebar: FC<RepoRevisionSidebarProps> = props => {
8383 storageKey = { SIZE_STORAGE_KEY }
8484 ariaLabel = "File sidebar"
8585 >
86- < Tooltip content = "Hide sidebar" placement = "right" >
87- < Button
88- aria-label = "Hide sidebar"
89- variant = "icon"
90- className = { classNames ( 'position-absolute border mr-2' , styles . toggle ) }
91- onClick = { ( ) => props . handleSidebarToggle ( false ) }
92- >
93- < Icon aria-hidden = { true } svgPath = { mdiPageLayoutSidebarRight } />
94- </ Button >
95- </ Tooltip >
9686 < div className = "d-flex flex-column h-100 w-100" >
9787 { showOnboardingTour && (
9888 < GettingStartedTour
@@ -110,7 +100,24 @@ export const RepoRevisionSidebar: FC<RepoRevisionSidebarProps> = props => {
110100 // position, which tree is expanded)
111101 behavior = "memoize"
112102 >
113- < TabList wrapperClassName = "mr-3 ml-5" >
103+ < TabList
104+ wrapperClassName = "mr-3"
105+ actions = {
106+ < Tooltip content = "Hide sidebar" placement = "right" >
107+ < Button
108+ aria-label = "Hide sidebar"
109+ onClick = { ( ) => props . handleSidebarToggle ( false ) }
110+ className = "bg-transparent border-0 ml-auto p-1 position-relative focus-behaviour"
111+ >
112+ < Icon
113+ className = { styles . closeIcon }
114+ aria-hidden = { true }
115+ svgPath = { mdiChevronDoubleLeft }
116+ />
117+ </ Button >
118+ </ Tooltip >
119+ }
120+ >
114121 < Tab data-tab-content = "files" >
115122 < span className = "tablist-wrapper--tab-label" > Files</ span >
116123 </ Tab >
0 commit comments