🔖 fix: Remove Local State from Bookmark Menu (#5181)

* chore: remove redundant

* fix: bookmark menu statefulness by removing local state
This commit is contained in:
Danny Avila 2025-01-04 12:01:13 -05:00 committed by GitHub
parent 7c61115a88
commit 766657da83
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 24 additions and 26 deletions

View file

@ -4,6 +4,7 @@ import type * as t from '~/common';
import { cn } from '~/utils';
interface DropdownProps {
keyPrefix?: string;
trigger: React.ReactNode;
items: t.MenuItemProps[];
isOpen: boolean;
@ -20,6 +21,7 @@ interface DropdownProps {
}
const DropdownPopup: React.FC<DropdownProps> = ({
keyPrefix,
trigger,
items,
isOpen,
@ -53,7 +55,7 @@ const DropdownPopup: React.FC<DropdownProps> = ({
}
return (
<Ariakit.MenuItem
key={index}
key={`${keyPrefix ?? ''}${index}`}
id={item.id}
className={cn(
'group flex w-full cursor-pointer items-center gap-2 rounded-lg px-3 py-3.5 text-sm text-text-primary outline-none transition-colors duration-200 hover:bg-surface-hover focus:bg-surface-hover md:px-2.5 md:py-2',