2023-06-29 14:59:12 +03:00
|
|
|
import React from 'react';
|
|
|
|
|
import { useSelector } from 'react-redux';
|
|
|
|
|
|
|
|
|
|
import { IReduxState } from '../../../app/types';
|
|
|
|
|
import { isMobileBrowser } from '../../../base/environment/utils';
|
|
|
|
|
import { IProps as AbstractButtonProps } from '../../../base/toolbox/components/AbstractButton';
|
2024-02-01 12:54:40 -06:00
|
|
|
import { isReactionsButtonEnabled, shouldDisplayReactionsButtons } from '../../functions.web';
|
2023-06-29 14:59:12 +03:00
|
|
|
|
|
|
|
|
import RaiseHandButton from './RaiseHandButton';
|
|
|
|
|
import ReactionsMenuButton from './ReactionsMenuButton';
|
|
|
|
|
|
|
|
|
|
const RaiseHandContainerButton = (props: AbstractButtonProps) => {
|
|
|
|
|
const reactionsButtonEnabled = useSelector(isReactionsButtonEnabled);
|
2024-02-01 12:54:40 -06:00
|
|
|
const _shouldDisplayReactionsButtons = useSelector(shouldDisplayReactionsButtons);
|
2023-06-29 14:59:12 +03:00
|
|
|
const isNarrowLayout = useSelector((state: IReduxState) => state['features/base/responsive-ui'].isNarrowLayout);
|
|
|
|
|
const showReactionsAsPartOfRaiseHand
|
2024-02-01 12:54:40 -06:00
|
|
|
= _shouldDisplayReactionsButtons && !reactionsButtonEnabled && !isNarrowLayout && !isMobileBrowser();
|
2023-06-29 14:59:12 +03:00
|
|
|
|
|
|
|
|
return showReactionsAsPartOfRaiseHand
|
|
|
|
|
? <ReactionsMenuButton
|
|
|
|
|
{ ...props }
|
|
|
|
|
showRaiseHand = { true } />
|
|
|
|
|
: <RaiseHandButton { ...props } />;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default RaiseHandContainerButton;
|