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

@@ -2,7 +2,7 @@ import { Attachment as AttachmentI } from "revolt-api/types/Autumn";
import styles from "./Attachment.module.scss";
import classNames from "classnames";
import { refContextMenu } from "preact-context-menu";
import { useTriggerEvents } from "preact-context-menu";
import { useContext, useState } from "preact/hooks";
import { AppContext } from "../../../../context/revoltjs/RevoltClient";
@@ -37,7 +37,7 @@ export default function Attachment({ attachment, hasContent }: Props) {
<SizedGrid
width={metadata.width}
height={metadata.height}
innerRef={refContextMenu("Menu", {
{...useTriggerEvents("Menu", {
attachment,
})}
className={classNames({