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
2 changes: 1 addition & 1 deletion client/components/Page/PageScrollableContentWithShadow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const PageScrollableContentWithShadow: FC<PageScrollableContentWithShadowProps>
const [, setBorder] = useContext(PageContext);
return (
<PageScrollableContent
onScrollContent={({ top, ...args }): void => {
onScrollContent={({ top, ...args }: { top: boolean }): void => {
setBorder(!!top);
onScrollContent && onScrollContent({ top, ...args });
}}
Expand Down
4 changes: 2 additions & 2 deletions client/hooks/useRoomIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { ReactNode } from 'react';

import { IRoom, IOmnichannelRoom, IDirectMessageRoom } from '../../definition/IRoom';
import { ReactiveUserStatus } from '../components/UserStatus';
Expand All @@ -10,7 +10,7 @@ export const colors = {
offline: 'neutral-600',
};

export const useRoomIcon = (room: IRoom): JSX.Element | { name: string; color?: string } | null => {
export const useRoomIcon = (room: IRoom): ReactNode | { name: string; color?: string } | null => {
if (room.prid) {
return { name: 'baloons' };
}
Expand Down
8 changes: 6 additions & 2 deletions client/sidebar/RoomList/SideBarItemTemplateWithData.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ function SideBarItemTemplateWithData({
isAnonymous,
}) {
const title = roomTypes.getRoomName(room.t, room);
const icon = <SidebarIcon room={room} small={sidebarViewMode !== 'medium'} />;
const href = roomTypes.getRouteLink(room.t, room);

const {
Expand All @@ -55,6 +54,11 @@ function SideBarItemTemplateWithData({
cl,
} = room;

const highlighted = !hideUnreadStatus && (alert || unread);
const icon = (
<SidebarIcon highlighted={highlighted} room={room} small={sidebarViewMode !== 'medium'} />
);

const isQueued = room.status === 'queued';

const threadUnread = tunread.length > 0;
Expand Down Expand Up @@ -82,7 +86,7 @@ function SideBarItemTemplateWithData({
id={id}
data-qa='sidebar-item'
aria-level='2'
unread={!hideUnreadStatus && (alert || unread)}
unread={highlighted}
threadUnread={threadUnread}
selected={selected}
href={href}
Expand Down
8 changes: 6 additions & 2 deletions client/sidebar/RoomList/SidebarIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ import React from 'react';

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

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

return <Sidebar.Item.Icon {...(icon.name && icon)}>{!icon.name && icon}</Sidebar.Item.Icon>;
return (
<Sidebar.Item.Icon highlighted={highlighted} {...(icon.name && icon)}>
{!icon.name && icon}
</Sidebar.Item.Icon>
);
};

export default SidebarIcon;
2 changes: 1 addition & 1 deletion client/views/room/Header/ToolBox/ToolBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const ToolBox: FC<ToolBoxProps> = ({ className }) => {
},
...item,
},
];
] as any;
}),
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ const RoomsInput: FC<RoomsInputProps> = ({ onChange, ...props }) => {
);

const handleChange = useCallback<AutoCompleteProps['onChange']>(
(value, action) => {
onChange(rooms[value as IRoom['_id']], action);
(value, action: 'remove' | undefined) => {
onChange(rooms[value as string], action);
},
[onChange, rooms],
);
Expand Down
3 changes: 3 additions & 0 deletions definition/IRoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ export interface IRoom extends IRocketChatRecord {
_id: string;
};
onHold?: boolean;
unread?: number;
alert?: boolean;
hideUnreadStatus?: boolean;
departmentId?: string;
}

Expand Down
119 changes: 44 additions & 75 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,16 +141,16 @@
"@nivo/line": "^0.61.1",
"@nivo/pie": "^0.61.1",
"@rocket.chat/apps-engine": "1.25.0-alpha.4943",
"@rocket.chat/css-in-js": "^0.23.0",
"@rocket.chat/emitter": "^0.23.0",
"@rocket.chat/fuselage": "^0.23.0",
"@rocket.chat/fuselage-hooks": "^0.23.0",
"@rocket.chat/fuselage-polyfills": "^0.23.0",
"@rocket.chat/fuselage-tokens": "^0.23.0",
"@rocket.chat/fuselage-ui-kit": "^0.23.0",
"@rocket.chat/memo": "^0.6.3-dev.205",
"@rocket.chat/mp3-encoder": "^0.23.0",
"@rocket.chat/ui-kit": "^0.23.0",
"@rocket.chat/css-in-js": "^0.6.3-dev.234",
"@rocket.chat/emitter": "^0.6.3-dev.234",
"@rocket.chat/fuselage": "^0.6.3-dev.234",
"@rocket.chat/fuselage-hooks": "^0.6.3-dev.234",
"@rocket.chat/fuselage-polyfills": "^0.6.3-dev.234",
"@rocket.chat/fuselage-tokens": "^0.6.3-dev.234",
"@rocket.chat/fuselage-ui-kit": "^0.6.3-dev.234",
"@rocket.chat/memo": "^0.6.3-dev.234",
"@rocket.chat/mp3-encoder": "^0.6.3-dev.234",
"@rocket.chat/ui-kit": "^0.6.3-dev.234",
"@slack/client": "^4.12.0",
"@types/dompurify": "^2.2.1",
"@types/fibers": "^3.1.0",
Expand Down