[MM-58271] User Profile pop up | Make Call button appear Disabled when user is on active call (#27020)

Этот коммит содержится в:
M-ZubairAhmed
2024-05-18 08:45:31 +00:00
коммит произвёл GitHub
родитель b9f7d38cb1
Коммит cef7826fa8
3 изменённых файлов: 19 добавлений и 24 удалений

Просмотреть файл

@@ -223,5 +223,12 @@
row-gap: 4px; row-gap: 4px;
} }
} }
button#startCallButton {
&.icon-btn-disabled {
cursor: not-allowed;
opacity: 0.65;
}
}
} }
} }

Просмотреть файл

@@ -6,21 +6,18 @@ import React, {useCallback, useEffect, useState} from 'react';
import {useIntl} from 'react-intl'; import {useIntl} from 'react-intl';
import {useSelector} from 'react-redux'; import {useSelector} from 'react-redux';
import {PhoneInTalkIcon} from '@mattermost/compass-icons/components';
import {Client4} from 'mattermost-redux/client'; import {Client4} from 'mattermost-redux/client';
import {getChannelByName} from 'mattermost-redux/selectors/entities/channels'; import {getChannelByName} from 'mattermost-redux/selectors/entities/channels';
import {isCallsEnabled as getIsCallsEnabled, getSessionsInCalls} from 'selectors/calls'; import {isCallsEnabled as getIsCallsEnabled, getSessionsInCalls} from 'selectors/calls';
import OverlayTrigger from 'components/overlay_trigger';
import ProfilePopoverCallButton from 'components/profile_popover/profile_popover_calls_button'; import ProfilePopoverCallButton from 'components/profile_popover/profile_popover_calls_button';
import Tooltip from 'components/tooltip'; import WithTooltip from 'components/with_tooltip';
import Constants from 'utils/constants';
import {getDirectChannelName} from 'utils/utils'; import {getDirectChannelName} from 'utils/utils';
import type {GlobalState} from 'types/store'; import type {GlobalState} from 'types/store';
type Props = { type Props = {
userId: string; userId: string;
currentUserId: string; currentUserId: string;
@@ -98,29 +95,26 @@ const CallButton = ({
id: 'webapp.mattermost.feature.start_call', id: 'webapp.mattermost.feature.start_call',
defaultMessage: 'Start Call', defaultMessage: 'Start Call',
}); });
const iconButtonClassname = classNames('style--none btn btn-icon btn-sm', {'icon-btn-disabled': disabled}); const iconButtonClassName = classNames('btn btn-icon btn-sm style--none', {'icon-btn-disabled': disabled});
const callButton = ( const callButton = (
<OverlayTrigger <WithTooltip
delayShow={Constants.OVERLAY_TIME_DELAY} id='startCallTooltip'
title={startCallMessage}
placement='top' placement='top'
overlay={
<Tooltip id='startCallTooltip'>
{startCallMessage}
</Tooltip>
}
> >
<button <button
id='startCallButton' id='startCallButton'
type='button' type='button'
aria-disabled={disabled} aria-disabled={disabled}
className={iconButtonClassname} className={iconButtonClassName}
aria-label={startCallMessage}
> >
<PhoneInTalkIcon <span
size={18} className='icon icon-phone'
aria-label={startCallMessage} aria-hidden='true'
/> />
</button> </button>
</OverlayTrigger> </WithTooltip>
); );
if (disabled) { if (disabled) {

Просмотреть файл

@@ -1,6 +0,0 @@
button#startCallButton {
&.btn-disabled-styled {
cursor: not-allowed;
opacity: 0.65;
}
}