feat: Introduce core sidebar component with user controls, voice state management, and update banner.
Some checks failed
Build and Release / build-and-release (push) Has been cancelled
Some checks failed
Build and Release / build-and-release (push) Has been cancelled
This commit is contained in:
@@ -827,7 +827,7 @@ const Sidebar = ({ channels, categories, activeChannel, onSelectChannel, usernam
|
|||||||
return (
|
return (
|
||||||
<div style={{ marginLeft: 32, marginBottom: 8 }}>
|
<div style={{ marginLeft: 32, marginBottom: 8 }}>
|
||||||
{users.map(user => (
|
{users.map(user => (
|
||||||
<div key={user.userId} style={{ display: 'flex', alignItems: 'center', marginBottom: 4 }}>
|
<div key={user.userId} style={{ display: 'flex', alignItems: 'center', marginBottom: 8 }}>
|
||||||
<Avatar
|
<Avatar
|
||||||
username={user.username}
|
username={user.username}
|
||||||
size={24}
|
size={24}
|
||||||
@@ -837,7 +837,7 @@ const Sidebar = ({ channels, categories, activeChannel, onSelectChannel, usernam
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<span style={{ color: 'var(--header-secondary)', fontSize: 14 }}>{user.username}</span>
|
<span style={{ color: 'var(--header-secondary)', fontSize: 14 }}>{user.username}</span>
|
||||||
<div style={{ display: 'flex', marginLeft: 'auto', gap: 4, alignItems: 'center' }}>
|
<div style={{ display: 'flex', marginLeft: 'auto', gap: 4, alignItems: 'center', marginRight: "16px" }}>
|
||||||
{user.isScreenSharing && <div style={liveBadgeStyle}>Live</div>}
|
{user.isScreenSharing && <div style={liveBadgeStyle}>Live</div>}
|
||||||
{(user.isMuted || user.isDeafened) && (
|
{(user.isMuted || user.isDeafened) && (
|
||||||
<ColoredIcon src={mutedIcon} color="var(--header-secondary)" size="14px" />
|
<ColoredIcon src={mutedIcon} color="var(--header-secondary)" size="14px" />
|
||||||
|
|||||||
@@ -93,3 +93,4 @@ export function TitleBarUpdateIcon() {
|
|||||||
</button>
|
</button>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -85,15 +85,23 @@ export const getAll = query({
|
|||||||
isMuted: boolean;
|
isMuted: boolean;
|
||||||
isDeafened: boolean;
|
isDeafened: boolean;
|
||||||
isScreenSharing: boolean;
|
isScreenSharing: boolean;
|
||||||
|
avatarUrl: string | null;
|
||||||
}>> = {};
|
}>> = {};
|
||||||
|
|
||||||
for (const s of states) {
|
for (const s of states) {
|
||||||
|
const user = await ctx.db.get(s.userId);
|
||||||
|
let avatarUrl: string | null = null;
|
||||||
|
if (user?.avatarStorageId) {
|
||||||
|
avatarUrl = await ctx.storage.getUrl(user.avatarStorageId);
|
||||||
|
}
|
||||||
|
|
||||||
(grouped[s.channelId] ??= []).push({
|
(grouped[s.channelId] ??= []).push({
|
||||||
userId: s.userId,
|
userId: s.userId,
|
||||||
username: s.username,
|
username: s.username,
|
||||||
isMuted: s.isMuted,
|
isMuted: s.isMuted,
|
||||||
isDeafened: s.isDeafened,
|
isDeafened: s.isDeafened,
|
||||||
isScreenSharing: s.isScreenSharing,
|
isScreenSharing: s.isScreenSharing,
|
||||||
|
avatarUrl,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user