Files
Verso/services/web/frontend/js/features/file-tree/components/file-tree-toolbar.tsx
T
Davinder SinghandCopybot f27c99ea4b Tearing down of old Editor (File tree) (#31784)
* merging ide-redesign/components/file-tree into features/file-tree

* moving ide-redesign/contexts/settings-modal-context   to features/settings/contexts

* use-collapsible-file-tree.tsx → features/file-tree/hooks

* use-focus-on-setting.tsx → features/settings/hooks

* use-project-notification-preferences.ts → features/settings/hooks

* use-rail-overflow.tsx→ features/ide-react/hooks

* deleting use-switch-enable-new-editor-state.ts

* use-toolbar-menu-editor-commands.tsx → features/source-editor/hooks

* npm run extract-translations

* modifying the test to target correct buttons and removing a test for old component

* adding a test back and modifying it

* changing the test

GitOrigin-RevId: baa1e9a992c88b84313eea82161354d4958cf1ef
2026-03-06 09:14:01 +00:00

33 lines
1007 B
TypeScript

import { useTranslation } from 'react-i18next'
import MaterialIcon from '@/shared/components/material-icon'
import React from 'react'
import useCollapsibleFileTree from '@/features/file-tree/hooks/use-collapsible-file-tree'
import FileTreeActionButtons from './file-tree-action-buttons'
function FileTreeToolbar() {
const { t } = useTranslation()
const { fileTreeExpanded, toggleFileTreeExpanded } = useCollapsibleFileTree()
return (
<div className="file-tree-toolbar">
<button
className="file-tree-expand-collapse-button"
onClick={toggleFileTreeExpanded}
aria-label={
fileTreeExpanded ? t('hide_file_tree') : t('show_file_tree')
}
>
<MaterialIcon
type={
fileTreeExpanded ? 'keyboard_arrow_down' : 'keyboard_arrow_right'
}
/>
<h4>{t('file_tree')}</h4>
</button>
<FileTreeActionButtons fileTreeExpanded={fileTreeExpanded} />
</div>
)
}
export default FileTreeToolbar