Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions client/hooks/useRoomIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ export const colors = {
offline: 'neutral-600',
};

export const useRoomIcon = (
room: IRoom,
small = true,
): JSX.Element | { name: string; color?: string } | null => {
export const useRoomIcon = (room: IRoom): JSX.Element | { name: string; color?: string } | null => {
if (room.prid) {
return { name: 'baloons' };
}
Expand All @@ -38,7 +35,6 @@ export const useRoomIcon = (
return (
<ReactiveUserStatus
{...({
small,
uid: direct.uids.filter((uid) => uid !== room.u._id)[0] || room.u._id,
} as any)}
/>
Expand Down
4 changes: 2 additions & 2 deletions client/sidebar/RoomList/SidebarIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import React from 'react';

import { useRoomIcon } from '../../hooks/useRoomIcon';

const SidebarIcon = ({ room, small }) => {
const icon = useRoomIcon(room, small);
const SidebarIcon = ({ room }) => {
const icon = useRoomIcon(room);

return <Sidebar.Item.Icon {...(icon.name && icon)}>{!icon.name && icon}</Sidebar.Item.Icon>;
};
Expand Down
14 changes: 2 additions & 12 deletions client/sidebar/search/UserItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,11 @@ import React, { memo } from 'react';
import { roomTypes } from '../../../app/utils/client';
import { ReactiveUserStatus } from '../../components/UserStatus';

const UserItem = ({
item,
id,
style,
t,
SideBarItemTemplate,
AvatarTemplate,
useRealName,
sidebarViewMode,
}) => {
const UserItem = ({ item, id, style, t, SideBarItemTemplate, AvatarTemplate, useRealName }) => {
const title = useRealName ? item.fname || item.name : item.name || item.fname;
const small = sidebarViewMode !== 'medium';
const icon = (
<Sidebar.Item.Icon>
<ReactiveUserStatus small={small && 'small'} uid={item._id} />
<ReactiveUserStatus uid={item._id} />
</Sidebar.Item.Icon>
);
const href = roomTypes.getRouteLink(item.t, item);
Expand Down