diff --git a/frontend/app/components/shared/ProjectDropdown/ProjectDropdown.tsx b/frontend/app/components/shared/ProjectDropdown/ProjectDropdown.tsx index ee0e73868..3d99d2565 100644 --- a/frontend/app/components/shared/ProjectDropdown/ProjectDropdown.tsx +++ b/frontend/app/components/shared/ProjectDropdown/ProjectDropdown.tsx @@ -2,7 +2,7 @@ import { CaretDownOutlined, FolderAddOutlined } from '@ant-design/icons'; -import { Button, Divider, Dropdown, Space, Typography } from 'antd'; +import { Button, Dropdown, MenuProps, Space, Typography } from 'antd'; import cn from 'classnames'; import React from 'react'; import { withRouter } from 'react-router-dom'; @@ -46,12 +46,11 @@ function ProjectDropdown(props: { location: any }) { showModal(, { right: true }); }; - const menuItems = sites.map((site) => ({ + const menuItems: MenuProps['items'] = sites.map((site) => ({ key: site.id, label: (
handleSiteChange(site.id)} className={'!py-1 flex items-center gap-2'} > -
- - Add Project -
- - +
+ + Add Project +
) + }, { + type: 'divider' }); } @@ -97,6 +93,13 @@ function ProjectDropdown(props: { location: any }) { style: { maxHeight: 500, overflowY: 'auto' + }, + onClick: (e) => { + if (e.key === 'add-proj') { + addProjectClickHandler(); + } else { + void handleSiteChange(e.key); + } } }} placement="bottomLeft"