ViewIcons: More consistent context menu position
This commit is contained in:
parent
622e8dc3e0
commit
1fe7f3c297
@ -84,7 +84,7 @@ function openImage(url: string) {
|
|||||||
const UserContext: NavContextMenuPatchCallback = (children, { user, guildId }: UserContextProps) => () => {
|
const UserContext: NavContextMenuPatchCallback = (children, { user, guildId }: UserContextProps) => () => {
|
||||||
const memberAvatar = GuildMemberStore.getMember(guildId!, user.id)?.avatar || null;
|
const memberAvatar = GuildMemberStore.getMember(guildId!, user.id)?.avatar || null;
|
||||||
|
|
||||||
children.splice(1, 0, (
|
children.splice(-1, 0, (
|
||||||
<Menu.MenuGroup>
|
<Menu.MenuGroup>
|
||||||
<Menu.MenuItem
|
<Menu.MenuItem
|
||||||
id="view-avatar"
|
id="view-avatar"
|
||||||
@ -109,13 +109,7 @@ const UserContext: NavContextMenuPatchCallback = (children, { user, guildId }: U
|
|||||||
const GuildContext: NavContextMenuPatchCallback = (children, { guild: { id, icon, banner } }: GuildContextProps) => () => {
|
const GuildContext: NavContextMenuPatchCallback = (children, { guild: { id, icon, banner } }: GuildContextProps) => () => {
|
||||||
if (!banner && !icon) return;
|
if (!banner && !icon) return;
|
||||||
|
|
||||||
// before copy id (if it exists)
|
children.splice(-1, 0, (
|
||||||
const idx = children.length +
|
|
||||||
children[children.length - 1]?.props?.children?.props?.id === "devmode-copy-id"
|
|
||||||
? -2
|
|
||||||
: -1;
|
|
||||||
|
|
||||||
children.splice(idx, 0, (
|
|
||||||
<Menu.MenuGroup>
|
<Menu.MenuGroup>
|
||||||
{icon ? (
|
{icon ? (
|
||||||
<Menu.MenuItem
|
<Menu.MenuItem
|
||||||
|
Loading…
Reference in New Issue
Block a user