feat(prejoin): add showHangUp config option to prejoinConfig (#16531)

This commit is contained in:
Mihaela Dumitru
2025-10-13 10:46:04 +03:00
committed by GitHub
parent a96908dd7c
commit 95ecf73c71
4 changed files with 13 additions and 6 deletions

View File

@@ -805,7 +805,9 @@ var config = {
// // By setting preCallTestEnabled, you enable the pre-call test in the prejoin page.
// // ICE server credentials need to be provided over the preCallTestICEUrl
// preCallTestEnabled: false,
// preCallTestICEUrl: ''
// preCallTestICEUrl: '',
// // Shows the hangup button in the lobby screen.
// showHangUp: true,
// },
// When 'true', the user cannot edit the display name.

View File

@@ -524,6 +524,7 @@ export interface IConfig {
hideExtraJoinButtons?: Array<string>;
preCallTestEnabled?: boolean;
preCallTestICEUrl?: string;
showHangUp?: boolean;
};
raisedHands?: {
disableLowerHandByModerator?: boolean;

View File

@@ -282,15 +282,18 @@ const PreMeetingScreen = ({
* @returns {Object}
*/
function mapStateToProps(state: IReduxState, ownProps: Partial<IProps>) {
const { hiddenPremeetingButtons } = state['features/base/config'];
const { hiddenPremeetingButtons, prejoinConfig } = state['features/base/config'];
const { toolbarButtons } = state['features/toolbox'];
const { showHangUp = true } = getLobbyConfig(state);
const { knocking } = state['features/lobby'];
const { showHangUp: showHangUpLobby = true } = getLobbyConfig(state);
const { showHangUp: showHangUpPrejoin = true } = prejoinConfig || {};
const premeetingButtons = (ownProps.thirdParty
? THIRD_PARTY_PREJOIN_BUTTONS
: PREMEETING_BUTTONS).filter((b: any) => !(hiddenPremeetingButtons || []).includes(b));
if (showHangUp && knocking && !premeetingButtons.includes('hangup')) {
const shouldShowHangUp = knocking ? showHangUpLobby : showHangUpPrejoin;
if (shouldShowHangUp && !premeetingButtons.includes('hangup')) {
premeetingButtons.push('hangup');
}

View File

@@ -61,7 +61,8 @@ const Prejoin: React.FC<IPrejoinProps> = ({ navigation }: IPrejoinProps) => {
const isDisplayNameReadonly = useSelector(isNameReadOnly);
const roomName = useSelector((state: IReduxState) => getConferenceName(state));
const roomNameEnabled = useSelector((state: IReduxState) => isRoomNameEnabled(state));
const { showHangUp = true } = useSelector((state: IReduxState) => getLobbyConfig(state));
const { showHangUp: showHangUpLobby = true } = useSelector((state: IReduxState) => getLobbyConfig(state));
const { showHangUp: showHangUpPrejoin = true } = useSelector((state: IReduxState) => state['features/base/config'].prejoinConfig || {});
const { knocking } = useSelector((state: IReduxState) => state['features/lobby']);
const participantName = localParticipant?.name;
const [ displayName, setDisplayName ]
@@ -190,7 +191,7 @@ const Prejoin: React.FC<IPrejoinProps> = ({ navigation }: IPrejoinProps) => {
<VideoMuteButton
styles = { styles.buttonStylesBorderless } />
{
showHangUp && knocking
(knocking ? showHangUpLobby : showHangUpPrejoin)
&& <HangupButton
styles = { styles.buttonStylesBorderless } />
}