diff --git a/apps/meteor/client/sidebar/header/actions/Administration.tsx b/apps/meteor/client/sidebar/header/actions/Administration.tsx index 22ce41362304..d2e51f191370 100644 --- a/apps/meteor/client/sidebar/header/actions/Administration.tsx +++ b/apps/meteor/client/sidebar/header/actions/Administration.tsx @@ -4,24 +4,14 @@ import type { HTMLAttributes, VFC } from 'react'; import React from 'react'; import GenericMenu from '../../../components/GenericMenu/GenericMenu'; -import { useAdministrationHighlight } from './hooks/useAdministrationHighlight'; import { useAdministrationMenu } from './hooks/useAdministrationMenu'; -const Administration: VFC, 'is'>> = ({ className, ...props }) => { +const Administration: VFC, 'is'>> = (props) => { const t = useTranslation(); const sections = useAdministrationMenu(); - const { className: highlightBadge } = useAdministrationHighlight(); - return ( - - ); + return ; }; export default Administration; diff --git a/apps/meteor/client/sidebar/header/actions/hooks/useAdministrationHighlight.tsx b/apps/meteor/client/sidebar/header/actions/hooks/useAdministrationHighlight.tsx deleted file mode 100644 index 2fe06915a12d..000000000000 --- a/apps/meteor/client/sidebar/header/actions/hooks/useAdministrationHighlight.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import { css } from '@rocket.chat/css-in-js'; -import { Palette } from '@rocket.chat/fuselage'; - -import { useOmnichannelHighlight } from '../../../../../ee/client/omnichannel/hooks/useOmnichannelHighlight'; - -const highlightBadge = css` - position: relative; - - &::after { - content: ''; - position: absolute; - top: 0; - right: 0; - display: block; - flex: none; - width: 8px; - height: 8px; - background-color: ${Palette.badge['badge-background-level-4'].toString()}; - border-radius: 50%; - } -`; - -export const useAdministrationHighlight = () => { - const { isHighlightVisible: isOmnichannelHighlightVisible } = useOmnichannelHighlight(); - - return { - isHighlightVisible: isOmnichannelHighlightVisible, - get className() { - return this.isHighlightVisible ? highlightBadge : undefined; - }, - }; -}; diff --git a/apps/meteor/client/sidebar/header/actions/hooks/useAdministrationItems.tsx b/apps/meteor/client/sidebar/header/actions/hooks/useAdministrationItems.tsx index 48eda3d22e8e..531545b20a43 100644 --- a/apps/meteor/client/sidebar/header/actions/hooks/useAdministrationItems.tsx +++ b/apps/meteor/client/sidebar/header/actions/hooks/useAdministrationItems.tsx @@ -9,7 +9,6 @@ import { } from '@rocket.chat/ui-contexts'; import React from 'react'; -import { OmnichannelHighlightBadge } from '../../../../../ee/client/omnichannel/components/OmnichannelHighlightBadge'; import type { UpgradeTabVariant } from '../../../../../lib/upgradeTab'; import { getUpgradeTabLabel, isFullyFeature } from '../../../../../lib/upgradeTab'; import Emoji from '../../../../components/Emoji'; @@ -87,7 +86,6 @@ export const useAdministrationItems = (): GenericMenuItemProps[] => { content: t('Omnichannel'), icon: 'headset', onClick: () => router.navigate('/omnichannel/current'), - addon: , }; const upgradeItem: GenericMenuItemProps = { diff --git a/apps/meteor/client/views/omnichannel/sidebarItems.tsx b/apps/meteor/client/views/omnichannel/sidebarItems.tsx index a963697f9946..7942764a8b89 100644 --- a/apps/meteor/client/views/omnichannel/sidebarItems.tsx +++ b/apps/meteor/client/views/omnichannel/sidebarItems.tsx @@ -1,7 +1,4 @@ -import React from 'react'; - import { hasPermission } from '../../../app/authorization/client'; -import { OmnichannelHighlightBadge } from '../../../ee/client/omnichannel/components/OmnichannelHighlightBadge'; import { createSidebarItems } from '../../lib/createSidebarItems'; export const { @@ -14,7 +11,6 @@ export const { href: '/omnichannel/current', icon: 'message', i18nLabel: 'Current_Chats', - badge: () => , permissionGranted: (): boolean => hasPermission('view-livechat-current-chats'), }, { diff --git a/apps/meteor/ee/client/omnichannel/components/OmnichannelHighlightBadge/index.tsx b/apps/meteor/ee/client/omnichannel/components/OmnichannelHighlightBadge/index.tsx deleted file mode 100644 index 460d91b62e2b..000000000000 --- a/apps/meteor/ee/client/omnichannel/components/OmnichannelHighlightBadge/index.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import { Badge } from '@rocket.chat/fuselage'; -import React from 'react'; - -import { useOmnichannelHighlight } from '../../hooks/useOmnichannelHighlight'; - -export const OmnichannelHighlightBadge = () => { - const { isHighlightVisible } = useOmnichannelHighlight(); - - if (!isHighlightVisible) { - return null; - } - - return ; -}; diff --git a/apps/meteor/ee/client/omnichannel/hooks/useCurrentChatsHighlight.ts b/apps/meteor/ee/client/omnichannel/hooks/useCurrentChatsHighlight.ts deleted file mode 100644 index 2e108e9b952a..000000000000 --- a/apps/meteor/ee/client/omnichannel/hooks/useCurrentChatsHighlight.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { useLocalStorage } from '@rocket.chat/fuselage-hooks'; -import { useRouter } from '@rocket.chat/ui-contexts'; -import { useEffect } from 'react'; - -import { useIsOverMacLimit } from '../../../../client/hooks/omnichannel/useIsOverMacLimit'; - -export const useCurrentChatsHighlight = () => { - const isOverMacLimit = useIsOverMacLimit(); - const [isHighlightVisible, setHighlight] = useLocalStorage('omnichannel-current-chats-highlight', isOverMacLimit); - const router = useRouter(); - - useEffect(() => { - if (!isHighlightVisible) { - return; - } - - return router.subscribeToRouteChange(() => { - if (router.getRouteName() !== 'omnichannel-current-chats') { - return; - } - - setHighlight(false); - }); - }, [isHighlightVisible, router, setHighlight]); - - return { - isHighlightVisible, - }; -}; diff --git a/apps/meteor/ee/client/omnichannel/hooks/useOmnichannelHighlight.tsx b/apps/meteor/ee/client/omnichannel/hooks/useOmnichannelHighlight.tsx deleted file mode 100644 index 5e9c1163d15c..000000000000 --- a/apps/meteor/ee/client/omnichannel/hooks/useOmnichannelHighlight.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import { usePermission } from '@rocket.chat/ui-contexts'; - -import { useCurrentChatsHighlight } from './useCurrentChatsHighlight'; - -export const useOmnichannelHighlight = () => { - const isLivechatManager = usePermission('view-livechat-manager'); - const { isHighlightVisible } = useCurrentChatsHighlight(); - - return { isHighlightVisible: isLivechatManager && isHighlightVisible }; -};