|
@@ -1,32 +1,29 @@
|
|
|
-import {
|
|
|
|
|
- Dropdown,
|
|
|
|
|
- DropdownDivider,
|
|
|
|
|
- DropdownMenu,
|
|
|
|
|
- DropdownToggle,
|
|
|
|
|
-} from '@/features/ui/components/bootstrap-5/dropdown-menu'
|
|
|
|
|
-import OLDropdownMenuItem from '@/features/ui/components/ol/ol-dropdown-menu-item'
|
|
|
|
|
-import { FC } from 'react'
|
|
|
|
|
|
|
+import { DropdownDivider } from '@/features/ui/components/bootstrap-5/dropdown-menu'
|
|
|
|
|
+import { MenuBar } from '@/shared/components/menu-bar/menu-bar'
|
|
|
|
|
+import { MenuBarDropdown } from '@/shared/components/menu-bar/menu-bar-dropdown'
|
|
|
|
|
+import { MenuBarOption } from '@/shared/components/menu-bar/menu-bar-option'
|
|
|
import { useTranslation } from 'react-i18next'
|
|
import { useTranslation } from 'react-i18next'
|
|
|
|
|
|
|
|
-type MenuBarOptionProps = {
|
|
|
|
|
- title: string
|
|
|
|
|
- onClick?: () => void
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-type MenuBarDropdownProps = {
|
|
|
|
|
- title: string
|
|
|
|
|
- id: string
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
export const ToolbarMenuBar = () => {
|
|
export const ToolbarMenuBar = () => {
|
|
|
const { t } = useTranslation()
|
|
const { t } = useTranslation()
|
|
|
return (
|
|
return (
|
|
|
- <div className="ide-redesign-toolbar-menu-bar">
|
|
|
|
|
- <MenuBarDropdown title={t('file')} id="file">
|
|
|
|
|
|
|
+ <MenuBar
|
|
|
|
|
+ className="ide-redesign-toolbar-menu-bar"
|
|
|
|
|
+ id="toolbar-menu-bar-item"
|
|
|
|
|
+ >
|
|
|
|
|
+ <MenuBarDropdown
|
|
|
|
|
+ title={t('file')}
|
|
|
|
|
+ id="file"
|
|
|
|
|
+ className="ide-redesign-toolbar-dropdown-toggle-subdued"
|
|
|
|
|
+ >
|
|
|
<MenuBarOption title="New File" />
|
|
<MenuBarOption title="New File" />
|
|
|
<MenuBarOption title="New Project" />
|
|
<MenuBarOption title="New Project" />
|
|
|
</MenuBarDropdown>
|
|
</MenuBarDropdown>
|
|
|
- <MenuBarDropdown title={t('edit')} id="edit">
|
|
|
|
|
|
|
+ <MenuBarDropdown
|
|
|
|
|
+ title={t('edit')}
|
|
|
|
|
+ id="edit"
|
|
|
|
|
+ className="ide-redesign-toolbar-dropdown-toggle-subdued"
|
|
|
|
|
+ >
|
|
|
<MenuBarOption title="Undo" />
|
|
<MenuBarOption title="Undo" />
|
|
|
<MenuBarOption title="Redo" />
|
|
<MenuBarOption title="Redo" />
|
|
|
<DropdownDivider />
|
|
<DropdownDivider />
|
|
@@ -34,44 +31,41 @@ export const ToolbarMenuBar = () => {
|
|
|
<MenuBarOption title="Copy" />
|
|
<MenuBarOption title="Copy" />
|
|
|
<MenuBarOption title="Pate" />
|
|
<MenuBarOption title="Pate" />
|
|
|
</MenuBarDropdown>
|
|
</MenuBarDropdown>
|
|
|
- <MenuBarDropdown title={t('view')} id="view">
|
|
|
|
|
|
|
+ <MenuBarDropdown
|
|
|
|
|
+ title={t('view')}
|
|
|
|
|
+ id="view"
|
|
|
|
|
+ className="ide-redesign-toolbar-dropdown-toggle-subdued"
|
|
|
|
|
+ >
|
|
|
<MenuBarOption title="PDF only" />
|
|
<MenuBarOption title="PDF only" />
|
|
|
</MenuBarDropdown>
|
|
</MenuBarDropdown>
|
|
|
- <MenuBarDropdown title={t('insert')} id="insert">
|
|
|
|
|
|
|
+ <MenuBarDropdown
|
|
|
|
|
+ title={t('insert')}
|
|
|
|
|
+ id="insert"
|
|
|
|
|
+ className="ide-redesign-toolbar-dropdown-toggle-subdued"
|
|
|
|
|
+ >
|
|
|
<MenuBarOption title="Insert figure" />
|
|
<MenuBarOption title="Insert figure" />
|
|
|
<MenuBarOption title="Insert table" />
|
|
<MenuBarOption title="Insert table" />
|
|
|
<MenuBarOption title="Insert link" />
|
|
<MenuBarOption title="Insert link" />
|
|
|
<MenuBarOption title="Add comment" />
|
|
<MenuBarOption title="Add comment" />
|
|
|
</MenuBarDropdown>
|
|
</MenuBarDropdown>
|
|
|
- <MenuBarDropdown title={t('format')} id="format">
|
|
|
|
|
|
|
+ <MenuBarDropdown
|
|
|
|
|
+ title={t('format')}
|
|
|
|
|
+ id="format"
|
|
|
|
|
+ className="ide-redesign-toolbar-dropdown-toggle-subdued"
|
|
|
|
|
+ >
|
|
|
<MenuBarOption title="Bold text" />
|
|
<MenuBarOption title="Bold text" />
|
|
|
</MenuBarDropdown>
|
|
</MenuBarDropdown>
|
|
|
- <MenuBarDropdown title={t('help')} id="help">
|
|
|
|
|
|
|
+ <MenuBarDropdown
|
|
|
|
|
+ title={t('help')}
|
|
|
|
|
+ id="help"
|
|
|
|
|
+ className="ide-redesign-toolbar-dropdown-toggle-subdued"
|
|
|
|
|
+ >
|
|
|
<MenuBarOption title="Keyboard shortcuts" />
|
|
<MenuBarOption title="Keyboard shortcuts" />
|
|
|
<MenuBarOption title="Documentation" />
|
|
<MenuBarOption title="Documentation" />
|
|
|
<DropdownDivider />
|
|
<DropdownDivider />
|
|
|
<MenuBarOption title="Contact us" />
|
|
<MenuBarOption title="Contact us" />
|
|
|
<MenuBarOption title="Give feedback" />
|
|
<MenuBarOption title="Give feedback" />
|
|
|
</MenuBarDropdown>
|
|
</MenuBarDropdown>
|
|
|
- </div>
|
|
|
|
|
- )
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-const MenuBarDropdown: FC<MenuBarDropdownProps> = ({ title, children, id }) => {
|
|
|
|
|
- return (
|
|
|
|
|
- <Dropdown align="start">
|
|
|
|
|
- <DropdownToggle
|
|
|
|
|
- id={`toolbar-menu-bar-item-${id}`}
|
|
|
|
|
- variant="secondary"
|
|
|
|
|
- className="ide-redesign-toolbar-dropdown-toggle-subdued"
|
|
|
|
|
- >
|
|
|
|
|
- {title}
|
|
|
|
|
- </DropdownToggle>
|
|
|
|
|
- <DropdownMenu>{children}</DropdownMenu>
|
|
|
|
|
- </Dropdown>
|
|
|
|
|
|
|
+ </MenuBar>
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-const MenuBarOption = ({ title, onClick }: MenuBarOptionProps) => {
|
|
|
|
|
- return <OLDropdownMenuItem onClick={onClick}>{title}</OLDropdownMenuItem>
|
|
|
|
|
-}
|
|
|