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

@@ -6,7 +6,7 @@ import { RelationshipStatus } from "revolt-api/types/Users";
import styled, { css } from "styled-components/macro";
import { Ref } from "preact";
import { refContextMenu } from "preact-context-menu";
import { useTriggerEvents } from "preact-context-menu";
import ConditionalLink from "../../../lib/ConditionalLink";
import PaintCounter from "../../../lib/PaintCounter";
@@ -265,9 +265,7 @@ export default observer(() => {
<ServerEntry home active={homeActive}>
<Swoosh />
<div
ref={
refContextMenu("Status") as Ref<HTMLDivElement>
}
{...useTriggerEvents("Status")}
onClick={() =>
homeActive && history.push("/settings")
}>
@@ -303,12 +301,10 @@ export default observer(() => {
<ServerEntry
home
active={false}
ref={
refContextMenu("Menu", {
channel: x._id,
unread: true,
}) as Ref<HTMLDivElement>
}>
{...useTriggerEvents("Menu", {
channel: x._id,
unread: true,
})}>
<div>
<Icon
size={42}
@@ -354,12 +350,10 @@ export default observer(() => {
to={state.layout.getServerPath(server._id)}>
<ServerEntry
active={active}
ref={
refContextMenu("Menu", {
server: server._id,
unread: isUnread,
}) as Ref<HTMLDivElement>
}>
{...useTriggerEvents("Menu", {
server: server._id,
unread: isUnread,
})}>
<Swoosh />
<Tooltip
content={server.name}