-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
Copy pathindex.tsx
52 lines (48 loc) · 1.67 KB
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import MenuTransition from "@components/Shared/MenuTransition";
import { Menu, MenuButton, MenuItems } from "@headlessui/react";
import { EllipsisVerticalIcon } from "@heroicons/react/24/outline";
import stopEventPropagation from "@hey/helpers/stopEventPropagation";
import type { Profile } from "@hey/lens";
import type { FC } from "react";
import { Fragment } from "react";
import { useProfileStore } from "src/store/persisted/useProfileStore";
import Block from "./Block";
import CopyAddress from "./CopyAddress";
import CopyLink from "./CopyLink";
import Report from "./Report";
interface ProfileMenuProps {
profile: Profile;
}
const ProfileMenu: FC<ProfileMenuProps> = ({ profile }) => {
const { currentProfile } = useProfileStore();
return (
<Menu as="div" className="relative">
<MenuButton as={Fragment}>
<button
aria-label="More"
className="rounded-full p-1.5 hover:bg-gray-300/20"
onClick={stopEventPropagation}
type="button"
>
<EllipsisVerticalIcon className="ld-text-gray-500 size-5" />
</button>
</MenuButton>
<MenuTransition>
<MenuItems
className="absolute z-[5] mt-1 w-max rounded-xl border bg-white shadow-sm focus:outline-none dark:border-gray-700 dark:bg-gray-900"
static
>
<CopyLink profile={profile} />
<CopyAddress profile={profile} />
{currentProfile && currentProfile?.id !== profile.id ? (
<>
<Block profile={profile} />
<Report profile={profile} />
</>
) : null}
</MenuItems>
</MenuTransition>
</Menu>
);
};
export default ProfileMenu;