Files
Verso/services/web/frontend/js/features/ide-redesign/components/toolbar/change-layout-button.tsx
T
Alf Eaton 7e3b853fc1 Revert "Show tooltip immediately if a tooltip is already open (#28870)" (#28935)
This reverts commit 74950ea7e705acb8f42dea552b23ce93c66058c7.

GitOrigin-RevId: 346a947c420448becf294f0174937a5c256bf945
2025-10-09 08:08:14 +00:00

45 lines
1.4 KiB
TypeScript

import { useTranslation } from 'react-i18next'
import classNames from 'classnames'
import {
Dropdown,
DropdownMenu,
DropdownToggle,
} from '@/shared/components/dropdown/dropdown-menu'
import ChangeLayoutOptions from './change-layout-options'
import MaterialIcon from '@/shared/components/material-icon'
import OLTooltip from '@/shared/components/ol/ol-tooltip'
export default function ChangeLayoutButton() {
const { t } = useTranslation()
const toggleButtonClassName = classNames(
'ide-redesign-toolbar-button-subdued',
'ide-redesign-toolbar-dropdown-toggle-subdued',
'ide-redesign-toolbar-button-icon'
)
return (
<div className="ide-redesign-toolbar-button-container">
<Dropdown className="toolbar-item layout-dropdown" align="end">
<OLTooltip
id="tooltip-open-layout-options"
description={t('layout_options')}
overlayProps={{ delay: 0, placement: 'bottom' }}
>
<span>
<DropdownToggle
id="layout-dropdown-btn"
className={toggleButtonClassName}
aria-label={t('layout_options')}
>
<MaterialIcon type="space_dashboard" unfilled />
</DropdownToggle>
</span>
</OLTooltip>
<DropdownMenu>
<ChangeLayoutOptions />
</DropdownMenu>
</Dropdown>
</div>
)
}