Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
Add divider to menu
Browse files Browse the repository at this point in the history
Signed-off-by: Volker Theile <[email protected]>
  • Loading branch information
votdev committed Sep 13, 2023
1 parent f6aca45 commit 179db37
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/components/DropOption/DropOption.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import { Dropdown, Button, Icon, Menu, Tooltip } from 'antd'

const DropOption = ({ onMenuClick, menuOptions = [], buttonStyle, dropdownProps, tooltipProps }) => {
const menu = menuOptions.map(item => {
if (item.type === 'divider') {
return (<Menu.Divider />)
}
const tooltip = item.tooltip !== undefined ? item.tooltip : ''
return (
<Menu.Item key={item.key} disabled={!!item.disabled}>
Expand Down
3 changes: 2 additions & 1 deletion src/routes/objectStorage/ObjectStoreActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ function actions({ selected, deleteObjectStore, editObjectStore, administrateObj

const availableActions = [
{ key: 'edit', name: 'Edit', disabled: !isObjectStoreEditable(selected) },
{ key: 'administrate', name: 'Administrate', disabled: !isObjectStoreAdministrable(selected) },
{ key: 'delete', name: 'Delete', disabled: !isObjectStoreDeletable(selected) },
{ type: 'divider' },
{ key: 'administrate', name: 'Administrate', disabled: !isObjectStoreAdministrable(selected) },
]

return (
Expand Down

0 comments on commit 179db37

Please sign in to comment.