diff --git a/packages/web/src/components/layout/MobileDmsScreen.tsx b/packages/web/src/components/layout/MobileDmsScreen.tsx
index bc0d4045..cfc9dc19 100644
--- a/packages/web/src/components/layout/MobileDmsScreen.tsx
+++ b/packages/web/src/components/layout/MobileDmsScreen.tsx
@@ -4,6 +4,7 @@ import { useSpaceStore } from '../../stores/spaceStore';
import { useChatStore } from '../../stores/chatStore';
import { useAuthStore } from '../../stores/authStore';
import { useSocialStore } from '../../stores/socialStore';
+import { useContextMenuStore } from '../../stores/contextMenuStore';
import { Avatar } from '../ui/Avatar';
import { Mascot } from '../ui/Mascot';
import { resolveAssetUrl } from '../../utils/assetUrls';
@@ -18,6 +19,8 @@ export function MobileDmsScreen() {
const authUser = useAuthStore((s) => s.user);
const friends = useSocialStore((s) => s.friends);
const navigate = useNavigate();
+ const openContextMenu = useContextMenuStore((s) => s.open);
+ const setCurrentChannel = useChatStore((s) => s.setCurrentChannel);
// Online friends for the activity row
const onlineFriends = useMemo(() =>
@@ -40,6 +43,30 @@ export function MobileDmsScreen() {
pushMobileScreen('channel-chat', { channelId: dmId, spaceId: '@me' });
};
+ const handleDmContextMenu = (e: React.MouseEvent, dmId: string, isGroup: boolean) => {
+ if (!isGroup) return;
+ e.preventDefault();
+ e.stopPropagation();
+
+ openContextMenu({ x: e.clientX, y: e.clientY }, [
+ {
+ key: 'leave-group',
+ type: 'action',
+ label: 'Leave Group',
+ danger: true,
+ icon: ,
+ onClick: () => {
+ const currentChId = useChatStore.getState().currentChannelId;
+ if (currentChId === dmId) {
+ navigate('/channels/@me');
+ setCurrentChannel(null);
+ }
+ useSpaceStore.getState().leaveDm(dmId);
+ },
+ },
+ ]);
+ };
+
const formatTimestamp = (ts: number): string => {
const now = Date.now();
const diff = now - ts;
@@ -138,6 +165,7 @@ export function MobileDmsScreen() {