mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-18 02:47:03 -04:00
Make Context Menu API support hooks (#902)
Co-authored-by: V <vendicated@riseup.net>
This commit is contained in:
parent
e8809fc57b
commit
96f640da67
10 changed files with 29 additions and 24 deletions
|
@ -49,13 +49,13 @@ function PinMenuItem(channelId: string) {
|
|||
);
|
||||
}
|
||||
|
||||
const GroupDMContext: NavContextMenuPatchCallback = (children, props) => {
|
||||
const GroupDMContext: NavContextMenuPatchCallback = (children, props) => () => {
|
||||
const container = findGroupChildrenByChildId("leave-channel", children);
|
||||
if (container)
|
||||
container.unshift(PinMenuItem(props.channel.id));
|
||||
};
|
||||
|
||||
const UserContext: NavContextMenuPatchCallback = (children, props) => {
|
||||
const UserContext: NavContextMenuPatchCallback = (children, props) => () => {
|
||||
const container = findGroupChildrenByChildId("close-dm", children);
|
||||
if (container) {
|
||||
const idx = container.findIndex(c => c?.props?.id === "close-dm");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue