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: Dedicated package for UI contexts #25432

Merged
merged 26 commits into from
May 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
d036f31
Move ConnectionStatusContext
tassoevan May 5, 2022
2d34f1c
Move ModalContext
tassoevan May 5, 2022
4cb45ee
Move `AttachmentContext`
tassoevan May 5, 2022
14e6e9a
Move `OmnichannelContext`
tassoevan May 5, 2022
578a157
Move `AvatarUrlContext`
tassoevan May 5, 2022
0a6c4bb
Move `LayoutContext`
tassoevan May 5, 2022
0c57a3b
Move `TooltipContext`
tassoevan May 5, 2022
1c1f791
Move `ToastMessagesContext`
tassoevan May 5, 2022
87d310d
Move `CustomSoundContext`
tassoevan May 5, 2022
42e4676
Drop unused context (`SidebarContext`)
tassoevan May 5, 2022
a61f72d
Move `SessionContext`; fix linting errors
tassoevan May 5, 2022
2ae3715
Move `RouterContext`
tassoevan May 5, 2022
3f5f6e1
Move `RouterContext`
tassoevan May 5, 2022
72b1074
Move `SettingsContext`
tassoevan May 5, 2022
3382806
Move `SettingsContext`
tassoevan May 5, 2022
83b7c48
Fix types
tassoevan May 5, 2022
b2439b0
Move `EditableSettingsContext` to `views/admin` scope
tassoevan May 5, 2022
f67ea98
Change module from TSX to TS
tassoevan May 5, 2022
09b55db
Rollback `OmnichannelContext` modules
tassoevan May 6, 2022
fea05c7
Move `ServerContext`
tassoevan May 6, 2022
f6462f9
Move `TranslationContext`
tassoevan May 6, 2022
27ecd6a
Fix eslint issues
tassoevan May 6, 2022
23d505c
Fix peer dependencies
tassoevan May 7, 2022
0eda819
Merge branch 'develop' of github.com:RocketChat/Rocket.Chat into refa…
tassoevan May 9, 2022
c6dc592
Skip faulty test
tassoevan May 9, 2022
6e0b547
Merge branch 'develop' of github.com:RocketChat/Rocket.Chat into refa…
tassoevan May 9, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 1 addition & 2 deletions apps/meteor/app/autotranslate/client/lib/tabBar.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { lazy, useMemo } from 'react';
import { useSetting, usePermission } from '@rocket.chat/ui-contexts';

import { addAction } from '../../../../client/views/room/lib/Toolbox';
import { usePermission } from '../../../../client/contexts/AuthorizationContext';
import { useSetting } from '../../../../client/contexts/SettingsContext';

addAction('autotranslate', () => {
const hasPermission = usePermission('auto-translate');
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/discussion/client/tabBar.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useMemo, lazy } from 'react';
import { useSetting } from '@rocket.chat/ui-contexts';

import { addAction } from '../../../client/views/room/lib/Toolbox';
import { useSetting } from '../../../client/contexts/SettingsContext';

const template = lazy(() => import('../../../client/views/room/contextualBar/Discussions'));

Expand Down
4 changes: 1 addition & 3 deletions apps/meteor/app/e2e/client/tabbar.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { useMemo, useCallback } from 'react';
import { useMutableCallback } from '@rocket.chat/fuselage-hooks';
import { useSetting, usePermission, useMethod } from '@rocket.chat/ui-contexts';

import { addAction } from '../../../client/views/room/lib/Toolbox';
import { useSetting } from '../../../client/contexts/SettingsContext';
import { usePermission } from '../../../client/contexts/AuthorizationContext';
import { useMethod } from '../../../client/contexts/ServerContext';
import { useReactiveValue } from '../../../client/hooks/useReactiveValue';
import { e2e } from './rocketchat.e2e';

Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/livechat/client/externalFrame/tabBar.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useMemo } from 'react';
import { useSetting } from '@rocket.chat/ui-contexts';

import { useSetting } from '../../../../client/contexts/SettingsContext';
import { addAction } from '../../../../client/views/room/lib/Toolbox';

addAction('omnichannel-external-frame', () => {
Expand Down
3 changes: 1 addition & 2 deletions apps/meteor/app/livestream/client/tabBar.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React, { ReactNode, useMemo } from 'react';
import { Option, Badge } from '@rocket.chat/fuselage';
import { useSetting, useTranslation } from '@rocket.chat/ui-contexts';

import { useSetting } from '../../../client/contexts/SettingsContext';
import { useTranslation } from '../../../client/contexts/TranslationContext';
import { addAction } from '../../../client/views/room/lib/Toolbox';
import Header from '../../../client/components/Header';

Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/message-pin/client/tabBar.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useMemo } from 'react';
import { useSetting } from '@rocket.chat/ui-contexts';

import { addAction } from '../../../client/views/room/lib/Toolbox';
import { useSetting } from '../../../client/contexts/SettingsContext';

addAction('pinned-messages', () => {
const pinningAllowed = useSetting('Message_AllowPinning');
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/message-snippet/client/tabBar/tabBar.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useMemo } from 'react';
import { useSetting } from '@rocket.chat/ui-contexts';

import { addAction } from '../../../../client/views/room/lib/Toolbox';
import { useSetting } from '../../../../client/contexts/SettingsContext';

addAction('snippeted-messages', () => {
const snippetingEnabled = useSetting('Message_AllowSnippeting');
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/otr/client/tabBar.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useMemo, lazy, useEffect } from 'react';
import { useSetting } from '@rocket.chat/ui-contexts';

import { OTR } from './rocketchat.otr';
import { useSetting } from '../../../client/contexts/SettingsContext';
import { addAction } from '../../../client/views/room/lib/Toolbox';

const template = lazy(() => import('../../../client/views/room/contextualBar/OTR'));
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/push-notifications/client/tabBar.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { lazy, useMemo } from 'react';
import { useUserSubscription } from '@rocket.chat/ui-contexts';

import { useUserSubscription } from '../../../client/contexts/UserContext';
import { addAction } from '../../../client/views/room/lib/Toolbox';

addAction('push-notifications', ({ room }) => {
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/threads/client/flextab/threadlist.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { useMemo, lazy, LazyExoticComponent, FC, ReactNode } from 'react';
import { BadgeProps } from '@rocket.chat/fuselage';
import type { ISubscription } from '@rocket.chat/core-typings';
import { useSetting } from '@rocket.chat/ui-contexts';

import { addAction } from '../../../../client/views/room/lib/Toolbox';
import { useSetting } from '../../../../client/contexts/SettingsContext';
import Header from '../../../../client/components/Header';

const getVariant = (tunreadUser: number, tunreadGroup: number): BadgeProps['variant'] => {
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/ui-clean-history/client/lib/tabBar.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useMemo, lazy } from 'react';
import { usePermission } from '@rocket.chat/ui-contexts';

import { addAction } from '../../../../client/views/room/lib/Toolbox';
import { usePermission } from '../../../../client/contexts/AuthorizationContext';

const template = lazy(() => import('../../../../client/views/room/contextualBar/PruneMessages'));

Expand Down
3 changes: 1 addition & 2 deletions apps/meteor/app/ui-utils/client/lib/AccountBox.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import type { ComponentProps } from 'react';
import { Option } from '@rocket.chat/fuselage';
import type { IUser } from '@rocket.chat/core-typings';

import { TranslationKey } from '../../../../client/contexts/TranslationContext';
import { TranslationKey } from '@rocket.chat/ui-contexts';

export declare const AccountBox: {
setStatus: (status: IUser['status'], statusText?: IUser['statusText']) => void;
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/ui-utils/client/lib/MessageAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import { ReactiveVar } from 'meteor/reactive-var';
import { Tracker } from 'meteor/tracker';
import { Icon } from '@rocket.chat/fuselage';
import { IMessage, IUser, ISubscription, IRoom, SettingValue } from '@rocket.chat/core-typings';
import { TranslationKey } from '@rocket.chat/ui-contexts';

import { Messages, Rooms, Subscriptions } from '../../../models/client';
import { roomCoordinator } from '../../../../client/lib/rooms/roomCoordinator';
import { ToolboxContextValue } from '../../../../client/views/room/lib/Toolbox/ToolboxContext';
import { TranslationKey } from '../../../../client/contexts/TranslationContext';

const call = (method: string, ...args: any[]): Promise<any> =>
new Promise((resolve, reject) => {
Expand Down
3 changes: 1 addition & 2 deletions apps/meteor/app/ui-utils/lib/MessageTypes.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { IMessage, MessageTypesValues } from '@rocket.chat/core-typings';

import { TranslationKey } from '../../../client/contexts/TranslationContext';
import { TranslationKey } from '@rocket.chat/ui-contexts';

export type MessageType = {
id: MessageTypesValues;
Expand Down
8 changes: 3 additions & 5 deletions apps/meteor/app/videobridge/client/tabBar.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React, { useMemo, lazy, ReactNode } from 'react';
import { useStableArray } from '@rocket.chat/fuselage-hooks';
import { Option, Badge } from '@rocket.chat/fuselage';
import { useUser, useSetting, useTranslation } from '@rocket.chat/ui-contexts';

import { useSetting } from '../../../client/contexts/SettingsContext';
import { addAction, ToolboxActionConfig } from '../../../client/views/room/lib/Toolbox';
import { useTranslation } from '../../../client/contexts/TranslationContext';
import { useUser } from '../../../client/contexts/UserContext';
import Header from '../../../client/components/Header';

const templateBBB = lazy(() => import('../../../client/views/room/contextualBar/VideoConference/BBB'));

addAction('bbb_video', ({ room }) => {
const enabled = useSetting('bigbluebutton_Enabled');
const t = useTranslation();
Expand All @@ -28,8 +28,6 @@ addAction('bbb_video', ({ room }) => {
const username = user ? user.username : '';
const enableOption = enabled && (!username || !room.muted?.includes(username));

const templateBBB = lazy(() => import('../../../client/views/room/contextualBar/VideoConference/BBB'));

return useMemo(
() =>
enableOption
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/webrtc/client/tabBar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useMemo, useCallback } from 'react';
import { useSetting } from '@rocket.chat/ui-contexts';

import { useSetting } from '../../../client/contexts/SettingsContext';
import { addAction } from '../../../client/views/room/lib/Toolbox';
import { APIClient } from '../../utils/client';

Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/UIKit/hooks/useUIKitHandleAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { UiKitPayload, UIKitActionEvent } from '@rocket.chat/core-typings';
import { useMutableCallback } from '@rocket.chat/fuselage-hooks';
// import { UIKitIncomingInteractionContainerType } from '@rocket.chat/apps-engine/definition/uikit/UIKitIncomingInteractionContainer';

// import { useEndpoint } from '../../contexts/ServerContext';
// import { useEndpoint } from '@rocket.chat/ui-contexts';
import * as ActionManager from '../../../app/ui-message/client/ActionManager';

const useUIKitHandleAction = <S extends UiKitPayload>(state: S): ((event: UIKitActionEvent) => Promise<void>) =>
Expand Down
5 changes: 3 additions & 2 deletions apps/meteor/client/UIKit/hooks/useUIKitHandleClose.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ import { UIKitInteractionType } from '@rocket.chat/apps-engine/definition/uikit'
// import React, { Context, FC, useMemo } from 'react';
import { UiKitPayload } from '@rocket.chat/core-typings';
import { useMutableCallback } from '@rocket.chat/fuselage-hooks';
import { useToastMessageDispatch } from '@rocket.chat/ui-contexts';
// import { UIKitIncomingInteractionContainerType } from '@rocket.chat/apps-engine/definition/uikit/UIKitIncomingInteractionContainer';

// import { useEndpoint } from '../../contexts/ServerContext';
// import { useEndpoint } from '@rocket.chat/ui-contexts';

import * as ActionManager from '../../../app/ui-message/client/ActionManager';
import { useToastMessageDispatch } from '../../contexts/ToastMessagesContext';

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const emptyFn = (_error: any, _result: UIKitInteractionType | void): void => undefined;
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/components/AutoCompleteDepartment.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
// fuselage release is OoS of this regression
import { PaginatedSelectFiltered } from '@rocket.chat/fuselage';
import { useDebouncedValue } from '@rocket.chat/fuselage-hooks';
import { useTranslation } from '@rocket.chat/ui-contexts';
import React, { memo, useMemo, useState } from 'react';

import { useTranslation } from '../contexts/TranslationContext';
import { useRecordList } from '../hooks/lists/useRecordList';
import { AsyncStatePhase } from '../hooks/useAsyncState';
import { useDepartmentsList } from './Omnichannel/hooks/useDepartmentsList';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { PaginatedMultiSelectFiltered } from '@rocket.chat/fuselage';
import { useDebouncedValue } from '@rocket.chat/fuselage-hooks';
import { useTranslation } from '@rocket.chat/ui-contexts';
import React, { memo, useMemo, useState } from 'react';

import { useTranslation } from '../contexts/TranslationContext';
import { useRecordList } from '../hooks/lists/useRecordList';
import { AsyncStatePhase } from '../hooks/useAsyncState';
import { useDepartmentsList } from './Omnichannel/hooks/useDepartmentsList';
Expand Down
3 changes: 1 addition & 2 deletions apps/meteor/client/components/BurgerMenu/BurgerMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { useMutableCallback } from '@rocket.chat/fuselage-hooks';
import { useLayout, useSession } from '@rocket.chat/ui-contexts';
import React, { memo, ReactElement } from 'react';

import { useLayout } from '../../contexts/LayoutContext';
import { useSession } from '../../contexts/SessionContext';
import { useEmbeddedLayout } from '../../hooks/useEmbeddedLayout';
import BurgerMenuButton from './BurgerMenuButton';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { css } from '@rocket.chat/css-in-js';
import { Box } from '@rocket.chat/fuselage';
import { useTranslation } from '@rocket.chat/ui-contexts';
import React, { ReactElement } from 'react';

import { useTranslation } from '../../contexts/TranslationContext';
import BurgerBadge from './BurgerBadge';
import BurgerIcon from './BurgerIcon';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Box } from '@rocket.chat/fuselage';
import { useTranslation } from '@rocket.chat/ui-contexts';
import React, { FC } from 'react';

import { useTranslation } from '../contexts/TranslationContext';
import GenericModal from './GenericModal';
import RawText from './RawText';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { IMessage, IRoom, IUser } from '@rocket.chat/core-typings';
import { Modal, Field, FieldGroup, ToggleSwitch, TextInput, TextAreaInput, ButtonGroup, Button, Icon, Box } from '@rocket.chat/fuselage';
import { useMutableCallback } from '@rocket.chat/fuselage-hooks';
import { useTranslation } from '@rocket.chat/ui-contexts';
import React, { ReactElement } from 'react';

import { useTranslation } from '../../contexts/TranslationContext';
import { useEndpointActionExperimental } from '../../hooks/useEndpointActionExperimental';
import { useForm } from '../../hooks/useForm';
import { goToRoomById } from '../../lib/utils/goToRoomById';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Skeleton, TextInput, Callout } from '@rocket.chat/fuselage';
import { useTranslation } from '@rocket.chat/ui-contexts';
import React, { useMemo, ReactElement } from 'react';

import { useTranslation } from '../../contexts/TranslationContext';
import { AsyncStatePhase } from '../../hooks/useAsyncState';
import { useEndpointData } from '../../hooks/useEndpointData';
import { roomCoordinator } from '../../lib/rooms/roomCoordinator';
Expand Down
3 changes: 1 addition & 2 deletions apps/meteor/client/components/CustomFieldsForm.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { TextInput, Select, Field } from '@rocket.chat/fuselage';
import { capitalize } from '@rocket.chat/string-helpers';
import { useSetting, useTranslation } from '@rocket.chat/ui-contexts';
import React, { useMemo, useEffect, useState } from 'react';

import { useSetting } from '../contexts/SettingsContext';
import { useTranslation } from '../contexts/TranslationContext';
import { useComponentDidUpdate } from '../hooks/useComponentDidUpdate';
import { useForm } from '../hooks/useForm';

Expand Down
3 changes: 1 addition & 2 deletions apps/meteor/client/components/FilterByText.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Box, Icon, TextInput, Button } from '@rocket.chat/fuselage';
import { useTranslation } from '@rocket.chat/ui-contexts';
import React, { FC, ChangeEvent, FormEvent, memo, useCallback, useEffect, useState } from 'react';

import { useTranslation } from '../contexts/TranslationContext';

type FilterByTextProps = {
placeholder?: string;
onChange: (filter: { text: string }) => void;
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/components/GenericModal.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Box, Button, ButtonGroup, Icon, Modal } from '@rocket.chat/fuselage';
import { useTranslation } from '@rocket.chat/ui-contexts';
import React, { FC, ComponentProps, ReactElement, ReactNode } from 'react';

import { useTranslation } from '../contexts/TranslationContext';
import { withDoNotAskAgain, RequiredModalProps } from './withDoNotAskAgain';

type VariantType = 'danger' | 'warning' | 'info' | 'success';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Pagination, Tile } from '@rocket.chat/fuselage';
import { useDebouncedValue } from '@rocket.chat/fuselage-hooks';
import { useTranslation } from '@rocket.chat/ui-contexts';
import React, { useState, useEffect, forwardRef, ReactNode, ReactElement, Key, useMemo, Ref } from 'react';
import flattenChildren from 'react-keyed-flatten-children';

import { useTranslation } from '../../contexts/TranslationContext';
import { GenericTable as GenericTableV2 } from './V2/GenericTable';
import { GenericTableBody } from './V2/GenericTableBody';
import { GenericTableHeader } from './V2/GenericTableHeader';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { useTranslation } from '@rocket.chat/ui-contexts';
import { useCallback } from 'react';

import { useTranslation } from '../../../contexts/TranslationContext';

export const useItemsPerPageLabel = (): (() => string) => {
const t = useTranslation();
return useCallback(() => t('Items_per_page:'), [t]);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Pagination } from '@rocket.chat/fuselage';
import { useTranslation } from '@rocket.chat/ui-contexts';
import { ComponentProps, useCallback } from 'react';

import { useTranslation } from '../../../contexts/TranslationContext';

type Props<T extends ComponentProps<typeof Pagination>['showingResultsLabel'] = ComponentProps<typeof Pagination>['showingResultsLabel']> =
T extends (...args: any[]) => any ? Parameters<T> : never;

Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/components/Header/Header.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { IRoom } from '@rocket.chat/core-typings';
import { SettingsContext } from '@rocket.chat/ui-contexts';
import { action } from '@storybook/addon-actions';
import { ComponentMeta, ComponentStory } from '@storybook/react';
import React from 'react';

import Header from '.';
import { SettingsContext } from '../../contexts/SettingsContext';
import { useRoomIcon } from '../../hooks/useRoomIcon';
import ToolBox from '../../views/room/Header/ToolBox';
import { ActionRenderer, addAction } from '../../views/room/lib/Toolbox';
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/components/Header/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Box } from '@rocket.chat/fuselage';
import { useLayout } from '@rocket.chat/ui-contexts';
import React, { FC } from 'react';

import { useLayout } from '../../contexts/LayoutContext';
import HeaderDivider from './HeaderDivider';

const Header: FC<any> = (props) => {
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/components/LocalTime.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useTranslation } from '@rocket.chat/ui-contexts';
import React, { memo, ReactElement } from 'react';

import { useTranslation } from '../contexts/TranslationContext';
import { useUTCClock } from '../hooks/useUTCClock';

type LocalTimeProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Box } from '@rocket.chat/fuselage';
import { useAttachmentDimensions } from '@rocket.chat/ui-contexts';
import React, { ComponentProps, FC } from 'react';

import { useAttachmentDimensions } from '../context/AttachmentContext';

const Attachment: FC<ComponentProps<typeof Box>> = (props) => {
const { width } = useAttachmentDimensions();
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useTranslation } from '@rocket.chat/ui-contexts';
import React, { ComponentProps, FC } from 'react';

import { useTranslation } from '../../../../contexts/TranslationContext';
import Action from './Action';

const Collapse: FC<Omit<ComponentProps<typeof Action>, 'icon'> & { collapsed?: boolean }> = ({ collapsed = false, ...props }) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useTranslation } from '@rocket.chat/ui-contexts';
import React, { ComponentProps, FC } from 'react';

import { useTranslation } from '../../../../contexts/TranslationContext';
import Action from './Action';

const Download: FC<Omit<ComponentProps<typeof Action>, 'icon'> & { title?: string | undefined; href: string }> = ({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { AudioAttachmentProps } from '@rocket.chat/core-typings';
import { useMediaUrl } from '@rocket.chat/ui-contexts';
import React, { FC } from 'react';

import MarkdownText from '../../../MarkdownText';
import Attachment from '../Attachment';
import { useMediaUrl } from '../context/AttachmentContext';
import { useCollapse } from '../hooks/useCollapse';

export const AudioAttachment: FC<AudioAttachmentProps> = ({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { FileProp, MessageAttachmentBase } from '@rocket.chat/core-typings';
import { useMediaUrl } from '@rocket.chat/ui-contexts';
import React, { FC } from 'react';

import MarkdownText from '../../../MarkdownText';
import Attachment from '../Attachment';
import { useMediaUrl } from '../context/AttachmentContext';

export type GenericFileAttachmentProps = {
file?: FileProp;
Expand Down
Loading