fix: use space gradients for mutual space avatars and add federation indicators in profile modal

Space avatars in the mutual spaces tab now use getSpaceGradient() instead of
a flat grey background, matching the sidebar appearance. Mutual friends and
spaces from remote instances show a globe icon with the instance hostname.
Also wires up federated mutuals loading, correct API client routing for
remote user profiles, and the new mutuals utility.
This commit is contained in:
Jannis Braun
2026-03-10 19:19:05 +01:00
parent 003eff2268
commit 274f5a710e
8 changed files with 245 additions and 65 deletions
@@ -3,7 +3,7 @@ import { useNavigate } from 'react-router-dom';
import { Modal } from '../ui/Modal';
import { Avatar } from '../ui/Avatar';
import { useUIStore } from '../../stores/uiStore';
import { useSpaceStore } from '../../stores/spaceStore';
import { useSpaceStore, getApiForOrigin, resolveUserOrigin } from '../../stores/spaceStore';
import { api } from '../../api/client';
import type { User } from '@backspace/shared';
@@ -66,8 +66,10 @@ export function NewDmModal() {
navigate(`/channels/@me/${existing.dm.id}`);
return;
}
const channel = await api.dm.create({ userId: user.id });
addDmChannel(channel);
const origin = resolveUserOrigin(user);
const dmApi = getApiForOrigin(origin);
const channel = await dmApi.dm.create({ userId: user.id });
addDmChannel(channel, origin);
closeModal();
useUIStore.getState().setShowDms(true);
navigate(`/channels/@me/${channel.id}`);