Skip to content

Commit

Permalink
chore: rename HeaderV2 from ui-client to Header and adjust imports
Browse files Browse the repository at this point in the history
  • Loading branch information
juliajforesti committed Dec 20, 2024
1 parent 73a744a commit 784f905
Show file tree
Hide file tree
Showing 66 changed files with 49 additions and 169 deletions.
4 changes: 0 additions & 4 deletions apps/meteor/client/components/Header/Header.tsx

This file was deleted.

4 changes: 0 additions & 4 deletions apps/meteor/client/components/Header/HeaderAvatar.tsx

This file was deleted.

4 changes: 0 additions & 4 deletions apps/meteor/client/components/Header/HeaderContent.tsx

This file was deleted.

4 changes: 0 additions & 4 deletions apps/meteor/client/components/Header/HeaderContentRow.tsx

This file was deleted.

4 changes: 0 additions & 4 deletions apps/meteor/client/components/Header/HeaderDivider.tsx

This file was deleted.

4 changes: 0 additions & 4 deletions apps/meteor/client/components/Header/HeaderIcon.tsx

This file was deleted.

4 changes: 0 additions & 4 deletions apps/meteor/client/components/Header/HeaderState.tsx

This file was deleted.

4 changes: 0 additions & 4 deletions apps/meteor/client/components/Header/HeaderSubtitle.tsx

This file was deleted.

4 changes: 0 additions & 4 deletions apps/meteor/client/components/Header/HeaderTag.tsx

This file was deleted.

4 changes: 0 additions & 4 deletions apps/meteor/client/components/Header/HeaderTagIcon.tsx

This file was deleted.

4 changes: 0 additions & 4 deletions apps/meteor/client/components/Header/HeaderTagSkeleton.tsx

This file was deleted.

4 changes: 0 additions & 4 deletions apps/meteor/client/components/Header/HeaderTitle.tsx

This file was deleted.

4 changes: 0 additions & 4 deletions apps/meteor/client/components/Header/HeaderTitleButton.tsx

This file was deleted.

4 changes: 0 additions & 4 deletions apps/meteor/client/components/Header/HeaderToolbar.tsx

This file was deleted.

4 changes: 0 additions & 4 deletions apps/meteor/client/components/Header/HeaderToolbarAction.tsx

This file was deleted.

This file was deleted.

4 changes: 0 additions & 4 deletions apps/meteor/client/components/Header/HeaderToolbarDivider.tsx

This file was deleted.

37 changes: 0 additions & 37 deletions apps/meteor/client/components/Header/index.ts

This file was deleted.

3 changes: 1 addition & 2 deletions apps/meteor/client/components/Page/PageHeaderNoShadow.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Box, IconButton } from '@rocket.chat/fuselage';
import { useDocumentTitle } from '@rocket.chat/ui-client';
import { useDocumentTitle, HeaderToolbar } from '@rocket.chat/ui-client';
import { useLayout } from '@rocket.chat/ui-contexts';
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
import React from 'react';
import { useTranslation } from 'react-i18next';

import { HeaderToolbar } from '../Header';
import SidebarToggler from '../SidebarToggler';

type PageHeaderProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { GenericMenu } from '@rocket.chat/ui-client';
import { GenericMenu, HeaderToolbarAction } from '@rocket.chat/ui-client';
import React, { useMemo } from 'react';

import useVideoConfMenuOptions from './useVideoConfMenuOptions';
import useVoipMenuOptions from './useVoipMenuOptions';
import HeaderToolbarAction from '../../../components/Header/HeaderToolbarAction';
import type { RoomToolboxActionConfig } from '../../../views/room/contexts/RoomToolboxContext';

export const useStartCallRoomAction = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { BadgeProps } from '@rocket.chat/fuselage';
import { HeaderToolbarAction, HeaderToolbarActionBadge } from '@rocket.chat/ui-client';
import { useSetting } from '@rocket.chat/ui-contexts';
import React, { lazy, useMemo } from 'react';
import { useTranslation } from 'react-i18next';

import { HeaderToolbarAction, HeaderToolbarActionBadge } from '../../components/Header';
import { useRoomSubscription } from '../../views/room/contexts/RoomContext';
import type { RoomToolboxActionConfig } from '../../views/room/contexts/RoomToolboxContext';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { HeaderTag, HeaderTagIcon } from '@rocket.chat/ui-client';
import type { ReactElement } from 'react';
import React, { useMemo } from 'react';

import { HeaderTag, HeaderTagIcon } from '../../../components/Header';
import type { IRoomWithFederationOriginalName } from '../contexts/RoomContext';

type FederatedRoomOriginServerProps = {
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/views/room/Header/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { IRoom } from '@rocket.chat/core-typings';
import { isVoipRoom } from '@rocket.chat/core-typings';
import { HeaderToolbar } from '@rocket.chat/ui-client';
import { useLayout, useSetting } from '@rocket.chat/ui-contexts';
import type { ReactElement } from 'react';
import React, { lazy, memo, useMemo } from 'react';

import { HeaderToolbar } from '../../../components/Header';
import SidebarToggler from '../../../components/SidebarToggler';

const OmnichannelRoomHeader = lazy(() => import('./Omnichannel/OmnichannelRoomHeader'));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { IRoom } from '@rocket.chat/core-typings';
import { isOmnichannelRoom } from '@rocket.chat/core-typings';
import { HeaderIcon } from '@rocket.chat/ui-client';
import type { ReactElement } from 'react';
import React from 'react';

import { HeaderIcon } from '../../../components/Header';
import { OmnichannelRoomIcon } from '../../../components/RoomIcon/OmnichannelRoomIcon';
import { useRoomIcon } from '../../../hooks/useRoomIcon';

Expand Down
3 changes: 1 addition & 2 deletions apps/meteor/client/views/room/Header/HeaderSkeleton.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Skeleton } from '@rocket.chat/fuselage';
import { Header, HeaderAvatar, HeaderContent, HeaderContentRow } from '@rocket.chat/ui-client';
import React from 'react';

import { Header, HeaderAvatar, HeaderContent, HeaderContentRow } from '../../../components/Header';

const HeaderSkeleton = () => {
return (
<Header>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { useMutableCallback } from '@rocket.chat/fuselage-hooks';
import { HeaderToolbarAction } from '@rocket.chat/ui-client';
import { useRouter } from '@rocket.chat/ui-contexts';
import type { ReactElement } from 'react';
import React from 'react';
import { useTranslation } from 'react-i18next';

import { HeaderToolbarAction } from '../../../../components/Header';

type BackButtonProps = { routeName?: string };

const BackButton = ({ routeName }: BackButtonProps): ReactElement => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { HeaderToolbar } from '@rocket.chat/ui-client';
import { useLayout, useRouter } from '@rocket.chat/ui-contexts';
import React, { useCallback, useMemo } from 'react';
import { useSyncExternalStore } from 'use-sync-external-store/shim';

import { HeaderToolbar } from '../../../../components/Header';
import SidebarToggler from '../../../../components/SidebarToggler';
import { useOmnichannelRoom } from '../../contexts/RoomContext';
import RoomHeader from '../RoomHeader';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { IOmnichannelRoom } from '@rocket.chat/core-typings';
import { Box, Dropdown, Option } from '@rocket.chat/fuselage';
import { HeaderToolbarAction } from '@rocket.chat/ui-client';
import React, { memo, useRef } from 'react';
import { useTranslation } from 'react-i18next';

import { HeaderToolbarAction } from '../../../../../components/Header';
import { useDropdownVisibility } from '../../../../../sidebar/header/hooks/useDropdownVisibility';
import type { QuickActionsActionOptions } from '../../../lib/quickActions';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { Box } from '@rocket.chat/fuselage';
import { HeaderToolbar, HeaderToolbarAction, HeaderToolbarDivider } from '@rocket.chat/ui-client';
import type { ComponentProps } from 'react';
import React, { memo } from 'react';
import { useTranslation } from 'react-i18next';

import QuickActionOptions from './QuickActionOptions';
import { useQuickActions } from './hooks/useQuickActions';
import { HeaderToolbar, HeaderToolbarAction, HeaderToolbarDivider } from '../../../../../components/Header';
import { useOmnichannelRoom } from '../../../contexts/RoomContext';

type QuickActionsProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { IVoipRoom } from '@rocket.chat/core-typings';
import { HeaderToolbar } from '@rocket.chat/ui-client';
import { useLayout, useRouter } from '@rocket.chat/ui-contexts';
import React, { useCallback, useMemo } from 'react';
import { useSyncExternalStore } from 'use-sync-external-store/shim';

import { HeaderToolbar } from '../../../../components/Header';
import SidebarToggler from '../../../../components/SidebarToggler';
import { parseOutboundPhoneNumber } from '../../../../lib/voip/parseOutboundPhoneNumber';
import type { RoomHeaderProps } from '../RoomHeader';
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/views/room/Header/ParentRoom.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { IRoom } from '@rocket.chat/core-typings';
import { HeaderTag, HeaderTagIcon } from '@rocket.chat/ui-client';
import React from 'react';

import { HeaderTag, HeaderTagIcon } from '../../../components/Header';
import { useRoomIcon } from '../../../hooks/useRoomIcon';
import { roomCoordinator } from '../../../lib/rooms/roomCoordinator';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { IRoom } from '@rocket.chat/core-typings';
import { HeaderTagSkeleton } from '@rocket.chat/ui-client';
import React from 'react';

import ParentRoom from './ParentRoom';
import { HeaderTagSkeleton } from '../../../components/Header';
import { useRoomInfoEndpoint } from '../../../hooks/useRoomInfoEndpoint';

type ParentRoomWithEndpointDataProps = {
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/views/room/Header/ParentTeam.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { IRoom } from '@rocket.chat/core-typings';
import { TEAM_TYPE } from '@rocket.chat/core-typings';
import { HeaderTag, HeaderTagIcon, HeaderTagSkeleton } from '@rocket.chat/ui-client';
import { useUserId, useEndpoint } from '@rocket.chat/ui-contexts';
import { useQuery } from '@tanstack/react-query';
import React from 'react';

import { HeaderTag, HeaderTagIcon, HeaderTagSkeleton } from '../../../components/Header';
import { goToRoomById } from '../../../lib/utils/goToRoomById';

type APIErrorResult = { success: boolean; error: string };
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/views/room/Header/RoomHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { IRoom } from '@rocket.chat/core-typings';
import { isRoomFederated } from '@rocket.chat/core-typings';
import { RoomAvatar } from '@rocket.chat/ui-avatar';
import { Header, HeaderAvatar, HeaderContent, HeaderContentRow, HeaderToolbar } from '@rocket.chat/ui-client';
import React, { Suspense } from 'react';
import { useTranslation } from 'react-i18next';

Expand All @@ -12,7 +13,6 @@ import RoomToolbox from './RoomToolbox';
import Encrypted from './icons/Encrypted';
import Favorite from './icons/Favorite';
import Translate from './icons/Translate';
import { Header, HeaderAvatar, HeaderContent, HeaderContentRow, HeaderToolbar } from '../../../components/Header';

export type RoomHeaderProps = {
room: IRoom;
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/views/room/Header/RoomLeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import type { IUser } from '@rocket.chat/core-typings';
import { css } from '@rocket.chat/css-in-js';
import { Box, IconButton } from '@rocket.chat/fuselage';
import { UserAvatar } from '@rocket.chat/ui-avatar';
import { HeaderSubtitle } from '@rocket.chat/ui-client';
import type { UIEvent } from 'react';
import React, { useCallback, useMemo } from 'react';
import { useTranslation } from 'react-i18next';

import { HeaderSubtitle } from '../../../components/Header';
import { ReactiveUserStatus } from '../../../components/UserStatus';
import { roomCoordinator } from '../../../lib/rooms/roomCoordinator';
import { useUserCard } from '../contexts/UserCardContext';
Expand Down
3 changes: 1 addition & 2 deletions apps/meteor/client/views/room/Header/RoomTitle.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { isTeamRoom, type IRoom } from '@rocket.chat/core-typings';
import { useEffectEvent } from '@rocket.chat/fuselage-hooks';
import { useDocumentTitle } from '@rocket.chat/ui-client';
import { useDocumentTitle, HeaderTitle, HeaderTitleButton } from '@rocket.chat/ui-client';
import type { KeyboardEvent } from 'react';
import React from 'react';

import HeaderIconWithRoom from './HeaderIconWithRoom';
import { HeaderTitle, HeaderTitleButton } from '../../../components/Header';
import { useRoomToolbox } from '../contexts/RoomToolboxContext';

type RoomTitleProps = { room: IRoom };
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import type { Box } from '@rocket.chat/fuselage';
import { useEffectEvent } from '@rocket.chat/fuselage-hooks';
import { GenericMenu } from '@rocket.chat/ui-client';
import type { GenericMenuItemProps } from '@rocket.chat/ui-client';
import { GenericMenu, HeaderToolbarAction, HeaderToolbarDivider } from '@rocket.chat/ui-client';
import { useLayout } from '@rocket.chat/ui-contexts';
import type { ComponentProps } from 'react';
import React, { memo } from 'react';
import { useTranslation } from 'react-i18next';

import { HeaderToolbarAction, HeaderToolbarDivider } from '../../../../components/Header';
import { useRoomToolbox } from '../../contexts/RoomToolboxContext';
import type { RoomToolboxActionConfig } from '../../contexts/RoomToolboxContext';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useStableArray } from '@rocket.chat/fuselage-hooks';
import { HeaderToolbarAction } from '@rocket.chat/ui-client';
import React from 'react';
import { useTranslation } from 'react-i18next';

import { HeaderToolbarAction } from '../../../../components/Header';
import { roomActionHooksForE2EESetup } from '../../../../ui';
import type { RoomToolboxActionConfig } from '../../contexts/RoomToolboxContext';
import { useRoomToolbox } from '../../contexts/RoomToolboxContext';
Expand Down
3 changes: 1 addition & 2 deletions apps/meteor/client/views/room/Header/icons/Encrypted.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import type { IRoom } from '@rocket.chat/core-typings';
import colors from '@rocket.chat/fuselage-tokens/colors';
import { HeaderState } from '@rocket.chat/ui-client';
import { useSetting } from '@rocket.chat/ui-contexts';
import React, { memo } from 'react';
import { useTranslation } from 'react-i18next';

import { HeaderState } from '../../../../components/Header';

const Encrypted = ({ room }: { room: IRoom }) => {
const { t } = useTranslation();
const e2eEnabled = useSetting('E2E_Enable');
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/views/room/Header/icons/Favorite.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { IRoom, ISubscription } from '@rocket.chat/core-typings';
import { useEffectEvent } from '@rocket.chat/fuselage-hooks';
import { HeaderState } from '@rocket.chat/ui-client';
import { useSetting, useTranslation } from '@rocket.chat/ui-contexts';
import React, { memo } from 'react';

import { HeaderState } from '../../../../components/Header';
import { useUserIsSubscribed } from '../../contexts/RoomContext';
import { useToggleFavoriteMutation } from '../../hooks/useToggleFavoriteMutation';

Expand Down
3 changes: 1 addition & 2 deletions apps/meteor/client/views/room/Header/icons/Translate.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import type { IRoom } from '@rocket.chat/core-typings';
import { HeaderState } from '@rocket.chat/ui-client';
import { useSetting } from '@rocket.chat/ui-contexts';
import React, { memo } from 'react';
import { useTranslation } from 'react-i18next';

import { HeaderState } from '../../../../components/Header';

type TranslateProps = {
room: IRoom;
};
Expand Down
Loading

0 comments on commit 784f905

Please sign in to comment.