Skip to content

Commit 2f30475

Browse files
authored
Merge branch 'develop' into fix/error-priority
2 parents 03709bc + 7b176ff commit 2f30475

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

.changeset/tall-sloths-exercise.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@rocket.chat/meteor': patch
3+
---
4+
5+
Fixes an issue where voice call button is not displaying in navbar on mobile screen sizes
6+
> This change is being tested under `Enhanced navigation experience` feature preview, in order to check it you need to enabled it

apps/meteor/client/NavBarV2/NavBarControls/NavBarControlsMenu.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,15 @@ type NavBarControlsMenuProps = Omit<HTMLAttributes<HTMLElement>, 'is'> & {
1212
callItem?: GenericMenuItemProps;
1313
};
1414

15-
const NavBarControlsMenu = ({ omnichannelItems, isPressed, ...props }: NavBarControlsMenuProps) => {
15+
const NavBarControlsMenu = ({ omnichannelItems, isPressed, callItem, ...props }: NavBarControlsMenuProps) => {
1616
const { t } = useTranslation();
1717
const showOmnichannel = useOmnichannelEnabled();
1818

1919
const sections = [
20+
{
21+
title: t('Voice_Call'),
22+
items: callItem ? [callItem] : [],
23+
},
2024
{
2125
title: t('Omnichannel'),
2226
items: showOmnichannel ? omnichannelItems : [],

apps/meteor/client/NavBarV2/NavBarControls/NavBarControlsWithData.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { GenericMenuItemProps } from '@rocket.chat/ui-client';
2+
import { useMediaCallAction } from '@rocket.chat/ui-voip';
23
import type { HTMLAttributes } from 'react';
34

45
import NavBarControlsMenu from './NavBarControlsMenu';
@@ -13,6 +14,8 @@ type NavBarControlsMenuProps = Omit<HTMLAttributes<HTMLElement>, 'is'>;
1314
const NavBarControlsWithData = (props: NavBarControlsMenuProps) => {
1415
const isCallEnabled = useIsCallEnabled();
1516

17+
const callAction = useMediaCallAction();
18+
1619
const {
1720
isEnabled: queueEnabled,
1821
icon: queueIcon,
@@ -34,6 +37,15 @@ const NavBarControlsWithData = (props: NavBarControlsMenuProps) => {
3437
handleAvailableStatusChange,
3538
} = useOmnichannelLivechatToggle();
3639

40+
const callItem = callAction
41+
? {
42+
id: 'rcx-media-call',
43+
icon: callAction.icon,
44+
content: callAction.title,
45+
onClick: () => callAction.action(),
46+
}
47+
: undefined;
48+
3749
const omnichannelItems = [
3850
queueEnabled && {
3951
id: 'omnichannelQueue',
@@ -58,10 +70,10 @@ const NavBarControlsWithData = (props: NavBarControlsMenuProps) => {
5870
const isPressed = isQueuePressed || isContactPressed;
5971

6072
if (isCallEnabled) {
61-
return <NavbarControlsWithCall omnichannelItems={omnichannelItems} isPressed={isPressed} {...props} />;
73+
return <NavbarControlsWithCall callItem={callItem} omnichannelItems={omnichannelItems} isPressed={isPressed} {...props} />;
6274
}
6375

64-
return <NavBarControlsMenu omnichannelItems={omnichannelItems} isPressed={isPressed} {...props} />;
76+
return <NavBarControlsMenu callItem={callItem} omnichannelItems={omnichannelItems} isPressed={isPressed} {...props} />;
6577
};
6678

6779
export default NavBarControlsWithData;

0 commit comments

Comments
 (0)