-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: delete
client/navbar
and rename client/NavBarV2
to `client…
…/navbar`
- Loading branch information
1 parent
eef15b4
commit 6cb5934
Showing
45 changed files
with
86 additions
and
244 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,87 @@ | ||
import React from 'react'; | ||
import { useToolbar } from '@react-aria/toolbar'; | ||
import { NavBar as NavBarComponent, NavBarSection, NavBarGroup, NavBarDivider } from '@rocket.chat/fuselage'; | ||
import { usePermission, useTranslation, useUser } from '@rocket.chat/ui-contexts'; | ||
import { useVoipState } from '@rocket.chat/ui-voip'; | ||
import React, { useRef } from 'react'; | ||
|
||
import { Navbar as NavbarComponent } from '../components/Navbar'; | ||
import NavbarAdministrationAction from './actions/NavbarAdministrationAction'; | ||
import NavbarAuditAction from './actions/NavbarAuditAction'; | ||
import NavbarHomeAction from './actions/NavbarHomeAction'; | ||
import NavbarMarketplaceAction from './actions/NavbarMarketplaceAction'; | ||
import NavbarUserAction from './actions/NavbarUserAction'; | ||
import { useIsCallEnabled, useIsCallReady } from '../contexts/CallContext'; | ||
import { useOmnichannelEnabled } from '../hooks/omnichannel/useOmnichannelEnabled'; | ||
import { useOmnichannelShowQueueLink } from '../hooks/omnichannel/useOmnichannelShowQueueLink'; | ||
import { useHasLicenseModule } from '../hooks/useHasLicenseModule'; | ||
import { | ||
NavBarItemOmniChannelCallDialPad, | ||
NavBarItemOmnichannelContact, | ||
NavBarItemOmnichannelLivechatToggle, | ||
NavBarItemOmnichannelQueue, | ||
NavBarItemOmnichannelCallToggle, | ||
} from './NavBarOmnichannelToolbar'; | ||
import { NavBarItemMarketPlaceMenu, NavBarItemAuditMenu, NavBarItemDirectoryPage, NavBarItemHomePage } from './NavBarPagesToolbar'; | ||
import { NavBarItemLoginPage, NavBarItemAdministrationMenu, UserMenu } from './NavBarSettingsToolbar'; | ||
import { NavBarItemVoipDialer } from './NavBarVoipToolbar'; | ||
|
||
const NavBar = () => { | ||
const t = useTranslation(); | ||
const user = useUser(); | ||
|
||
const hasAuditLicense = useHasLicenseModule('auditing') === true; | ||
|
||
const showOmnichannel = useOmnichannelEnabled(); | ||
const hasManageAppsPermission = usePermission('manage-apps'); | ||
const hasAccessMarketplacePermission = usePermission('access-marketplace'); | ||
const showMarketplace = hasAccessMarketplacePermission || hasManageAppsPermission; | ||
|
||
const showOmnichannelQueueLink = useOmnichannelShowQueueLink(); | ||
const isCallEnabled = useIsCallEnabled(); | ||
const isCallReady = useIsCallReady(); | ||
const { isEnabled: showVoip } = useVoipState(); | ||
|
||
const pagesToolbarRef = useRef(null); | ||
const { toolbarProps: pagesToolbarProps } = useToolbar({ 'aria-label': t('Pages') }, pagesToolbarRef); | ||
|
||
const omnichannelToolbarRef = useRef(null); | ||
const { toolbarProps: omnichannelToolbarProps } = useToolbar({ 'aria-label': t('Omnichannel') }, omnichannelToolbarRef); | ||
|
||
const voipToolbarRef = useRef(null); | ||
const { toolbarProps: voipToolbarProps } = useToolbar({ 'aria-label': t('Voice_Call') }, voipToolbarRef); | ||
|
||
const Navbar = () => { | ||
return ( | ||
<NavbarComponent> | ||
<NavbarUserAction /> | ||
<NavbarHomeAction /> | ||
<NavbarMarketplaceAction /> | ||
<NavbarAuditAction /> | ||
<NavbarAdministrationAction /> | ||
</NavbarComponent> | ||
<NavBarComponent aria-label='header'> | ||
<NavBarSection> | ||
<NavBarGroup role='toolbar' ref={pagesToolbarRef} {...pagesToolbarProps}> | ||
<NavBarItemHomePage title={t('Home')} /> | ||
<NavBarItemDirectoryPage title={t('Directory')} /> | ||
{showMarketplace && <NavBarItemMarketPlaceMenu />} | ||
{hasAuditLicense && <NavBarItemAuditMenu />} | ||
</NavBarGroup> | ||
{showOmnichannel && ( | ||
<> | ||
<NavBarDivider /> | ||
<NavBarGroup role='toolbar' ref={omnichannelToolbarRef} {...omnichannelToolbarProps}> | ||
{showOmnichannelQueueLink && <NavBarItemOmnichannelQueue title={t('Queue')} />} | ||
{isCallReady && <NavBarItemOmniChannelCallDialPad />} | ||
<NavBarItemOmnichannelContact title={t('Contacts')} /> | ||
{isCallEnabled && <NavBarItemOmnichannelCallToggle />} | ||
<NavBarItemOmnichannelLivechatToggle /> | ||
</NavBarGroup> | ||
</> | ||
)} | ||
{showVoip && ( | ||
<> | ||
<NavBarDivider /> | ||
<NavBarGroup role='toolbar' ref={voipToolbarRef} {...voipToolbarProps}> | ||
<NavBarItemVoipDialer primary={isCallEnabled} /> | ||
</NavBarGroup> | ||
</> | ||
)} | ||
</NavBarSection> | ||
<NavBarSection> | ||
<NavBarGroup aria-label={t('Workspace_and_user_settings')}> | ||
<NavBarItemAdministrationMenu /> | ||
{user ? <UserMenu user={user} /> : <NavBarItemLoginPage />} | ||
</NavBarGroup> | ||
</NavBarSection> | ||
</NavBarComponent> | ||
); | ||
}; | ||
|
||
export default Navbar; | ||
export default NavBar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
44 changes: 0 additions & 44 deletions
44
apps/meteor/client/navbar/actions/NavbarMarketplaceAction.tsx
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export { default } from './Navbar'; | ||
export { default } from './NavBar'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters