fix: context menus are now bound by spread

This commit is contained in:
Paul Makles
2022-03-06 19:13:12 +00:00
parent 6a465c1c08
commit f65c9bdd5e
9 changed files with 55 additions and 82 deletions

View File

@@ -8,9 +8,8 @@ import { User } from "revolt.js/dist/maps/Users";
import styles from "./Friend.module.scss";
import classNames from "classnames";
import { Ref } from "preact";
import { refContextMenu } from "preact-context-menu";
import { useTriggerEvents } from "preact-context-menu";
import { Text } from "preact-i18n";
import { useContext } from "preact/hooks";
import { stopPropagation } from "../../lib/stopPropagation";
import { voiceState } from "../../lib/vortex/VoiceState";
@@ -133,11 +132,9 @@ export const Friend = observer(({ user }: Props) => {
<div
className={styles.friend}
onClick={() => openScreen({ id: "profile", user_id: user._id })}
ref={
refContextMenu("Menu", {
user: user._id,
}) as Ref<HTMLDivElement>
}>
{...useTriggerEvents("Menu", {
user: user._id,
})}>
<UserIcon target={user} size={36} status />
<div className={styles.name}>
<span>{user.username}</span>