Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Remove side pane control button container if no controls are present to be used",
"packageName": "@azure/communication-react",
"email": "94866715+dmceachernmsft@users.noreply.github.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Remove side pane control button container if no controls are present to be used",
"packageName": "@azure/communication-react",
"email": "94866715+dmceachernmsft@users.noreply.github.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -377,41 +377,45 @@ export const CommonCallControlBar = (props: CommonCallControlBarProps & Containe
</Stack>
</CallAdapterProvider>
</Stack.Item>
{!props.mobileView && (
<Stack.Item>
<div ref={sidepaneControlsRef}>
<Stack horizontal className={!props.mobileView ? mergeStyles(desktopButtonContainerStyle) : undefined}>
{
/* @conditional-compile-remove(control-bar-button-injection) */
customButtons['secondary']
?.slice(0, CUSTOM_BUTTON_OPTIONS.MAX_SECONDARY_DESKTOP_CUSTOM_BUTTONS)
.map((CustomButton, i) => {
return (
<CustomButton
key={`secondary-custom-button-${i}`}
styles={commonButtonStyles}
showLabel={options.displayType !== 'compact'}
/>
);
})
}
{isEnabled(options?.peopleButton) && (
<PeopleButton
checked={props.peopleButtonChecked}
ariaLabel={peopleButtonStrings?.label}
showLabel={options.displayType !== 'compact'}
onClick={props.onPeopleButtonClicked}
data-ui-id="common-call-composite-people-button"
disabled={props.disableButtonsForLobbyPage || isDisabled(options.peopleButton)}
strings={peopleButtonStrings}
styles={commonButtonStyles}
/>
)}
{isEnabled(options?.chatButton) && chatButton}
</Stack>
</div>
</Stack.Item>
)}
{!props.mobileView &&
(isEnabled(options.peopleButton) ||
Copy link
Copy Markdown
Member

@JamesBurnside JamesBurnside May 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider making this a bool above to reduce the amount to parse here

const secondaryButtonsExist = !props.mobileView && (isEnabled(options.peopleButton) || isEnabled(options.chatButton) || customButtons['secondary'] !== undefined)

isEnabled(options.chatButton) ||
/* @conditional-compile-remove(control-bar-button-injection) */ customButtons['secondary'] !==
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove conditional compile, callwithchat uses this

undefined) && (
<Stack.Item>
<div ref={sidepaneControlsRef}>
<Stack horizontal className={!props.mobileView ? mergeStyles(desktopButtonContainerStyle) : undefined}>
{
/* @conditional-compile-remove(control-bar-button-injection) */
customButtons['secondary']
?.slice(0, CUSTOM_BUTTON_OPTIONS.MAX_SECONDARY_DESKTOP_CUSTOM_BUTTONS)
.map((CustomButton, i) => {
return (
<CustomButton
key={`secondary-custom-button-${i}`}
styles={commonButtonStyles}
showLabel={options.displayType !== 'compact'}
/>
);
})
}
{isEnabled(options?.peopleButton) && (
<PeopleButton
checked={props.peopleButtonChecked}
ariaLabel={peopleButtonStrings?.label}
showLabel={options.displayType !== 'compact'}
onClick={props.onPeopleButtonClicked}
data-ui-id="common-call-composite-people-button"
disabled={props.disableButtonsForLobbyPage || isDisabled(options.peopleButton)}
strings={peopleButtonStrings}
styles={commonButtonStyles}
/>
)}
{isEnabled(options?.chatButton) && chatButton}
</Stack>
</div>
</Stack.Item>
)}
</Stack>
</div>
);
Expand Down