Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: bump fuselage version #24453

Merged
merged 1 commit into from
Feb 8, 2022
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/Omnichannel/modals/TranscriptModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const TranscriptModal: FC<TranscriptModalProps> = ({
}) => {
const t = useTranslation();

const inputRef = useAutoFocus(true);
const inputRef = useAutoFocus<HTMLInputElement>(true);

const { values, handlers } = useForm({
email: emailDefault || '',
Expand Down
2 changes: 1 addition & 1 deletion client/components/TwoFactorModal/TwoFactorEmailModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const TwoFactorEmailModal = ({ onConfirm, onClose, emailOrUsername }: TwoFactorE
const dispatchToastMessage = useToastMessageDispatch();
const t = useTranslation();
const [code, setCode] = useState<string>('');
const ref = useAutoFocus();
const ref = useAutoFocus<HTMLInputElement>();

const sendEmailCode = useEndpoint('POST', 'users.2fa.sendEmailCode');

Expand Down
2 changes: 1 addition & 1 deletion client/components/TwoFactorModal/TwoFactorTotpModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type TwoFactorTotpModalProps = {
const TwoFactorTotpModal = ({ onConfirm, onClose }: TwoFactorTotpModalProps): ReactElement => {
const t = useTranslation();
const [code, setCode] = useState<string>('');
const ref = useAutoFocus();
const ref = useAutoFocus<HTMLInputElement>();

const onConfirmTotpCode = (): void => {
onConfirm(code, Method.TOTP);
Expand Down
6 changes: 3 additions & 3 deletions client/components/VerticalBar/VerticalBarAction.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { ActionButton } from '@rocket.chat/fuselage';
import React, { ReactElement, memo, MouseEventHandler } from 'react';
import { ActionButton, Icon } from '@rocket.chat/fuselage';
import React, { ReactElement, memo, MouseEventHandler, ComponentProps } from 'react';

const VerticalBarAction = ({
name,
...props
}: {
name: string;
name: ComponentProps<typeof Icon>['name'];
title?: string;
onClick?: MouseEventHandler<HTMLOrSVGElement>;
}): ReactElement => <ActionButton flexShrink={0} icon={name} ghost {...props} tiny />;
Expand Down
2 changes: 1 addition & 1 deletion client/components/avatar/BaseAvatar.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Avatar, AvatarProps, Skeleton } from '@rocket.chat/fuselage';
import React, { FC, useState } from 'react';

export type BaseAvatarProps = AvatarProps;
export type BaseAvatarProps = Omit<AvatarProps, 'is'>;

const BaseAvatar: FC<BaseAvatarProps> = ({ size, ...props }) => {
const [error, setError] = useState<unknown>(false);
Expand Down
2 changes: 1 addition & 1 deletion client/views/admin/cloud/CopyStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const CopyStep: FC<CopyStepProps> = ({ onNextButtonClick }) => {
loadWorkspaceRegisterData();
}, [getWorkspaceRegisterData]);

const copyRef = useRef<Element>();
const copyRef = useRef<HTMLElement>(null);

useEffect(() => {
if (!copyRef.current) {
Expand Down
4 changes: 2 additions & 2 deletions client/views/room/Header/ToolBox/ToolBox.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Menu, Option, MenuProps, Box } from '@rocket.chat/fuselage';
import { useMutableCallback } from '@rocket.chat/fuselage-hooks';
import React, { memo, ReactNode, useRef, ComponentProps, FC } from 'react';
import React, { memo, ReactNode, useRef, ComponentProps, FC, ReactElement } from 'react';
// import tinykeys from 'tinykeys';

// used to open the menu option by keyboard
Expand Down Expand Up @@ -100,7 +100,7 @@ const ToolBox: FC<ToolBoxProps> = ({ className }) => {
aria-keyshortcuts='alt'
tabIndex={-1}
options={hiddenActions}
renderItem={({ value, ...props }): ReactNode => value && hiddenActionRenderers.current[value](props)}
renderItem={({ value, ...props }): ReactElement | null => value && hiddenActionRenderers.current[value](props)}
/>
)}
</>
Expand Down
2 changes: 1 addition & 1 deletion client/views/room/contextualBar/Threads/ThreadList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const ThreadList: FC<ThreadListProps> = function ThreadList({
const showRealNames = Boolean(useSetting('UI_Use_Real_Name'));

const t = useTranslation();
const inputRef = useAutoFocus(true);
const inputRef = useAutoFocus<HTMLInputElement>(true);
const [name] = useCurrentRoute();

if (!name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const FileUploadModal = ({ onClose, file, fileName, onSubmit, invalidContentType
const t = useTranslation();
const dispatchToastMessage = useToastMessageDispatch();

const ref = useAutoFocus();
const ref = useAutoFocus<HTMLInputElement>();

const handleName = (e: ChangeEvent<HTMLInputElement>): void => {
setName(e.currentTarget.value);
Expand Down
4 changes: 2 additions & 2 deletions client/views/teams/CreateTeamModal/CreateTeamModal.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Box, Modal, ButtonGroup, Button, TextInput, Field, ToggleSwitch, FieldGroup } from '@rocket.chat/fuselage';
import { useMutableCallback, useDebouncedCallback, useAutoFocus } from '@rocket.chat/fuselage-hooks';
import React, { FC, memo, Ref, useCallback, useEffect, useMemo, useState } from 'react';
import React, { FC, memo, useCallback, useEffect, useMemo, useState } from 'react';

import { IUser } from '../../../../definition/IUser';
import { usePermission } from '../../../contexts/AuthorizationContext';
Expand Down Expand Up @@ -230,7 +230,7 @@ const CreateTeamModal: FC<CreateTeamModalProps> = ({ onClose }) => {

const t = useTranslation();

const focusRef = useAutoFocus() as Ref<HTMLElement>;
const focusRef = useAutoFocus<HTMLInputElement>();

return (
<Modal>
Expand Down
2 changes: 1 addition & 1 deletion client/views/teams/CreateTeamModal/TeamNameInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ type TeamNameInputProps = TextInputProps & {
private: boolean;
};

const TeamNameInput = forwardRef<HTMLElement, TeamNameInputProps>(function TeamNameInput({ private: _private = true, ...props }, ref) {
const TeamNameInput = forwardRef<HTMLInputElement, TeamNameInputProps>(function TeamNameInput({ private: _private = true, ...props }, ref) {
const addon = useMemo(() => <Icon name={_private ? 'team-lock' : 'team'} size='x20' />, [_private]);

return <TextInput ref={ref} {...props} addon={addon} />;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type TextButtonProps = {
action: () => void;
};

const TextButton = forwardRef<Element, TextButtonProps>(function TextButton({ text, action }, ref) {
const TextButton = forwardRef<HTMLElement, TextButtonProps>(function TextButton({ text, action }, ref) {
const t = useTranslation();

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const CannedResponseList: FC<{
reload,
}) => {
const t = useTranslation();
const inputRef = useAutoFocus(true);
const inputRef = useAutoFocus<HTMLInputElement>(true);

const cannedId = useTabContext();

Expand Down
Loading