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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Box, Icon, Tag } from '@rocket.chat/fuselage';
import type { Keys as IconName } from '@rocket.chat/icons';
import type { ReactElement } from 'react';
import type { ReactNode } from 'react';
import { memo } from 'react';

import SidebarGenericItem from './SidebarGenericItem';
Expand All @@ -13,7 +13,7 @@ type SidebarNavigationItemProps = {
tag?: string;
currentPath?: string;
externalUrl?: boolean;
badge?: () => ReactElement;
badge?: () => ReactNode;
};

const SidebarNavigationItem = ({
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/hooks/useFileInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { AllHTMLAttributes } from 'react';
import { useChat } from '../views/room/contexts/ChatContext';

export const useFileInput = (props: AllHTMLAttributes<HTMLInputElement>) => {
const fileInputRef = useRef<HTMLInputElement>();
const fileInputRef = useRef<HTMLInputElement>(undefined);
const chatContext = useChat();

const setupFileInput = useSafeRefCallback(
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/hooks/useRoomIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ReactiveUserStatus } from '../components/UserStatus';

export const useRoomIcon = (
room: Pick<IRoom, 't' | 'prid' | 'teamMain' | 'uids' | 'u' | 'abacAttributes'>,
): ComponentProps<typeof Icon> | ReactElement | null => {
): ComponentProps<typeof Icon> | ReactElement<any> | null => {
if (room.abacAttributes) {
if (room.teamMain) {
return { name: 'team-shield' };
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/hooks/useSingleFileInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const useSingleFileInput = (
maxSize?: number,
onError?: () => void,
): [onClick: () => void, reset: () => void] => {
const ref = useRef<HTMLInputElement>();
const ref = useRef<HTMLInputElement>(undefined);

useEffect(() => {
const fileInput = document.createElement('input');
Expand Down
14 changes: 6 additions & 8 deletions apps/meteor/client/lib/appLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Emitter } from '@rocket.chat/emitter';
import type { ReactElement } from 'react';
import type { ReactNode } from 'react';
import { lazy } from 'react';

const ConnectionStatusBar = lazy(() => import('../components/connectionStatus/ConnectionStatusBar'));
Expand All @@ -9,25 +9,23 @@ const ActionManagerBusyState = lazy(() => import('../components/ActionManagerBus
const AppLayoutThemeWrapper = lazy(() => import('../components/AppLayoutThemeWrapper'));
const CloudAnnouncementsRegion = lazy(() => import('../views/cloud/CloudAnnouncementsRegion'));

type AppLayoutDescriptor = ReactElement | null;

class AppLayoutSubscription extends Emitter<{ update: void }> {
private descriptor: AppLayoutDescriptor = null;
private descriptor: ReactNode = null;

getSnapshot = (): AppLayoutDescriptor => this.descriptor;
getSnapshot = (): ReactNode => this.descriptor;

subscribe = (onStoreChange: () => void): (() => void) => this.on('update', onStoreChange);

setCurrentValue(descriptor: AppLayoutDescriptor): void {
setCurrentValue(descriptor: ReactNode): void {
this.descriptor = descriptor;
this.emit('update');
}

render(element: ReactElement): void {
render(element: ReactNode): void {
this.setCurrentValue(element);
}

wrap(element: ReactElement): ReactElement {
wrap(element: ReactNode): ReactNode {
return (
<AppLayoutThemeWrapper>
<ConnectionStatusBar />
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/client/lib/createSidebarItems.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Keys as IconName } from '@rocket.chat/icons';
import type { LocationPathname } from '@rocket.chat/ui-contexts';
import type { ReactElement } from 'react';
import type { ReactNode } from 'react';

import { GO_ROCKET_CHAT_PREFIX } from './links';

Expand All @@ -13,7 +13,7 @@ export type Item = {
pathSection?: string;
name?: string;
externalUrl?: boolean;
badge?: () => ReactElement;
badge?: () => ReactNode;
};
export type SidebarDivider = { divider: boolean; i18nLabel: string };
export type SidebarItem = Item | SidebarDivider;
Expand Down
3 changes: 1 addition & 2 deletions apps/meteor/client/lib/normalizeThreadMessage.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import type { IMessage } from '@rocket.chat/core-typings';
import { Markup } from '@rocket.chat/gazzodown';
import { parse } from '@rocket.chat/message-parser';
import type { ReactElement } from 'react';

import { filterMarkdown } from '../../app/markdown/lib/markdown';
import GazzodownText from '../components/GazzodownText';

export function normalizeThreadMessage({ ...message }: Readonly<Pick<IMessage, 'msg' | 'mentions' | 'attachments'>>): ReactElement | null {
export function normalizeThreadMessage({ ...message }: Readonly<Pick<IMessage, 'msg' | 'mentions' | 'attachments'>>) {
if (message.msg) {
message.msg = filterMarkdown(message.msg);
delete message.mentions;
Expand Down
Loading