1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-08 15:05:22 +02:00

added MenuPopover to ProfileCircle

This commit is contained in:
Ikraam 2024-01-19 19:43:36 +00:00
parent d88e2ca606
commit 427717c7b7
2 changed files with 11 additions and 4 deletions

View file

@ -16,7 +16,6 @@ import {
RiFolderOpenLine,
RiMenuFoldLine,
RiMenuUnfoldLine,
RiMore2Fill,
RiPieChart2Line,
RiFlagLine,
RiArrowRightSLine,
@ -191,7 +190,11 @@ export function DesktopLayout({ children, sidebar }: DesktopLayoutProps) {
</div>
</Tooltip>
<ProfileCircle />
<MenuPopover
isHeader={false}
icon={<ProfileCircle />}
buttonClassName="w-12 h-12 rounded-full"
/>
</div>
</nav>
@ -342,7 +345,6 @@ function DefaultContent({
<p data-testid="user-name">{name ?? ''}</p>
<p className="text-gray-100">{email ?? ''}</p>
</div>
<MenuPopover isHeader={false} icon={<RiMore2Fill />} />
</div>
</>
)

View file

@ -6,19 +6,24 @@ import {
RiShutDownLine as LogoutIcon,
RiDatabase2Line,
} from 'react-icons/ri'
import classNames from 'classnames'
export function MenuPopover({
icon,
buttonClassName,
placement = 'top-end',
isHeader,
}: {
icon: JSX.Element
buttonClassName?: string
placement?: ComponentProps<typeof Menu.Item>['placement']
isHeader: boolean
}) {
return (
<Menu>
<Menu.Button variant="icon">{icon}</Menu.Button>
<Menu.Button variant="icon" className={classNames(buttonClassName)}>
{icon}
</Menu.Button>
<Menu.Items
placement={placement}
className={isHeader ? 'bg-gray-600' : 'min-w-[200px]'}