mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-07 01:15:28 +00:00
Merge pull request #199 from brecert/mentions-methods
This commit is contained in:
@@ -22,6 +22,7 @@ import { mapChannelWithUnread, useUnreads } from "./common";
|
||||
|
||||
import { ChannelButton } from "../items/ButtonItem";
|
||||
import ConnectionStatus from "../items/ConnectionStatus";
|
||||
import { internalEmit } from "../../../lib/eventEmitter";
|
||||
|
||||
interface Props {
|
||||
unreads: Unreads;
|
||||
@@ -90,6 +91,17 @@ const ServerSidebar = observer((props: Props) => {
|
||||
|
||||
return (
|
||||
<ConditionalLink
|
||||
onClick={e => {
|
||||
if (e.shiftKey) {
|
||||
internalEmit(
|
||||
"MessageBox",
|
||||
"append",
|
||||
`<#${entry._id}>`,
|
||||
"channel_mention",
|
||||
);
|
||||
e.preventDefault()
|
||||
}
|
||||
}}
|
||||
key={entry._id}
|
||||
active={active}
|
||||
to={`/server/${server!._id}/channel/${entry._id}`}>
|
||||
|
||||
@@ -12,6 +12,7 @@ import {
|
||||
} from "../../../context/intermediate/Intermediate";
|
||||
|
||||
import { UserButton } from "../items/ButtonItem";
|
||||
import { internalEmit } from "../../../lib/eventEmitter";
|
||||
|
||||
export type MemberListGroup = {
|
||||
type: "online" | "offline" | "role";
|
||||
@@ -53,12 +54,21 @@ const ItemContent = memo(
|
||||
user={item}
|
||||
margin
|
||||
context={context}
|
||||
onClick={() =>
|
||||
openScreen({
|
||||
id: "profile",
|
||||
user_id: item._id,
|
||||
})
|
||||
}
|
||||
onClick={e => {
|
||||
if (e.shiftKey) {
|
||||
internalEmit(
|
||||
"MessageBox",
|
||||
"append",
|
||||
`<@${item._id}>`,
|
||||
"mention",
|
||||
);
|
||||
} else[
|
||||
openScreen({
|
||||
id: "profile",
|
||||
user_id: item._id,
|
||||
})
|
||||
]
|
||||
}}
|
||||
/>
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user